1

I have a windows 7 client with a wired ethernet NIC and a wireless 802.11g NIC.

The wired ethernet NIC is connected to a network switch and has subnet 192.168.0.*.

The wireless NIC is connected to a network switch and has subnet 192.168.1.*.

I also can start a VPN which accesses a network which also has subnet 192.168.0.*.

I have a linux system attached to the ethernet switch with an IP address in the 192.168.0.* range. When the VPN is connected, I can't access the linux system any more because, unsurprisingly, the packets are routed through the VPN instead of the ethernet switch.

Is there anything I can do on the W7 box to route just this single IP address corresponding to the linux box through the ethernet switch, leaving all the other 192.168.0.* addresses to be routed via the VPN?

1 Answer 1

1

You should be able to add a route to the Windows machine using the route command. Simply add the address as a /32 route, making it exit via the proper NIC.

Example:

route add 192.168.0.248 mask 255.255.255.255 0.0.0.0 if 11 metric 1

In this case "11" is an interface number, and 0.0.0.0 takes place of the gateway parameter because there is none.

5
  • I'm having a bit of trouble here. The command I'm trying is route add 192.168.0.248 mask 255.266.266.266 if 11 metric 1 - this doesn't work because I'm missing a gateway parameter. But the ethernet NIC is just connected to a switch and there isn't a gateway. What should I use as the gateway parameter?
    – user146172
    Nov 19, 2012 at 21:11
  • 1
    Thanks for the answer edit! I was wondering what "no gateway" could be. All 0s makes sense!
    – gparent
    Nov 19, 2012 at 21:31
  • @user146172 266? That can't be right. Nov 19, 2012 at 23:57
  • If you check edit history, you'll notice he had it right there.
    – gparent
    Nov 20, 2012 at 1:45
  • @David Schwartz yes that was a typo.
    – user146172
    Nov 20, 2012 at 22:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .