Jump to content
xisto Community
dserban

How Do I Create Static Routes In Windows Xp?

Recommended Posts

Here's my setup:My PC connects to my Internet facing wireless router via a USB-pluggable wireless NIC, the IP address of which is 192.168.1.2 (netmask 255.255.255.0).The IP address of my router's LAN port is 192.168.1.1.The NIC which is embedded in the motherboard has remained disabled so far.Everything works OK, but I recently got a hold of a crossover cable, and I started using it to connect a laptop to my PC.So I enabled the embedded NIC on the PC and gave it an IP address of 192.168.2.2 (netmask 255.255.255.0, default gateway 192.168.2.2).The laptop's IP address is 192.168.2.1.My only objective is to able to exchange files between my PC and my laptop.I do not want to connect my laptop to the internet, either directly or indirectly.And here comes my problem:After setting up the (crossover cable) connection between the two, I tried going out to the internet again on my PC, and failed.I tried using tracert to troubleshoot what's going on, and my gut feeling is that as soon as I enabled the embedded NIC on the PC, it seems to think "Oh, this is my new Internet, let me send all the requests from the browser to this new default gateway 192.168.2.2".One solution that comes to my mind is to use static routes. I know what they are in theory, but I don't know how to issue the commands.If anyone has experience using static routes in Windows XP, I would appreciate a few pointers in the right direction.Also, if there is a better / more efficient / more elegant solution, I would very much like to hear it.

Share this post


Link to post
Share on other sites

