Setup guide
route with multiple gateways (in the form gateway=x.x.x.x,y.y.y.y) The routing protocols may
create routes with equal cost automatically, if the cost of the interfaces is adjusted properly. For
more information on using the routing protocols, please read the corresponding section of the
Manual.
Note! In routing process, the router decides which route it will use to send out the packet.
Afterwards, when the packet is masqueraded, its source address is taken from the preferred-source
field.
Additional Documents
• RFC 2328
• RFC 2992
• RFC 1102
Static Routes
ip route
Property Description
dst-address (IP address/mask; default: 0.0.0.0/0) - destination address and network mask, where
netmask is number of bits which indicate network number
netmask (IP address) - network mask
gateway (IP address) - gateway host, that can be reached directly through some of the interfaces.
You can specify multiple gateways separated by comma "," for ECMP routes. See more information
on that below
preferred-source (IP address; default: 0.0.0.0) - source address of packets, leaving the router via
this route. Must be a valid address of the router, which is assigned to the router's interface, through
which the packet leaves
• 0.0.0.0 - determined at the time of sending the packet out through the interface
distance (integer; default: 1) - administrative distance of the route. When forwarding a packet, the
router will use the route with the lowest administrative distance and reachable gateway
gateway-state (read-only: r | u) - shows the status of the next hop. Can be r (reachable) or u
(unreachable)
• (unknown) - the gateway cannot be reached directly, or the route has been disabled
Notes
You can specify more than one or two gateways in the route. Moreover, you can repeat some routes
in the list several times to do a kind of cost setting for gateways.
Example
To add two static routes to networks 192.168.0.0/16 and 0.0.0.0/0 (the default destination address)
on a router with two interfaces and two IP addresses:
[admin@Wandy] ip route> add dst-address=192.168.0.0/16 gateway=10.10.10.2
[admin@Wandy] ip route> add gateway 10.10.10.1
[admin@Wandy] ip route> print
Flags: X - disabled, I - invalid, D - dynamic, J - rejected,