How to connect two different networks in linux

1

I have two systems these are the ip address details

Both are static ip.

system1 ip : 192.168.122.5 netmask 255.255.255.0

system2 ip : 192.168.121.5 netmask 255.255.255.0

Now I want to communicate between these two systems, if I change the ip to same network then I can communicate, but due to some reason I don't want to change IP, without changing IP how can I communicate ?

rahul

Posted 2014-02-08T08:41:25.000

Reputation: 11

Answers

0

Your netmask of 255.255.255.0 will only allow communication between IPs with the same last octet. 192.168.121.x OR 192.168.122.x

You have a few options:

  • change the subnet mask on both/all systems to 255.255.0.0

  • put a router between the two subnets that will route traffic between them.
    Basically the WAN side will connect to one network, where your internet router is let's pick ...121.x
    DHCP should take care of the rest, but you could manually assign the router a WAN IP in this range, let's say 192.168.121.2
    Configure the gateway to be your internet router, e.g. 192.168.121.1
    connect the other subnet ...122.x to the LAN side

  • assign a second IP to one of the systems that will be in the same subnet as the other.

Loopo

Posted 2014-02-08T08:41:25.000

Reputation: 426

To configure router what should I do ? – rahul – 2014-02-08T10:06:52.600

see my edit for more details – Loopo – 2014-02-08T10:27:36.837