[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.3 Static Route Commands

Static routing is a very fundamental feature of routing technology. It defines static prefix and gateway.

Command: ip route network gateway {}
network is destination prefix with format of A.B.C.D/M. gateway is gateway for the prefix. When gateway is A.B.C.D format. It is taken as a IPv4 address gateway. Otherwise it is treated as an interface name.

ip route
ip route ppp0

First example defines static route with gateway Second one defines the same prefix but with gateway to interface ppp0.

Command: ip route network netmask gateway {}
This is alternate version of above command. When network is A.B.C.D format, user must define netmask value with A.B.C.D format. gateway is same option as above command

ip route
ip route ppp0

This is a same setting using this statement.

Command: ip route network gateway distance {}

Multiple nexthop static route

ip route
ip route
ip route eth0

If there is no route to and, and interface eth0 is reachable, then the last route is installed into the kernel.

zebra> show ip route
S> [1/0] via inactive
                      via inactive
  *                   is directly connected, eth0

Floating static route

Command: ipv6 route network gateway {}

Command: ipv6 route network gateway distance {}

Command: table tableno {}
Select the primary kernel routing table to be used. This only works for kernels supporting multiple routing tables (like GNU/Linux 2.2.x and later). After setting tableno with this command, static routes defined after this are added to the specified table.

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by Jasper Wallace on April, 24 2001 using texi2html