IP Routing / Forwarding

1

I have an older program that I use a lot and in order to work properly it has to connect to a time sever (199.211.133.139), for some reason, I am no longer to ping this time server and the program doesn't run. Can I add to the Route table to redirect 199.211.133.239 to another time server such as 174.36.71.205? Windows 7 OS.

Thanks

Jason

Posted 2012-06-16T19:46:16.237

Reputation: 36

No idea how to do this in Windows. In Linux, you could use an iptables DNAT rule to change the destination address. – Steven Monday – 2012-06-16T19:50:35.423

Answers

1

This cannot be done with routing tables. These tables are mainly used to determine what node the packet should be sent to next. If these tables are set up correctly, the packet will eventually end up at a machine specified by the destination address field, which remains unchanged, even though the information may have passed a dozen routers on its way.

The destination address can be rewritten. In Linux operating systems, this is usually done using iptables, but to my knowledge, Windows has no such feature. You could bypass DNS using the hosts file, but this does not work if an IP address is specified instead of a hostname. However, your router might be capable of redirecting traffic based on destination IP.

Marcks Thomas

Posted 2012-06-16T19:46:16.237

Reputation: 5 749

0

Format is:

route add <ipv4_addr> mask <subnet_mask> <gateway_ip> metric <cost_metric>

Example:

route add 10.1.0.0 mask 255.255.255.0 192.168.0.254 metric 25

To make it permanent (remains after reboot):

route -p add 10.1.0.0 mask 255.255.255.0 192.168.0.254 metric 25

To force which interface to use (rather than let Windows choose):

route -p add 10.1.0.0 mask 255.255.255.0 192.168.0.254 metric 25 if 2

To find interface index to use (like "if 2" above):

netsh interface show ipv4 interface

skeetastax

Posted 2012-06-16T19:46:16.237

Reputation: 101

0

If you're looking to add a route to the Windows 7 routing table, use the "route" command. Make sure to use the "-p" switch for the changes to stay after a reboot.

As to whether or not this will solve your problem, I'm not sure.

Russ Warren

Posted 2012-06-16T19:46:16.237

Reputation: 2 523

Thanks. I've been trying the route command, but I've never used it, so having some issue getting the format correct. Can you assist in this? I've tried route add 199.211.133.239 174.36.71.205 and get OK as a response, but when I do Route Print it seems I set the gateway by doing that. – Jason – 2012-06-16T20:41:34.393