Manual:Simple Static Routing

From MikroTik Wiki
Jump to navigation Jump to search

Introduction

Lets make a simple routing setup illustrated in image below

SR1.png


Ether1 of Router1 is connected to ISP and will be the gateway of our networks. Router2 is connected to ether2 of Router1 and will act as a gateway for clients connected to it from LAN2. Router1 also connects one client to ether3. Our goal is to create setup so that clients from LAN1 can reach clients from LAN2 and all of them can connect to internet.

Configuration

Lets consider that ISP gave us an address 10.1.1.2/30 and gateway is 10.1.1.1

Router1:

/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=ether3

/ip route 
add gateway=10.1.1.1
add dst-address=192.168.2.0/24 gateway=172.16.1.2

Router2:

/ip address
add address=172.16.1.2/30 interface=ether1
add address=192.168.2.1/24 interface=ether2

/ip route 
add gateway=172.16.1.1

If you look at configuration then you will see that on Router1 we added route to destination 192.168.2.0/24. It is required for clients from LAN1 to be able to reach clients on LAN2. On Router2 such route is not required since LAN1 can be reached by default route.


[ Top | Back to Content ]