There's 3 things you can try, non of them belongs to static route.1. Set a permanent DNS in the DNS setting of wireless NIC and set the gateway of both NIC to your router's IP2. Bridge the connection of both your NIC. You can select the 2 NIC, then right click, Bridge Connection. That way, you only need to set 1 IP address for the bridged connection. So, both your NIC will have the same IP, and that should help fix the issue, also it will automatically routes internet on your laptop(if i'm not mistaken, as i have tried the same thing before, quite sometime back)3. Setup internet sharing, to share your internet to your laptop. That way, windows might figure out which NIC is actually connected to the internet.Let me know if any of that works. I seldom play with networking lately, will be good to refresh my theory a bit.Good Luck

Share this post


Link to post
Share on other sites

Try these settings:Wireless Nic:IP: sameNetmask: sameDefault Gateway:192.168.1.1Wired Nic;IP: 192.168.1.3Netmask: 255.255.255.0Default gateway: noneLaptop Nic:IP: 192.168.1.4Netmask: 255.255.255.0Default gateway: noneThis normaly should give you internet and connection with your laptop. If windows doesn't immediatly shows you the laptop, then try accessing manualy in Explorer (adress: \\192.168.1.4 )

Share this post


Link to post
Share on other sites

I just discovered the command "route print", so I am posting below the "before" and "after" snapshots:- Before enabling the embedded NIC (Internet up):

===========================================================================Interface List0x1 ........................... MS TCP Loopback interface0x10003 ...00 14 d1 c1 42 c5 ...... 802.11g Wireless Network Adapter - Packet Scheduler Miniport======================================================================================================================================================Active Routes:Network Destination        Netmask          Gateway       Interface  Metric          0.0.0.0          0.0.0.0      192.168.1.1     192.168.1.2       25        127.0.0.0        255.0.0.0        127.0.0.1       127.0.0.1       1      192.168.1.0    255.255.255.0      192.168.1.2     192.168.1.2       25      192.168.1.2  255.255.255.255        127.0.0.1       127.0.0.1       25    192.168.1.255  255.255.255.255      192.168.1.2     192.168.1.2       25        224.0.0.0        240.0.0.0      192.168.1.2     192.168.1.2       25  255.255.255.255  255.255.255.255      192.168.1.2     192.168.1.2       1Default Gateway:       192.168.1.1===========================================================================Persistent Routes:  None

- After enabling the embedded NIC (Internet down):

===========================================================================Interface List0x1 ........................... MS TCP Loopback interface0x10003 ...00 14 d1 c1 42 c5 ...... 802.11g Wireless Network Adapter - Packet Scheduler Miniport0x10004 ...00 30 05 45 15 5a ...... Intel® PRO/100 VE Network Connection - Packet Scheduler Miniport======================================================================================================================================================Active Routes:Network Destination        Netmask          Gateway       Interface  Metric          0.0.0.0          0.0.0.0      192.168.1.1     192.168.1.2       25          0.0.0.0          0.0.0.0      192.168.2.2     192.168.2.2       20        127.0.0.0        255.0.0.0        127.0.0.1       127.0.0.1       1      192.168.1.0    255.255.255.0      192.168.1.2     192.168.1.2       25      192.168.1.2  255.255.255.255        127.0.0.1       127.0.0.1       25    192.168.1.255  255.255.255.255      192.168.1.2     192.168.1.2       25      192.168.2.0    255.255.255.0      192.168.2.2     192.168.2.2       20      192.168.2.2  255.255.255.255        127.0.0.1       127.0.0.1       20    192.168.2.255  255.255.255.255      192.168.2.2     192.168.2.2       20        224.0.0.0        240.0.0.0      192.168.1.2     192.168.1.2       25        224.0.0.0        240.0.0.0      192.168.2.2     192.168.2.2       20  255.255.255.255  255.255.255.255      192.168.1.2     192.168.1.2       1  255.255.255.255  255.255.255.255      192.168.2.2     192.168.2.2       1Default Gateway:       192.168.2.2===========================================================================Persistent Routes:  None

Share this post


Link to post
Share on other sites

Super!It works.I tried the approach that wutske suggested, because it is more attuned to what I am trying to accomplish, but many thanks to both of you for putting in the effort to answer my question.

Share this post


Link to post
Share on other sites

Super!
It works.

I tried the approach that wutske suggested, because it is more attuned to what I am trying to accomplish, but many thanks to both of you for putting in the effort to answer my question.

Congrats. Wutske is right, the error you did was changing the default gateway when adding your second network.
Basically, when you have a computer correctly connected to the worldwide network, like your PC which had a correct default gateway and a DNS, the standard thing to do is to leave that working part continue working.
So, when you add a second network (that is what you do when you activate your second NIC adapter) you should not remove your default gateway, replacing the correctly working one by a non-working default gateway.
The default gateway is your wireless router, your wireless router must remain your default gateway.
So, when you manually add other NIC's to this computer, please feel free to give them private IP addresses, this is correct, simply write down nothing in the default gateway field, leave this field blank, and the new network will start working correctly without disturbing you old network which will continue working as usual.
By the way, don't be confused having this problem : this kind of problem is the problem I am currently experiencing at office : my collegues continuously change their default gateways, and then start complaining because their network does not work any more !
Edited by yordan (see edit history)

Share this post


Link to post
Share on other sites

Windows XP Pro PC:IP: 10.0.0.XGateway: 10.0.0.1On LOCAL network 10.0.0.1/255.255.255.0Windows 2003 Server:External IP: ww.Xx.Yy.ZzInternal IP: 192.168.1.25Gateway: 192.168.1.1 (the one corresponding to the external IP)On REMOTE network 192.168.1.1/255.255.255.0The router 192.168.1.1 is connecting via VPN to another router 192.168.2.1/255.255.255.0.The Windows 2003 Server (192.168.1.25) has a Host-to-host VPN connection to another remote external Windows 2003 Server: 192.168.200.1/255.255.255.255From the Windows 2003 Server I can successfully access the remote server 192.168.200.1 as well as the entire 192.168.2.0/24 network (router-to-router VPN) without problems.WHAT I AM TRYING TO ACHIEVE:I connect the local PC (10.0.0.X) via VPN to the Windows 2003 Server on the remote network. I can see 192.168.1.0/24 without problems.If I select the 'Use default gateway on remote network' on the local PC VPN connection (Networking->TCP/IP Protocol->Properties->Advanced), ALL TRAFIC GOES OUT from the remote Windows 2003 Server (192.168.1.25), regardless of the the IP (except, of course, traffic to 10.0.0.0/24). As such, I can ping/access remote external server 192.168.200.1 and the entire 192.168.2.0/24 network via 192.168.1.25's routing.However, if I uncheck the 'Use default gateway on remote network' on the local PC's VPN connection, I can only access 192.168.1.0/24 and I CANNOT ACCESS 192.168.200.1 or 192.168.2.0/24.I have been 'playing around' with the ROUTE ADD command, but to no avail.Any ideas/suggestions?Thanks in advance for your time!-Costa-reply by costa

Share this post


Link to post
Share on other sites

Can you help me with this?

How Do I Create Static Routes In Windows Xp?

 

I have this scenario:

 

- 1 public IP address

- 1 cable modem

- 1 router (4 ports)

- 4 computers with private addresses connected to the router

 

Everything works flawlessly.

I want to connect a laptop with a wireless network card to the internet. My router is not wireless, and all it's 4 ports are used.

To be able to connect the laptop, I bought a wireless network card and put it in one of the computers. I want to use this computer (Windows XP Professional) as a router/gateway for the wireless network. At the moment, the card is installed properly, as far as I can see in Windows. I created a new wireless network named xyz, which I can see from the laptop, but, but the laptop is unable to browse the internet.

The packet's path should be like this, I think: it should come from my isp, through the modem, router, pc's wired network card, pc's wireless network card, laptop.

 

Please tell me how should I set the IP addresses for the wireless network. The existing wired network works fine now.

 

-reply by theMagus

Share this post


Link to post
Share on other sites

Can you help me with this?

How Do I Create Static Routes In Windows Xp?

 

I have this scenario:

 

- 1 public IP address

- 1 cable modem

- 1 router (4 ports)

- 4 computers with private addresses connected to the router

 

Everything works flawlessly.

I want to connect a laptop with a wireless network card to the internet. My router is not wireless, and all it's 4 ports are used.

To be able to connect the laptop, I bought a wireless network card and put it in one of the computers. I want to use this computer (Windows XP Professional) as a router/gateway for the wireless network. At the moment, the card is installed properly, as far as I can see in Windows. I created a new wireless network named xyz, which I can see from the laptop, but, but the laptop is unable to browse the internet.

The packet's path should be like this, I think: it should come from my isp, through the modem, router, pc's wired network card, pc's wireless network card, laptop.

 

Please tell me how should I set the IP addresses for the wireless network. The existing wired network works fine now.

 

-reply by theMagus

Share this post


Link to post
Share on other sites

THIS IS ALL RIGHT I AGREE 100%Here's my setup:My PC connects to my Internet facing wireless router via a USB-pluggable wireless NIC, the IP address of which is 192.168.1.2 (netmask 255.255.255.0).The IP address of my router's LAN port is 192.168.1.1.The NIC which is embedded in the motherboard has remained disabled so far.Everything works OK, but I recently got a hold of a crossover cable, and I started using it to connect a laptop to my PC.So I enabled the embedded NIC on the PC and gave it an IP address of 192.168.2.2 (netmask 255.255.255.0, default gateway 192.168.2.2).The laptop's IP address is 192.168.2.1.My only objective is to able to exchange files between my PC and my laptop.I do not want to connect my laptop to the internet, either directly or indirectly.And here comes my problem:After setting up the (crossover cable) connection between the two, I tried going out to the internet again on my PC, and failed.I tried using tracert to troubleshoot what's going on, and my gut feeling is that as soon as I enabled the embedded NIC on the PC, it seems to think "Oh, this is my new Internet, let me send all the requests from the browser to this new default gateway 192.168.2.2".One solution that comes to my mind is to use static routes. I know what they are in theory, but I don't know how to issue the commands.If anyone has experience using static routes in Windows XP, I would appreciate a few pointers in the right direction.Also, if there is a better / more efficient / more elegant solution, I would very much like to hear it.--------------------There are only 10 types of people in the world: those who understand binary and those who don't. faulty.lee View Member Profile Add as Friend Send Message Find Member's Topics Find Member's Posts Jun 30 2007, 08:29 AM Post #2 Premium MemberGroup: [HOSTED]Posts: 437Joined: 5-November 06Member No.: 17,016 There's 3 things you can try, non of them belongs to static route.1. Set a permanent DNS in the DNS setting of wireless NIC and set the gateway of both NIC to your router's IP2. Bridge the connection of both your NIC. You can select the 2 NIC, then right click, Bridge Connection. That way, you only need to set 1 IP address for the bridged connection. So, both your NIC will have the same IP, and that should help fix the issue, also it will automatically routes internet on your laptop(if i'm not mistaken, as i have tried the same thing before, quite sometime back)3. Setup internet sharing, to share your internet to your laptop. That way, windows might figure out which NIC is actually connected to the internet.Let me know if any of that works. I seldom play with networking lately, will be good to refresh my theory a bit.Good Luck wutske View Member Profile Add as Friend Send Message Find Member's Topics Find Member's Posts Jun 30 2007, 08:32 AM Post #3 Super MemberGroup: [HOSTED]Posts: 969Joined: 2-August 05From: Kapellen (Antwerp, Belgium)Member No.: 7,585 Try these settings:Wireless Nic:IP: sameNetmask: sameDefault Gateway:192.168.1.1Wired Nic;IP: 192.168.1.3Netmask: 255.255.255.0Default gateway: noneLaptop Nic:IP: 192.168.1.4Netmask: 255.255.255.0Default gateway: noneThis normaly should give you internet and connection with your laptop. If windows doesn't immediatly shows you the laptop, then try accessing manualy in Explorer (adress: \\192.168.1.4 ) --------------------PCs: self-made Barton2500+ | Dell Inspiron 6400OS'es: WinXP SP1 + openSuse 10.3 + Windows Vista Home Premium + Dell Media Direct (=XP Media Center like)Chat: Mercury MessengerBrowser: Opera9Java: 1.6AV: AvastFW: Sygate PF + Comodo PFP dserban View Member Profile Add as Friend Send Message Find Member's Topics Find Member's Posts Jun 30 2007, 08:33 AM Post #4 Premium MemberGroup: [HOSTED]Posts: 286Joined: 17-June 07Member No.: 22,702 I just discovered the command "route print", so I am posting below the "before" and "after" snapshots:- Before enabling the embedded NIC (Internet up):CODE===========================================================================Interface List0x1 ........................... MS TCP Loopback interface0x10003 ...00 14 d1 c1 42 c5 ...... 802.11g Wireless Network Adapter - Packet Scheduler Miniport======================================================================================================================================================Active Routes:Network Destination Netmask Gateway Interface Metric 0.0.0.0 0.0.0.0 192.168.1.1 192.168.1.2 25 127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1 192.168.1.0 255.255.255.0 192.168.1.2 192.168.1.2 25 192.168.1.2 255.255.255.255 127.0.0.1 127.0.0.1 25 192.168.1.255 255.255.255.255 192.168.1.2 192.168.1.2 25 224.0.0.0 240.0.0.0 192.168.1.2 192.168.1.2 25 255.255.255.255 255.255.255.255 192.168.1.2 192.168.1.2 1Default Gateway: 192.168.1.1===========================================================================Persistent Routes: None- After enabling the embedded NIC (Internet down):CODE===========================================================================Interface List0x1 ........................... MS TCP Loopback interface0x10003 ...00 14 d1 c1 42 c5 ...... 802.11g Wireless Network Adapter - Packet Scheduler Miniport0x10004 ...00 30 05 45 15 5a ...... Intel® PRO/100 VE Network Connection - Packet Scheduler Miniport======================================================================================================================================================Active Routes:Network Destination Netmask Gateway Interface Metric 0.0.0.0 0.0.0.0 192.168.1.1 192.168.1.2 25 0.0.0.0 0.0.0.0 192.168.2.2 192.168.2.2 20 127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1 192.168.1.0 255.255.255.0 192.168.1.2 192.168.1.2 25 192.168.1.2 255.255.255.255 127.0.0.1 127.0.0.1 25 192.168.1.255 255.255.255.255 192.168.1.2 192.168.1.2 25 192.168.2.0 255.255.255.0 192.168.2.2 192.168.2.2 20 192.168.2.2 255.255.255.255 127.0.0.1 127.0.0.1 20 192.168.2.255 255.255.255.255 192.168.2.2 192.168.2.2 20 224.0.0.0 240.0.0.0 192.168.1.2 192.168.1.2 25 224.0.0.0 240.0.0.0 192.168.2.2 192.168.2.2 20 255.255.255.255 255.255.255.255 192.168.1.2 192.168.1.2 1 255.255.255.255 255.255.255.255 192.168.2.2 192.168.2.2 1Default Gateway: 192.168.2.2===========================================================================Persistent Routes: None--------------------There are only 10 types of people in the world: those who understand binary and those who don't. dserban View Member Profile Add as Friend Send Message Find Member's Topics Find Member's Posts Jun 30 2007, 12:14 PM Post #5 Premium MemberGroup: [HOSTED]Posts: 286Joined: 17-June 07Member No.: 22,702 Super!It works.I tried the approach that wutske suggested, because it is more attuned to what I am trying to accomplish, but many thanks to both of you for putting in the effort to answer my question. --------------------There are only 10 types of people in the world: those who understand binary and those who don't. yordan View Member Profile Add as Friend Send Message Find Member's Topics Find Member's Posts Jun 30 2007, 01:28 PM Post #6 Way Out Of Control - You need a life :)Group: [MODERATOR]Posts: 1,884Joined: 16-August 05Member No.: 7,896 QUOTE(dserban @ Jun 30 2007, 02:14 PM) Super!It works.I tried the approach that wutske suggested, because it is more attuned to what I am trying to accomplish, but many thanks to both of you for putting in the effort to answer my question.Congrats. Wutske is right, the error you did was changing the default gateway when adding your second network.Basically, when you have a computer correctly connected to the worldwide network, like your PC which had a correct default gateway and a DNS, the standard thing to do is to leave that working part continue working.So, when you add a second network (that is what you do when you activate your second NIC adapter) you should not remove your default gateway, replacing the correctly working one by a non-working default gateway.The default gateway is your wireless router, your wireless router must remain your default gateway.So, when you manually add other NIC's to this computer, please feel free to give them private IP addresses, this is correct, simply write down nothing in the default gateway field, leave this field blank, and the new network will start working correctly without disturbing you old network which will continue working as usual.By the way, don't be confused having this problem : this kind of problem is the problem I am currently experiencing at office : my collegues continuously change their default gateways, and then start complaining because their network does not work any more ! This post has been edited by yordan: Jun 30 2007, 01:29 PM -------------------- Feedbacker View Member Profile Add as Friend Send Message Find Member's Topics Find Member's Posts May 22 2008, 06:20 AM Post #7 Newbie [ Level 1 ]Group: MembersPosts: 0Joined: 1-November 07Member No.: 25,869 Windows XP Pro PC:IP: 10.0.0.XGateway: 10.0.0.1On LOCAL network 10.0.0.1/255.255.255.0Windows 2003 Server:External IP: ww.Xx.Yy.ZzInternal IP: 192.168.1.25Gateway: 192.168.1.1 (the one corresponding to the external IP)On REMOTE network 192.168.1.1/255.255.255.0The router 192.168.1.1 is connecting via VPN to another router 192.168.2.1/255.255.255.0.The Windows 2003 Server (192.168.1.25) has a Host-to-host VPN connection to another remote external Windows 2003 Server: 192.168.200.1/255.255.255.255From the Windows 2003 Server I can successfully access the remote server 192.168.200.1 as well as the entire 192.168.2.0/24 network (router-to-router VPN) without problems.WHAT I AM TRYING TO ACHIEVE:I connect the local PC (10.0.0.X) via VPN to the Windows 2003 Server on the remote network. I can see 192.168.1.0/24 without problems.If I select the 'Use default gateway on remote network' on the local PC VPN connection (Networking->TCP/IP Protocol->Properties->Advanced), ALL TRAFIC GOES OUT from the remote Windows 2003 Server (192.168.1.25), regardless of the the IP (except, of course, traffic to 10.0.0.0/24). As such, I can ping/access remote external server 192.168.200.1 and the entire 192.168.2.0/24 network via 192.168.1.25's routing.However, if I uncheck the 'Use default gateway on remote network' on the local PC's VPN connection, I can only access 192.168.1.0/24 and I CANNOT ACCESS 192.168.200.1 or 192.168.2.0/24.I have been 'playing around' with the ROUTE ADD command, but to no avail.Any ideas/suggestions?Thanks in advance for your time!-Costa-reply by costa Feedbacker View Member Profile Add as Friend Send Message Find Member's Topics Find Member's Posts Jun 4 2008, 11:34 AM Post #8 Newbie [ Level 1 ]Group: MembersPosts: 0Joined: 1-November 07Member No.: 25,869 Can you help me with this?How Do I Create Static Routes In Windows Xp?I have this scenario:- 1 public IP address- 1 cable modem- 1 router (4 ports)- 4 computers with private addresses connected to the routerEverything works flawlessly.I want to connect a laptop with a wireless network card to the internet. My router is not wireless, and all it's 4 ports are used.To be able to connect the laptop, I bought a wireless network card and put it in one of the computers. I want to use this computer (Windows XP Professional) as a router/gateway for the wireless network. At the moment, the card is installed properly, as far as I can see in Windows. I created a new wireless network named xyz, which I can see from the laptop, but, but the laptop is unable to browse the internet.The packet's path should be like this, I think: it should come from my isp, through the modem, router, pc's wired network card, pc's wireless network card, laptop.Please tell me how should I set the IP addresses for the wireless network. The existing wired network works fine now.-reply by theMagus Feedbacker View Member Profile Add as Friend Send Message Find Member's Topics Find Member's Posts Jun 4 2008, 11:34 AM Post #9 Newbie [ Level 1 ]Group: MembersPosts: 0Joined: 1-November 07Member No.: 25,869 Can you help me with this?How Do I Create Static Routes In Windows Xp?I have this scenario:- 1 public IP address- 1 cable modem- 1 router (4 ports)- 4 computers with private addresses connected to the routerEverything works flawlessly.I want to connect a laptop with a wireless network card to the internet. My router is not wireless, and all it's 4 ports are used.To be able to connect the laptop, I bought a wireless network card and put it in one of the computers. I want to use this computer (Windows XP Professional) as a router/gateway for the wireless network. At the moment, the card is installed properly, as far as I can see in Windows. I created a new wireless network named xyz, which I can see from the laptop, but, but the laptop is unable to browse the internet.The packet's path should be like this, I think: it should come from my isp, through the modem, router, pc's wired network card, pc's wireless network card, laptop.Please tell me how should I set the IP addresses for the wireless network. The existing wired network works fine now.-reply by theMagus

Share this post


Link to post
Share on other sites

To answer the original question about static addresses, in both Linux and Windows, the key files are "hosts" and "lmhosts". In Linux, they are usually in /etc/. In Windows 2000, they are in \WINNT\system32\drivers\etc\. In Windows, the lmhosts file defines the decimal addresses corresponding to given names, for example:

192.168.1.11   alpha  #PRE192.168.1.12   beta   #PRE192.168.1.13   gamma  #PRE
The "#PRE" tag instructs Windows to load this table before trying to resolve any addresses. If you use such static assignments, you need to have this lmhosts file in EACH of your computers, since your DHCP won't know these addresses. In Linux, there are additional options on these lines that vary with different Linux flavors.

The hosts file is where you can define external translations (outside your lan), and also where you can "blackhole" websites. For example if you wish to identify Fred's computer and also prevent your computer from visiting http://www.spammaker.com/, insert lines that read:
64.22.1.1 fred127.0.0.1 spammaker.com
That instructs your computer to look at 64.22.1.1 for http://forums.xisto.com/no_longer_exists/ and only inside itself for any web address that contains "spammaker.com".

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.