...
To fix this we need to add a route that 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 a route with the gateway that points to the Routers 2 connected address. This type of route is known as a static route:
Code Block |
---|
language | text |
---|
theme | FadeToGrey |
---|
|
[admin@MikroTik] > /ip route add dst-address=192.168.2.0/24 gateway=172.16.1.2
[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 bridge1 0
0 AS 192.168.2.0/24 172.16.1.2 |
...
Code Block |
---|
language | text |
---|
theme | FadeToGrey |
---|
|
[admin@TempTest] /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
DAd 0.0.0.0/0 10.155.125.1 1
DAC 10.155.125.0/24 ether12 0
DAC 192.168.1.0/24 vlan2 0 |
Hardware Offloaded Route
Devices withLayer 3 Hardware Offloading (L3HW, otherwise known as IP switching or HW routing) allows to offload packet routing onto the switch chip. When L3HW is enabled, such routes will display H-flag:
Code Block |
---|
language | text |
---|
theme | FadeToGrey |
---|
|
[admin@MikroTik] > /ip/route print where static
Flags: A - ACTIVE; s - STATIC, y - COPY; H - HW-OFFLOADED
Columns: DST-ADDRESS, GATEWAY, DISTANCE
# DST-ADDRESS GATEWAY D
0 AsH 0.0.0.0/0 172.16.2.1 1
1 AsH 10.0.0.0/8 10.155.121.254 1
2 AsH 192.168.3.0/24 172.16.2.1 1 |
By default, all the routes are participating to be hardware candidate routes. To further fine-tune which traffic to offload, there is an option for each IP or IPv6 static route to disable/enable suppress-hw-offload
.
For example, if we know that majority of traffic flows to the network where servers are located, we can enable offloading only to that specific destination:
Code Block |
---|
|
/ip route set [find where static && dst-address!="192.168.3.0/24"] suppress-hw-offload=yes |
Now only the route to 192.168.3.0/24 has H-flag, indicating that it will be the only one eligible to be selected for HW offloading:
Code Block |
---|
language | text |
---|
theme | FadeToGrey |
---|
|
[admin@MikroTik] > /ip/route print where static
Flags: A - ACTIVE; s - STATIC, y - COPY; H - HW-OFFLOADED
Columns: DST-ADDRESS, GATEWAY, DISTANCE
# DST-ADDRESS GATEWAY D
0 As 0.0.0.0/0 172.16.2.1 1
1 As 10.0.0.0/8 10.155.121.254 1
2 AsH 192.168.3.0/24 172.16.2.1 1 |
Warning |
---|
H-flag does not indicate that route is actually HW offloaded, it indicates only that route can be selected to be HW offloaded. |
Multipath (ECMP) routes
To implement some setups, such as load balancing, it might be necessary to use more than one path to a given destination.
...