5 @command{zebra} is an IP routing manager. It provides kernel routing
6 table updates, interface lookups, and redistribution of routes between
7 different routing protocols.
10 * Invoking zebra:: Running the program
11 * Interface Commands:: Commands for zebra interfaces
12 * Static Route Commands:: Commands for adding static routes
13 * zebra Route Filtering:: Commands for zebra route filtering
14 * zebra Terminal Mode Commands:: Commands for zebra's VTY
19 @section Invoking zebra
21 Besides the common invocation options (@pxref{Common Invocation Options}), the
22 @command{zebra} specific invocation options are listed below.
27 Runs in batch mode. @command{zebra} parses configuration file and terminates
32 When zebra starts up, don't delete old self inserted routes.
36 When program terminates, retain routes added by zebra.
40 @node Interface Commands
41 @section Interface Commands
43 @deffn Command {interface @var{ifname}} {}
46 @deffn {Interface Command} {shutdown} {}
47 @deffnx {Interface Command} {no shutdown} {}
48 Up or down the current interface.
51 @deffn {Interface Command} {ip address @var{address/prefix}} {}
52 @deffnx {Interface Command} {ip6 address @var{address/prefix}} {}
53 @deffnx {Interface Command} {no ip address @var{address/prefix}} {}
54 @deffnx {Interface Command} {no ip6 address @var{address/prefix}} {}
55 Set the IPv4 or IPv6 address/prefix for the interface.
58 @deffn {Interface Command} {ip address @var{address/prefix} secondary} {}
59 @deffnx {Interface Command} {no ip address @var{address/prefix} secondary} {}
60 Set the secondary flag for this address. This causes ospfd to not treat the
61 address as a distinct subnet.
64 @deffn {Interface Command} {description @var{description} ...} {}
65 Set description for the interface.
68 @deffn {Interface Command} {multicast} {}
69 @deffnx {Interface Command} {no multicast} {}
70 Enable or disables multicast flag for the interface.
73 @deffn {Interface Command} {bandwidth <1-10000000>} {}
74 @deffnx {Interface Command} {no bandwidth <1-10000000>} {}
75 Set bandwidth value of the interface in kilobits/sec. This is for
76 calculating OSPF cost. This command does not affect the actual device
80 @deffn {Interface Command} {link-detect} {}
81 @deffnx {Interface Command} {no link-detect} {}
82 Enable/disable link-detect on platforms which support this. Currently
83 only Linux and Solaris, and only where network interface drivers support reporting
84 link-state via the IFF_RUNNING flag.
87 @node Static Route Commands
88 @section Static Route Commands
90 Static routing is a very fundamental feature of routing technology. It
91 defines static prefix and gateway.
93 @deffn Command {ip route @var{network} @var{gateway}} {}
94 @var{network} is destination prefix with format of A.B.C.D/M.
95 @var{gateway} is gateway for the prefix. When @var{gateway} is
96 A.B.C.D format. It is taken as a IPv4 address gateway. Otherwise it
97 is treated as an interface name. If the interface name is @var{null0} then
98 zebra installs a blackhole route.
101 ip route 10.0.0.0/8 10.0.0.2
102 ip route 10.0.0.0/8 ppp0
103 ip route 10.0.0.0/8 null0
106 First example defines 10.0.0.0/8 static route with gateway 10.0.0.2.
107 Second one defines the same prefix but with gateway to interface ppp0. The
108 third install a blackhole route.
111 @deffn Command {ip route @var{network} @var{netmask} @var{gateway}} {}
112 This is alternate version of above command. When @var{network} is
113 A.B.C.D format, user must define @var{netmask} value with A.B.C.D
114 format. @var{gateway} is same option as above command
117 ip route 10.0.0.0 255.255.255.0 10.0.0.2
118 ip route 10.0.0.0 255.255.255.0 ppp0
119 ip route 10.0.0.0 255.255.255.0 null0
122 These statements are equivalent to those in the previous example.
125 @deffn Command {ip route @var{network} @var{gateway} @var{distance}} {}
126 Installs the route with the specified distance.
129 Multiple nexthop static route
132 ip route 10.0.0.1/32 10.0.0.2
133 ip route 10.0.0.1/32 10.0.0.3
134 ip route 10.0.0.1/32 eth0
137 If there is no route to 10.0.0.2 and 10.0.0.3, and interface eth0
138 is reachable, then the last route is installed into the kernel.
140 If zebra has been compiled with multipath support, and both 10.0.0.2 and
141 10.0.0.3 are reachable, zebra will install a multipath route via both
142 nexthops, if the platform supports this.
146 S> 10.0.0.1/32 [1/0] via 10.0.0.2 inactive
147 via 10.0.0.3 inactive
148 * is directly connected, eth0
152 ip route 10.0.0.0/8 10.0.0.2
153 ip route 10.0.0.0/8 10.0.0.3
154 ip route 10.0.0.0/8 null0 255
157 This will install a multihop route via the specified next-hops if they are
158 reachable, as well as a high-metric blackhole route, which can be useful to
159 prevent traffic destined for a prefix to match less-specific routes (eg
160 default) should the specified gateways not be reachable. Eg:
163 zebra> show ip route 10.0.0.0/8
164 Routing entry for 10.0.0.0/8
165 Known via "static", distance 1, metric 0
169 Routing entry for 10.0.0.0/8
170 Known via "static", distance 255, metric 0
171 directly connected, Null0
174 @deffn Command {ipv6 route @var{network} @var{gateway}} {}
175 @deffnx Command {ipv6 route @var{network} @var{gateway} @var{distance}} {}
176 These behave similarly to their ipv4 counterparts.
180 @deffn Command {table @var{tableno}} {}
181 Select the primary kernel routing table to be used. This only works
182 for kernels supporting multiple routing tables (like GNU/Linux 2.2.x
183 and later). After setting @var{tableno} with this command,
184 static routes defined after this are added to the specified table.
187 @node zebra Route Filtering
188 @section zebra Route Filtering
189 Zebra supports @command{prefix-list} and @command{route-map} to match
190 routes received from other quagga components. The
191 @command{permit}/@command{deny} facilities provided by these commands
192 can be used to filter which routes zebra will install in the kernel.
194 @deffn Command {ip protocol @var{protocol} route-map @var{routemap}} {}
195 Apply a route-map filter to routes for the specified protocol. @var{protocol}
196 can be @b{any} or one of
210 @deffn {Route Map} {set src @var{address}}
211 Within a route-map, set the preferred source address for matching routes
212 when installing in the kernel.
216 The following creates a prefix-list that matches all addresses, a route-map
217 that sets the preferred source address, and applies the route-map to all
218 @command{rip} routes.
221 ip prefix-list ANY permit 0.0.0.0/0 le 32
222 route-map RM1 permit 10
223 match ip address prefix-list ANY
226 ip protocol rip route-map RM1
230 @node zebra Terminal Mode Commands
231 @section zebra Terminal Mode Commands
233 @deffn Command {show ip route} {}
234 Display current routes which zebra holds in its database.
238 Router# show ip route
239 Codes: K - kernel route, C - connected, S - static, R - RIP,
240 B - BGP * - FIB route.
242 K* 0.0.0.0/0 203.181.89.241
243 S 0.0.0.0/0 203.181.89.1
245 C* 203.181.89.240/28 eth0
250 @deffn Command {show ipv6 route} {}
253 @deffn Command {show interface} {}
256 @deffn Command {show ip prefix-list [@var{name}]} {}
259 @deffn Command {show route-map [@var{name}]} {}
262 @deffn Command {show ip protocol} {}
265 @deffn Command {show ipforward} {}
266 Display whether the host's IP forwarding function is enabled or not.
267 Almost any UNIX kernel can be configured with IP forwarding disabled.
268 If so, the box can't work as a router.
271 @deffn Command {show ipv6forward} {}
272 Display whether the host's IP v6 forwarding is enabled or not.