Problem adding persistent network routes for specific interface

  • Thread starter Thread starter JJ
  • Start date Start date
J

JJ

For example, I want to route all traffic coming from interface #4 IP
192.168.0.5, to other interface at IP 192.168.0.9. I tried to use the ROUTE
program like below:

route -p add 1.2.3.4 mask 255.255.255.255 192.168.0.9 if 4

The route is added and work properly (tested via PING and Wireshark) as seen
like below via ROUTE PRINT:

Network Destination Netmask Gateway Interface Metric
1.2.3.4 255.255.255.255 192.168.0.9 192.168.0.5 1

But after the PC is rebooted, it shows as:

Network Destination Netmask Gateway Interface Metric
1.2.3.4 255.255.255.255 192.168.0.9 192.168.0.1 1

Where IP 192.168.0.1 is the loopback driver at interface index 2.
Why is it not set to IP 192.168.0.5?

Also, I tried using the NETSH program like so: (long text warning)

netsh routing ip add persistentroute 1.2.3.4 255.255.255.255 wireless
192.168.0.9

It properly adds the route entry as seen via "netsh routing ip show
persistentroute": (long text warning)

Prefix Protocol Prf Met Gateway Vw Interface
------------------ ---------- --- --- --------------- --
----------------
1.2.3.4/32 Non-DOD St 0 1 192.168.0.5 UM Wireless
Network Connection

But the problem is that, it doesn't seem to take any effect immediately. I
have checked this using PING and trace its network packets using Wireshark.
 
Back
Top