2

Given the following network setup,

Router1 (192.168.1.1) ─┬─ (192.168.1.2) Ubuntu Samba+SSH Server
                       ├─ (192.168.1.3) Router2 (192.168.2.1)  ─┬─ (192.168.2.X) GuestPC1
                       ├─ (192.168.1.X) AdminPC1                ├─ (192.168.2.X) GuestPC2
                       ├─ (192.168.1.X) AdminPC2                ├─ (192.168.2.X) GuestPC3
                       :                                        :
                       :                                        :
                       └─ etc.                                  └─ etc.

I'd like to login to Router 2's web administration page from AdminPC1 via http://192.168.2.1 as I would normally from GuestPC1.

On Router1, I tried adding a static route, setting 192.168.1.3 (Router2) as the gateway to network 192.168.2.0. However, I still couldn't access Router2's admin page from any of the clients on the Router1 network (192.168.1.X). Also, for some reason, I am unable to ping any of the GuestPC's from AdminPC1. I am able to ping Router2 from AdminPC1 (by invoking ping 192.168.1.3 on AdminPC1).

Am I doing something wrong? How should Routers 1 and 2 be configured instead?

3

The question is one of "how is Router 2 set up", and until this has been clarified one can only guess at the answer. You have not advised the router you are using, nor have you advised if AdminPC1 is able to ping GuestPC1 - and these are pretty important things to know.

The problem you are most likely bumping in to is that you are trying to access the router from its external interface, and you may find that the ability to do so has been disabled as a security measure on the router. You may be able to program this access on that router.

Another issue might be that you are trying to access it on 192.168.2.1, but that network may not be reachable from the Admin PC. The simple solution is to try and reach the router on the external interface (which, from your diagram looks to be 192.168.1.3).

The more complex solution would be to "Fix your routing" - however doing this is non-trivial [assuming a level of knowledge reflected in the question you asked], and involves adding multiple routes to the servers. I can't meaningfully comment on this unless you provide subnet masks and route tables for each router, and also confirm that Router2 is not doing NAT (which it probably is straight out of the box, and will make what you are trying to do - ie connecting to 192.168.2.1 - impossible)

Updated Answer After further Information

In order for things in the 192.168.1.x network to see the 192.168.2.x network you don't need to turn Router2 into a switch, but you do need to do the following -

  1. Turn off NAT. NAT is rewriting the addresses from 192.168.2.x to 192.168.1.3 so obviously there is no way for the confirmation packets to get back from 192.168.2.x to 192.168.1.x

  2. (This is a bit of a guess at your setup). Program the external Interface of Router 2 with a static IP address (ie don't use DHCP). You want to ensure this IP address is in the 192.168.1.x range, but outside the block set aside for NAT. 192.168.1.254 will probably work, but to be sure you should check the pool of IP addresses set aside for DHCP in Router 1. You need to configure a default gateway of 192.168.1.1 on Router 2

  3. On Router 1 you need to configure a static route from 192.168.2.0, netmask 255.255.255.0 gateway 192.168.1.254 (assuming 192.168.1.254 is the external interface for Router 2)

This should work, but if you use the Ubuntu Samba+SSH server a lot, your performance might benefit from adding a static route so it can see Router 2 directly, rather then routing traffic to Router 1 and then back to Router 2. You can do this with the command

route add -net 192.168.2.0 netmask 255.255.255.0 gateway 192.168.1.254

(Assuming 192.168.1.254 is configured as the external interface on Router 1), Only do this after you have everything else working though. Also, you can add the command to /etc/rc.local (before the "exit 0" line) to make it automatically work on startup.

There are a number of tools you can use (with Windows and Linux Equivalents) to help work out where things are not working, and how traffic is flowing. The basic tools to use for Windows are tracert, ping, winMTR, with equivalents traceroute, ping and mtr under Linux). If you want to get technical you also have "arp" which shows the mappings of IP addresses to mac addresses (ethernet interfaces).

  • Thanks for the answer. Router2 uses mostly out-of-the-box configuration (NAT turned on to translate between 192.168.1.X and 192.168.2.X and the ethernet cable runs from Router1's LAN port to Router2's WAN port). Custom settings are: 1) static IP (subnet mask is 255.255.255.0); and 2) disable firewall, disable "block WAN requests". As for custom route tables, I didn't create any, save for the one already described to route from 192.168.1.X to 192.168.2.X. Do I really have to turn off NAT on Router2 and use it as a switch? As I prefer to keep the Router2 network (192.168.2.X) separate. – silvernightstar Sep 11 '13 at 6:19
  • Also, for some reason, I am unable to ping GuestPC1 (192.168.2.1) from AdminPC1 (192.168.1.4).. despite creating the static route config on Router1. – silvernightstar Sep 11 '13 at 6:29
  • Please see my edited response, which should answer what you need to do to make this work based on the information you provided. – davidgo Sep 11 '13 at 18:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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