Manual:Simple Static Routing: Difference between revisions

From MikroTik Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
== Introduction ==
== Introduction ==


Let's look on the simplest network example, when we have one router for different computers.
Lets make a simple routing setup illustrated in image below


[[Image:SR1.png]]
[[Image:SR1.png]]


Computers are connected to router directly. Generally packets are sent by the simple path, for example client '''192.168.0.2''' wants to open one web page. Packets path is:
 
* 192.168.0.2 checks routing table, web page does not belong to any DST-address network, which is present in /ip route table;
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.
* 192.168.0.2 uses default gateway, it is 192.168.0.1 the address of the router. Default gateway network is 0.0.0.0/0 or everything except destinations for other present routes;
 
==Configuration==
Lets consider that ISP gave us an address 10.1.1.2/30 and gateway is 10.1.1.1
Router1:
<pre>
/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
</pre>
 
Router2:
<pre>
/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
</pre>
 
If you look at configuration then you will see that on Router1 we added route to destination 182.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.
 
 
{{cont}}
 


[[Category:Manual]]
[[Category:Manual]]
[[Category:Routing]]
[[Category:Routing]]
[[Category:Examples]]
[[Category:Examples]]

Revision as of 15:11, 5 August 2011

Introduction

Lets make a simple routing setup illustrated in image below


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 182.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 ]