Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

!!!!! TODO: uzzimet hopus

Image RemovedIn this setup, we have three local networks: two client networks and one network to connect routers (typically called backbone). Also, we have another network which connects our gateway router (Router1) to the internet. 

Image Added

 Router 2 R2:

Code Block
languageros
/ip address
add address=172.16.1.2/30 interface=ether1
add address=192.168.2.1/24 interface=ether2bridge2


R1 Router1 (gateway) where ether1 connects to the internet:

Code Block
languageros
/ip address
add address=10.1.1.2 interface=ether1
add address=172.16.1.1/30 interface=ether2
add address=192.168.1.1/24 interface=ether3bridge1

If we look, for example, the Router1 routing table, we can see that the router knows only about directly connected networks. At this point when Client from LAN1 will try to reach client from LAN2 (192.168.2.0/24), a packet will be dropped on the router because such a destination is unknown for a particular router.:

Code Block
languagetext
[admin@TempTestadmin@MikroTik] > /ip/route> print 
Flags: D - dynamic; X - disabled, I - inactive, A - active; C - connect, S - static, r - ri
p, b - bgp, o - ospf, d - dhcp, v - vpn
Columns: DST-ADDRESS, GATEWAY, Distance
    DST-ADDRESS    GATEWAY D
DAC 10.1.1.0/24    ether1  0
DAC 172.16.1.0/30  ether2  0
DAC 192.168.1.0/24 ether3  0

To fix  fix this we need to add the route which tells the router what is the next device in the network to reach the destination.  In our example next hop is Router2, so we need to add the route which gateway will point to the Router's 2 connected address:

Code Block
languageros
[admin@MikroTik] > /ip route add dst-address=192.168.2.0/24 gateway=172.16.1.2
Code Block
languagetext
[admin@TempTest]
[admin@MikroTik] > /ip/route> print 
Flags: D - dynamic; X - disabled, I - inactive, A - active; C - connect, S - static, r - ri
p, b - bgp, o - ospf, d - dhcp, v - vpn
Columns: DST-ADDRESS, GATEWAY,       Distance
        DST-ADDRESS    GATEWAY       D
    DAC 10.1.1.0/24    ether1        0
    DAC 172.16.1.0/30  ether2        0
    DAC 192.168.1.0/24 ether3        0
0   AS  192.168.2.0/24 172.16.1.2    1

At this point packet from LAN1 will be successfully forwarded to LAN2, but we are not over yet. Router2 does not know how to reach LAN1, so any packet from LAN2 will be dropped on Router2.

If we look again at the network diagram, we can clearly see that Router2 has only one point of exit. It is safe to assume that all other unknown networks should be reached over the link to Router1. The easiest way to do this is by adding a default route:

Code Block
languageros
/ip route add gateway=172.16.1.1

...