Viewing Routes
You can see two dynamic (D) and connected (C) routes, which have been added automatically
when the addresses were added in the example above:
[admin@MikroTik] ip route> print
Flags:
A - active, X - disabled, I - invalid, D - dynamic, C - connect,
S - static, r - rip, b - bgp, o - ospf, d - dynamic
#
DST-ADDRESS
G GATEWAY
DISTANCE INTERFACE
0 ADC 192.168.0.0/24
r 0.0.0.0
0
Local
1 ADC 10.0.0.0/24
r 0.0.0.0
0
Public
[admin@MikroTik] ip route> print detail
Flags: A - active, X - disabled, I - invalid, D - dynamic, C - connect,
S - static, r - rip, b - bgp, o - ospf, d - dynamic
0 ADC dst-address=192.168.0.0/24 prefsrc=192.168.0.254 interface=Local scope=10
1 ADC dst-address=10.0.0.0/24 prefsrc=10.0.0.217 interface=Public scope=10
[admin@MikroTik] ip route>
These routes show, that IP packets with destination to 10.0.0.0/24 would be sent through the
interface Public, whereas IP packets with destination to 192.168.0.0/24 would be sent through the
interface Local. However, you need to specify where the router should forward packets, which have
destination other than networks connected directly to the router.
Adding Default Routes
In the following example the
default route
(destination 0.0.0.0 (any), netmask 0.0.0.0 (any)) will
be added. In this case it is the ISP's gateway 10.0.0.1, which can be reached through the interface
Public
[admin@MikroTik] ip route> add gateway=10.0.0.1
[admin@MikroTik] ip route> print
Flags: X - disabled, I - invalid, D - dynamic, J - rejected,
C - connect, S - static, R - rip, O - ospf, B - bgp
#
DST-ADDRESS
G GATEWAY
DISTANCE INTERFACE
0 ADC 192.168.0.0/24
Local
1 ADC 10.0.0.0/24
Public
2 A S 0.0.0.0/0
r 10.0.0.1
0
Public
[admin@MikroTik] ip route>
Here, the default route is listed under #2. As we see, the gateway 10.0.0.1 can be reached through
the interface 'Public'. If the gateway was specified incorrectly, the value for the argument 'interface'
would be unknown.
Notes
Page 37 of 695
Copyright 1999-2007, MikroTik. All rights reserved. Mikrotik, RouterOS and RouterBOARD are trademarks of Mikrotikls SIA.
Other trademarks and registred trademarks mentioned herein are properties of their respective owners.