[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 9628
  • Last Modified:

How to setup Static Routes between two subnets

Ok. Heres the deal.  I have a Dlink DI-624 and a Linksys RT31P2.  Default gateway of the Dlink is 192.168.0.1, and of Linksys is 192.168.15.1.  I have one PC on the the LAN side of the Linksys and one PC on the LAN of the D-link.  Both are running XP Pro.  I would like to use static routes to connect the two networks and enable me to file share between the PCs.  I know there are many other options with this configuration but I want to know how to do this with static routes.  Right now my setup looks like this (I would like it to stay this way).

Cable modem ---> D-Link ----> Linksys
                               |                  |
                              PC                PC
0
atistler
Asked:
atistler
  • 2
  • 2
  • 2
  • +4
1 Solution
 
sciwriterCommented:
Here is why you don't want static routes -- and why you might too --
http://www.netcordia.com/tools/tools/books/advip-first-edition/drafts1/ch3.html
Is there any reason why the two routers need to be on different class C's?
If that doesn't agree with what you are trying to do, which I don't see, then see this?
http://www.cisco.com/univercd/cc/td/doc/product/software/ios123/123cgcr/ipv6_c/sa_stat6.htm
0
 
Gen2003Commented:
Is Linksys's PCs able to use cable modem connected to D-Link? If so what are the settings on Modem (IP addressing and protocols), D-Link and Linksys? Where are that mentioned DGways ?

Regards.
0
 
snerkelCommented:
I assume the routers are doing NAT from your IP addresses, therefore the only way to do this that is secure is to connect the two machines by VPN.
0
Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

 
pseudocyberCommented:
Cable modem ---> D-Link ----> Linksys
                               |                  |
                              PC                PC

I have a Dlink DI-624 and a Linksys RT31P2.  Default gateway of the Dlink is 192.168.0.1, and of Linksys is 192.168.15.1.

Plug the Linksys into a LAN port of the DLink with a cross over cable, or use the MDI\MDIX function if it has it.

The WAN port of the Linksys should be a non-dhcp address from the DLink.  Let's call it 192.168.0.5.  The INTERNAL IP of the Linksys will remain the same, 192.168.15.1.

In the Linksys:  Everything is normal, all traffic will flow to the WAN port, or to the 192.168.0.0 network.

In the Dlink, you'll need a static route pointing to the Linksys.  I don't know your router exactly, but it would look like this:
Destination Net: 192.168.15.0  Mask:  255.255.255.0  Next hop:  192.168.0.5

By using this static route, all traffic bound for the 192.168.15.0 network will be redirected back inside to the .5 address instead of to the default route - to the Internet where it would be dropped.

Note, you'll have a hard time doing anything funky on the Linksys network as far as port forwarding goes - it will be tricky at best - you'd have to forward special ports on the DLink to the Linksys and then again on the Linksys to the end host.

Hope this helps.
0
 
LloydSevCommented:
on the workstation, if you are using Win2K or WinXP use the following command

route -p add <host ip address> mask <netmask> <default gateway>

Do that on both PC's..  use 255.255.255.255 as the netmask if specifying only a specific host.
0
 
rafael_accCommented:
atistler, I'm giving you the answer using cisco IOS commands. Then you convert it to what you need. I don't know if these are managable routers however. If they are the commands are (something alike):

                      192.168.0.1   192.168.15.1
Cable modem ---> D-Link ----> Linksys
                               |                  |
                              PC                PC
                          (x.x.x.0)        (y.y.y.0)


On the d-Link router:
  ip route y.y.y.0 255.255.255.0 192.168.15.1

On the Linksys router:
  ip route x.x.x.0 255.255.255.0 192.168.0.1


Of course I'm assuming you are using 255.255.255.0 as net mask on all the nets

Cheers
0
 
atistlerAuthor Commented:
Ok, I have been a little busy so I haven't actually tried out any of these solutions, but I seem to see two directions to go in.  The first is to set a static route on just the D-link to point any traffic going to the 192.168.15.x subnet through whatever address is being assigned to the Linksys by the D-link (192.168.0.5 in pseudocyber's example).  Rafael_acc seems to think that I need to set a static route on the Linksys also, to point to the 192.168.0.x subnet.  I don't really see why this is necessary because shouldn't the D-link realize that any packets with a 192.168.0.x destination address should be directed to its LAN.  Again, I am a networking newbie.  Sorry if anything I am saying sounds dumb.  Also, why would I have to add a static route onto my WinXP machines?  I would assume that once the static routes are set on the router(s), I would be able to map a drive just like if the PC's were on a LAN.  Thanks for the help in advance.
0
 
snerkelCommented:
Can I ask why you are using this arrangement to do what you want to do ?
0
 
rafael_accCommented:
"I don't really see why this is necessary because shouldn't the D-link realize that any packets with a 192.168.0.x destination address should be directed to its LAN."

Yes! It realizes that indeed. But in my post you are telling dLink router about Lynksys network(s) and vice-versa.
Again (in more detail):

On the d-Link router:
  ip route y.y.y.0 255.255.255.0 192.168.15.1
 
  This allows dlink router to know that packets to destination y.y.y.0 (netmask 255.255.255.0) must be sent to the 192.168.15.1
  (which in fact is the Linksys router).

On the Linksys router:
  ip route x.x.x.0 255.255.255.0 192.168.0.1

  This allows Linksys router to know that packets to destination x.x.x.0 (netmask 255.255.255.0) must be sent to the
  192.168.0.1 (which in fact is the D-Link router).


Did you get the idea now?


Cheers

0
 
pseudocyberCommented:
>>Rafael_acc seems to think that I need to set a static route on the Linksys also, to point to the 192.168.0.x subnet.  I don't really see why this is necessary because shouldn't the D-link realize that any packets with a 192.168.0.x destination address should be directed to its LAN.  

You don't need any special routing on the Linksys.  In this case, it will send all unknown traffic to its default gateway - which in this case is the 192.168.0.0 network.

Rafael's route is in correct.  In order for the Dlink router to reach the 192.168.15.0 network, it must send it to a next hop it knows how to reach - the IP on its own internal network - my example was 192.168.0.5.

>>Also, why would I have to add a static route onto my WinXP machines?  I would assume that once the static routes are set on the router(s), I would be able to map a drive just like if the PC's were on a LAN.

You do not need static routes on your WinXP machines.  You would only need them if you didn't put any routing on your DLink router.  The XP machines will compare destionation IP with their network and subnet mask and determine whether or not to send any off net traffic to the default gateway.  The gateway will get it and see where to send the layer 3 traffic in its routing table.

I've implemented this design before and it works fine - except for port forwarding on the second NAT which is problematic depending on what you want to do.
0

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

  • 2
  • 2
  • 2
  • +4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now