Link to home
Start Free TrialLog in
Avatar of PNRT
PNRT

asked on

How to route all traffic on XP workstation via adsl except for one IP

I have a number of standalone and networked laptops and workstations that connect to the internet via ADSL or to the local network via a NIC.  I need these devices to also have a USB 3G card connected at the same time, in order to connect to one particular site/IP only.  When I connect the 3G device ALL routing attempts to route through it.   I need to get all traffic routing through its normal device, ie ADSL, LAN or whatever, but routing through to the single site via the USB Modem.    I can add a single route but what do I use to indicate ALL traffic through one device except the particular site/IP.   The USB Modem will always a  static IP but the ADSL connection / NIC will be dynamic
Avatar of solntcev
solntcev
Flag of Russian Federation image

Just add static route to this single IP with low metric. All other traffic will go by default gateways.
sorry for my english. not native language.
route ADD [IP] MASK 255.255.255.255 [USB card IP] METRIC 0

Open in new window

"-p" flag makes route persistent.
route ADD [IP] MASK 255.255.255.255 [USB card IP] METRIC 0 -p

Open in new window

Avatar of PNRT
PNRT

ASKER

Hi Thanks for this.  This was the idea I had but METRIC 0 gives - "Route: Bad Metric Value 0" and any other value leaves the default gateway as the USB device in the routing table, so everything tries to get out by that.   The metric of the NIC is 25.   When the USB is not connected the default gateway is correct at 192.168.1.1.  When the USB device is connected, the default gateway is the IP of the USB device.   Thanks for your help.

You can make USB card route with big metric, than XP will use routel with less metric values
route ADD 0.0.0.0 MASK 0.0.0.0 [USB card IP] METRIC 100 -p

Open in new window

Avatar of PNRT

ASKER

Thanks for the replies.  Please confirm that I understand correctly.   Route ADD 0.0.0.0 MASK 0.0.0.0 [USB Device IP] METRIC 100 stops the USB device from acting as the default gateway, but when I added this I could not get to the USB Device Network.  I added a second - route ADD [IP] MASK 255.255.255.255 [USB DEVICE] METRIC 2 which then worked OK.  Is this the best method?  One route to stop the device being the gateway and a secong route to add the devices network?
ASKER CERTIFIED SOLUTION
Avatar of solntcev
solntcev
Flag of Russian Federation image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial