Route between two machines on the same network (but different IP ranges)

1

1

This is the network topology I'm working with:

  .______.
  |      |
  |Modem | 10.0.0.1
  |______|
    |  |                .______.
    |  `----------------|      |
    |                   |Box A | 10.0.0.200
    |        .______.   |______|
    `--------|      |   
             |Router| 10.0.0.100
             |______| 192.168.0.1
                 |
             .___|__.
             |      |
             |Box B | 192.168.0.12
             |______|

route on Box A returns:

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         10.0.0.1        0.0.0.0         UG    0      0        0 eth0
10.0.0.0        *               255.255.255.0   U     0      0        0 eth0

route on Box B returns:

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     *               255.255.255.0   U     0      0        0 eth0
default         192.168.0.1     0.0.0.0         UG    0      0        0 eth0

Question is: How can I access Box B from Box A?

Hamza

Posted 2013-09-08T16:53:27.393

Reputation: 151

Answers

2

You will need to tell the modem that requests for 192.168.0.0/24 should not be dropped, but should be dispatched to the second router.

How you do that is rather hard to tell without knowing what kind of device it actually is, but it might involve something like route add -net 192.168.0.0 netmask via_interface#. (Or it could be web based).

To learn what that does, see this post on our sistersite.

Hennes

Posted 2013-09-08T16:53:27.393

Reputation: 60 739

Thanks for the link, I am going through it now. Modem and router are simple commodity network appliances, I can only configure them via web based UIs. It appears that I can add a 'static route' on my modem but it doesn't seem to work, I get this on box A: ping 192.168.0.12 PING 192.168.0.12 (192.168.0.12) 56(84) bytes of data. From 10.0.0.1: icmp_seq=2 Redirect Host(New nexthop: 10.0.0.100) – Hamza – 2013-09-08T17:17:20.547

I suspect the modem is just behaving as a switch and you don't need to do anything special to to it, however the router either needs a special route set up if possible or if you are only attempting to access one computer behind it some kind of port forwarding, then Box A would just connect to 10.0.0.100 whenever it wanted to talk to Box B. – Scott Chamberlain – 2013-09-08T17:48:47.547