Community discussions

MikroTik App
 
SatwinderSingh
just joined
Topic Author
Posts: 2
Joined: Thu Jan 26, 2023 9:15 pm

Connecting Two Routers with different LAN IPs

Thu Jan 26, 2023 9:22 pm

I have 2 routers as follows:
Router 1: Public IP 102.x.x.201 LAN IP 192.168.100.1
Router 2: Public IP 102.x.x.202 LAN IP 192.168.101.1

I have created a EOIP tunnel, and it seems to be up. I have created a bridge on each router whereas the LAN IP is on the bridge interface and ether 2 and EOIP are part of that bridge for their respective routers.

I want the computers on LAN1 to be able to communicate with computers on LAN2. How do I go about it.
 
pe1chl
Forum Guru
Forum Guru
Posts: 10195
Joined: Mon Jun 08, 2015 12:09 pm

Re: Connecting Two Routers with different LAN IPs

Thu Jan 26, 2023 11:52 pm

When your LAN IPs are different, you do not use EoIP but rather a tunnel at IP level, and setup the routes correctly so that traffic is routed to the other side, rather than bridged.
 
SatwinderSingh
just joined
Topic Author
Posts: 2
Joined: Thu Jan 26, 2023 9:15 pm

Re: Connecting Two Routers with different LAN IPs

Fri Jan 27, 2023 10:13 am

Thanks for the infor, do you mind telling me what the route would look like. Src nat or dst nat? Maybe an example
 
ChristianMorris
just joined
Posts: 10
Joined: Sun Dec 04, 2022 5:08 pm

Re: Connecting Two Routers with different LAN IPs

Fri Jan 27, 2023 10:18 am

Hi,

In order to allow the computers on LAN1 (192.168.100.0/24) to communicate with the computers on LAN2 (192.168.101.0/24) through the EOIP tunnel, you will need to configure routing on each router.

On Router 1, you will need to add a static route for the LAN2 subnet (192.168.101.0/24) with the next hop being the IP address of Router 2's EOIP interface (192.168.100.1).

On Router 2, you will need to add a static route for the LAN1 subnet (192.168.100.0/24) with the next hop being the IP address of Router 1's EOIP interface (192.168.101.1).

You also need to make sure that the firewall on each router is configured to allow traffic between the LANs.

You should also check if the routing table of each router is correct and that the EoIP tunnel is passing traffic.

You can use traceroute command to check the communication between the two LANs.
 
ChristianMorris
just joined
Posts: 10
Joined: Sun Dec 04, 2022 5:08 pm

Re: Connecting Two Routers with different LAN IPs

Fri Jan 27, 2023 10:20 am

The static routes on Router 1 and Router 2 would look like this:

Router 1:

/ip route add dst-address=192.168.101.0/24 gateway=192.168.100.1

Router 2:

/ip route add dst-address=192.168.100.0/24 gateway=192.168.101.1

In the above example, the static routes are added using the "ip route add" command and the destination network is specified using the "dst-address" parameter. The gateway parameter is used to specify the next hop IP address, which in this case is the IP address of the EOIP interface on the other router.

In terms of source or destination NAT, you do not need to use NAT in this case, as long as the routing is configured correctly. The EoIP Tunnel creates a virtual interface on both routers and it can be used as a gateway.

It's always a good idea to test the communication between the two LANs after configuring the routing, using the ping command or a similar tool, to ensure that the traffic is flowing as expected.
 
pe1chl
Forum Guru
Forum Guru
Posts: 10195
Joined: Mon Jun 08, 2015 12:09 pm

Re: Connecting Two Routers with different LAN IPs

Fri Jan 27, 2023 11:01 am

When you do that, it is much better to use a GRE or IPIP tunnel instead of a EoIP tunnel!
That will pass routed traffic as well, but not all the broadcasts on each network. Which will not be acted up correctly anyway because they are from a different network.

Who is online

Users browsing this forum: No registered users and 31 guests