Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have 2 routers in my place.

Main Router (Connected to the Internet) - 192.168.1.1

Secondery Router (Connected to the Main Router) - 192.168.0.1

I have a Network Storage Device and few Shared Directorys connected to the Main Router.

(Network Storage - 192.168.1.16)

How can i acces one of them using a PC connected to the Secondery Router?

Home Network Diagram:

Home Network

I currently have access to the internet using both laptop and Main PC. But i want to get access from my laptop to the Storage and to ym shared directorys.

The problem is the my Main router always forwards all packets stright to the WAN.. (Internet)

share|improve this question
    
Do you kbow, that DuobleNATing is very bad idea? –  Lazy Badger Mar 24 '12 at 5:29

3 Answers 3

up vote 7 down vote accepted

How can i acces one of them using a PC connected to the Secondery Router?

Make sure both the routers are properly configured. Each should have a routing table entry for both LANs (192.168.1.x and 192.168.0.x). Such routes can be statically configured or dynamic (using a routing protocol such as RIP).

Properly configured routers will let PCs know what to do when PCs contact the wrong router (typically by issuing ICMP redirects).


Here's a scenario using one router to support two LANs and Internet access

  (Internet)
       |       
   +---o-----+     +------+     +------+
   |DSL Modem|     |switch|     |switch|
   +---O-----+     +-OOOO-+     +-OOOO-+
       |             |  |         |  |
   +---O--+          | +O-+       | +O-+
   |Router|          | |PC|       | |PC|
   +-O-O--+          | +--+       | +--+
     | |             |            |
     | `-------------'            |
     `----------------------------'

                 |<--------->|   |<--------->|
                  192.168.1.x     192.168.0.x

The router connects both LANs to the INternet and allows all PCs on both LANs to contact each other. The router provides DHCP service to both LANs, That DHCP service tells PCs in each LAN the "gateway address" is the IP-address of the router's interface on that PC's LAN.


Here's a scenario using a second router to link the two LANs

  (Internet)
       |       
   +---o-----+     +------+     +------+
   |DSL Modem|     |switch|     |switch|
   +---O-----+     +-OOOO-+     +-OOOO-+
       |             || |         |  |
   +---O--+          || `-.       | +O-+
   |Router|          ||   |       | |PC|
   +---O--+          ||  +O-+     | +--+
       |             ||  |PC|     |      
       `-------------'|  +--+     |     
                      |           |          
                      `----. .----'   
                           | |
                        +--O-O--+
                        |Router2|
                        +-------+

                |<--------->|<--------->|
                 192.168.1.x 192.168.0.x

This is more complicated. Router2 will have a default gateway pointing to the Internet router but will have interfaces in both LANs. If the Internet Router provides DHCP service for the 192.168.1.x LAN, we must make sure that Router2 is configured so it does not also try to provide DHCP service for that LAN. Router 2 should provide DHCP service for 192.168.0.x. Administratively it might be better to make Router 2 provide DHCP service for both LANS and disable DHCP service on the Internet Router - but this may be a less resilient configuration.

If a PC in 192.168.1.x tries to use Router2 to contact the Internet, Router2 will redirect the PC by sending back an ICMP redirect. If a PC in 192.168.1.x tries to use the Internet router to contact the PC in 192.168.0.x, the Internet router will issue a redirect but to do this it has to first be configured to know that router2 is the nearest route to that LAN. I'd typically do this by static config but you could let the routers communicate using RIP or another routing protocol and work it out for themselves.


Update:

You have routers with built-in ethernet switches (pretty common nowadays for small-office/home routers). So you can probably use the "secondary router" as a dumb switch and save yourself a lot of problems.

 (Internet)
     |
  +--o--+  +--------+     +--------+
  |DSL  |  | Router |     | Router |
  |modem|  | .------|     | .------|
  +--O--+  | |switch|     | |Switch|
     |     +O--OOOO-+     +O--OOOO-+
     |      |  | ||        |  | ||
     `------'  | ||        x  | ||
               | ||           | |`-----.
             ,-' |`-----------' |      |
             |   `--.           |      |
            +O-+    |          +O-+   +O-+
            |PC|  +-O-+        |PC|   |PC|
            +--+  |NAS|        +--+   +--+
                  +---+

      |<---------------------------------->|
                 all 192.168.1.x

I added another PC on the right hand side, as there's no need for a second switch to serve a single PC. In fact with only four PCs/NAS, you probably have enough LAN ports on the main router alone. But perhaps the right-hand-side PCs are in another room and you only have provision for one cable between rooms.

share|improve this answer
    
What should i configure in my router, i'm currently on a PC connected to the main router, when im trying to access 192.168.0.1 (Secondery) i get no response. (Request timed out) –  Danpe Mar 23 '12 at 10:05
1  
@RedGrittyBrick Kind of Interest, did you use a program for your nice network layout, or was it created manual? I assume you draw it by yourself. If it so, well done :) –  JohannesM Mar 23 '12 at 10:14
    
@Danpe, it depends on how your LANs and router's are connected - draw us a network diagram and update your question. Specific instructions depend on make and model of routers. –  RedGrittyBrick Mar 23 '12 at 10:35
2  
@JohannesM: The program I used was Notepad :-) It's kind of a little challenge I set myself. –  RedGrittyBrick Mar 23 '12 at 10:35
2  
@Danpe: You can check roting tables in your router's configuration/administration interface (usually a web-page for home routers). My best guess at the cause of the current problem is that the main router doesn't have a route entry for the LAN segment hidden behind your secondary router. HOWEVER - I suspect you would be better off reconfiguring the secondary router as a plain old dumb Ethernet switch. This might mean moving a cable from a port labelled "WAN" to a port labelled "LAN" and disabling all it's DHCP and other services. Two routers and two LANs seems overkill for the average home. –  RedGrittyBrick Mar 23 '12 at 11:24

You may be better off using a single network instead and configuring the second router as a regular switch. If you need seperate LANs however, there is an alternate setup that provides basic functionality but requires less configuration and is available on routers where routing tables are not or hardly manageable.

Connect the second router's WAN interface to the main router's LAN and enable DHCP on both. Make sure both are using the correct LAN IP-addresses and subnets, 192.168.1.1 and 192.168.1.0/24 for the first, 192.168.0.1 and 192.168.0.0/24 for the second. Hosts on seperate networks will probably not be able to see each other, but hosts on the second network can connect to machines on the first.

For instance, the laptop can connect to the network share using \\192.168.1.16\share. It will not know how to reach this host directly, thus passing on the request to the standard gateway, the second router. The second router will pass it on to its standard gateway, being the main router, which will in turn connect to the known host 192.168.1.16.

The same connection cannot be initiated from the main network, as those machines have no way of reaching the 192.168.0.0/24 subnet without forwarding ports on the second router.

share|improve this answer
    
"enable DHCP on both" you forgot about (possible) collateral damage - slave router may act as DCHP-relay and transfer DHCP requests on master. I'll not predict exact results (environment- and HW-dependent) –  Lazy Badger Mar 24 '12 at 5:35
    
A DHCP relay would be trouble, but that's exactly why the second network needs a DHCP server of its own, unless you're going for static IP settings. The main router will not properly traverse the second in handing out IPs. –  Marcks Thomas Mar 24 '12 at 10:25

Simplest way is to use only 1 LAN: disable DHCP on 2nd router and plug the cable that come from main router into a LAN port instead of WAN port. All your IPs will be in same subnet and you'll be able to reach everything from everywhere.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.