blob: 4254379e66d54b0278c70964fa74b1c70fe4279a [file] [log] [blame]
paul718e3742002-12-13 20:15:29 +00001@node Zebra
paul718e3742002-12-13 20:15:29 +00002@chapter Zebra
3
4@c SYNOPSIS
5@command{zebra} is an IP routing manager. It provides kernel routing
6table updates, interface lookups, and redistribution of routes between
7different routing protocols.
8
9@menu
10* Invoking zebra:: Running the program
11* Interface Commands:: Commands for zebra interfaces
12* Static Route Commands:: Commands for adding static routes
13* zebra Terminal Mode Commands:: Commands for zebra's VTY
14@end menu
15
16
paul76b89b42004-11-06 17:13:09 +000017@node Invoking zebra
paul718e3742002-12-13 20:15:29 +000018@section Invoking zebra
19
20Besides the common invocation options (@pxref{Common Invocation Options}), the
21@command{zebra} specific invocation options are listed below.
22
23@table @samp
24@item -b
25@itemx --batch
26Runs in batch mode. @command{zebra} parses configuration file and terminates
27immediately.
28
29@item -k
30@itemx --keep_kernel
31When zebra starts up, don't delete old self inserted routes.
32
paul718e3742002-12-13 20:15:29 +000033@item -r
34@itemx --retain
35When program terminates, retain routes added by zebra.
36
37@end table
38
paul76b89b42004-11-06 17:13:09 +000039@node Interface Commands
paul718e3742002-12-13 20:15:29 +000040@section Interface Commands
41
42@deffn Command {interface @var{ifname}} {}
43@end deffn
44
45@deffn {Interface Command} {shutdown} {}
46@deffnx {Interface Command} {no shutdown} {}
47Up or down the current interface.
48@end deffn
49
paul971a4492003-06-20 01:18:07 +000050@deffn {Interface Command} {ip address @var{address/prefix}} {}
51@deffnx {Interface Command} {ip6 address @var{address/prefix}} {}
52@deffnx {Interface Command} {no ip address @var{address/prefix}} {}
53@deffnx {Interface Command} {no ip6 address @var{address/prefix}} {}
54Set the IPv4 or IPv6 address/prefix for the interface.
55@end deffn
56
57@deffn {Interface Command} {ip address @var{address/prefix} secondary} {}
58@deffnx {Interface Command} {no ip address @var{address/prefix} secondary} {}
59Set the secondary flag for this address. This causes ospfd to not treat the
60address as a distinct subnet.
paul718e3742002-12-13 20:15:29 +000061@end deffn
62
63@deffn {Interface Command} {description @var{description} ...} {}
64Set description for the interface.
65@end deffn
66
67@deffn {Interface Command} {multicast} {}
68@deffnx {Interface Command} {no multicast} {}
69Enable or disables multicast flag for the interface.
70@end deffn
71
72@deffn {Interface Command} {bandwidth <1-10000000>} {}
73@deffnx {Interface Command} {no bandwidth <1-10000000>} {}
paul971a4492003-06-20 01:18:07 +000074Set bandwidth value of the interface in kilobits/sec. This is for
75calculating OSPF cost. This command does not affect the actual device
76configuration.
77@end deffn
78
79@deffn {Interface Command} {link-detect} {}
80@deffnx {Interface Command} {no link-detect} {}
81Enable/disable link-detect on platforms which support this. Currently
82only linux and with certain drivers - those which properly support the
83IFF_RUNNING flag.
paul718e3742002-12-13 20:15:29 +000084@end deffn
85
paul76b89b42004-11-06 17:13:09 +000086@node Static Route Commands
paul718e3742002-12-13 20:15:29 +000087@section Static Route Commands
88
89Static routing is a very fundamental feature of routing technology. It
90defines static prefix and gateway.
91
92@deffn Command {ip route @var{network} @var{gateway}} {}
93@var{network} is destination prefix with format of A.B.C.D/M.
94@var{gateway} is gateway for the prefix. When @var{gateway} is
95A.B.C.D format. It is taken as a IPv4 address gateway. Otherwise it
paul971a4492003-06-20 01:18:07 +000096is treated as an interface name. If the interface name is @var{null0} then
97zebra installs a blackhole route.
paul718e3742002-12-13 20:15:29 +000098
99@example
100ip route 10.0.0.0/8 10.0.0.2
101ip route 10.0.0.0/8 ppp0
paul971a4492003-06-20 01:18:07 +0000102ip route 10.0.0.0/8 null0
paul718e3742002-12-13 20:15:29 +0000103@end example
104
105First example defines 10.0.0.0/8 static route with gateway 10.0.0.2.
paul971a4492003-06-20 01:18:07 +0000106Second one defines the same prefix but with gateway to interface ppp0. The
107third install a blackhole route.
paul718e3742002-12-13 20:15:29 +0000108@end deffn
109
110@deffn Command {ip route @var{network} @var{netmask} @var{gateway}} {}
111This is alternate version of above command. When @var{network} is
112A.B.C.D format, user must define @var{netmask} value with A.B.C.D
113format. @var{gateway} is same option as above command
114
115@example
116ip route 10.0.0.0 255.255.255.0 10.0.0.2
117ip route 10.0.0.0 255.255.255.0 ppp0
paul971a4492003-06-20 01:18:07 +0000118ip route 10.0.0.0 255.255.255.0 null0
paul718e3742002-12-13 20:15:29 +0000119@end example
120
paul971a4492003-06-20 01:18:07 +0000121These statements are equivalent to those in the previous example.
paul718e3742002-12-13 20:15:29 +0000122@end deffn
123
124@deffn Command {ip route @var{network} @var{gateway} @var{distance}} {}
paul971a4492003-06-20 01:18:07 +0000125Installs the route with the specified distance.
paul718e3742002-12-13 20:15:29 +0000126@end deffn
127
128Multiple nexthop static route
129
130@example
131ip route 10.0.0.1/32 10.0.0.2
132ip route 10.0.0.1/32 10.0.0.3
133ip route 10.0.0.1/32 eth0
134@end example
135
136If there is no route to 10.0.0.2 and 10.0.0.3, and interface eth0
137is reachable, then the last route is installed into the kernel.
138
paul971a4492003-06-20 01:18:07 +0000139If zebra has been compiled with multipath support, and both 10.0.0.2 and
14010.0.0.3 are reachable, zebra will install a multipath route via both
141nexthops, if the platform supports this.
142
paul718e3742002-12-13 20:15:29 +0000143@example
144zebra> show ip route
145S> 10.0.0.1/32 [1/0] via 10.0.0.2 inactive
146 via 10.0.0.3 inactive
147 * is directly connected, eth0
148@end example
149
paul971a4492003-06-20 01:18:07 +0000150@example
151ip route 10.0.0.0/8 10.0.0.2
152ip route 10.0.0.0/8 10.0.0.3
153ip route 10.0.0.0/8 null0 255
154@end example
155
156This will install a multihop route via the specified next-hops if they are
157reachable, as well as a high-metric blackhole route, which can be useful to
158prevent traffic destined for a prefix to match less-specific routes (eg
159default) should the specified gateways not be reachable. Eg:
160
161@example
162zebra> show ip route 10.0.0.0/8
163Routing entry for 10.0.0.0/8
164 Known via "static", distance 1, metric 0
165 10.0.0.2 inactive
166 10.0.0.3 inactive
167
168Routing entry for 10.0.0.0/8
169 Known via "static", distance 255, metric 0
170 directly connected, Null0
171@end example
paul718e3742002-12-13 20:15:29 +0000172
173@deffn Command {ipv6 route @var{network} @var{gateway}} {}
paul971a4492003-06-20 01:18:07 +0000174@deffnx Command {ipv6 route @var{network} @var{gateway} @var{distance}} {}
175These behave similarly to their ipv4 counterparts.
paul718e3742002-12-13 20:15:29 +0000176@end deffn
177
178
179@deffn Command {table @var{tableno}} {}
180Select the primary kernel routing table to be used. This only works
181for kernels supporting multiple routing tables (like GNU/Linux 2.2.x
182and later). After setting @var{tableno} with this command,
183static routes defined after this are added to the specified table.
184@end deffn
185
paul76b89b42004-11-06 17:13:09 +0000186@node zebra Terminal Mode Commands
paul718e3742002-12-13 20:15:29 +0000187@section zebra Terminal Mode Commands
188
189@deffn Command {show ip route} {}
190Display current routes which zebra holds in its database.
191
192@example
193@group
194Router# show ip route
195Codes: K - kernel route, C - connected, S - static, R - RIP,
196 B - BGP * - FIB route.
197
198K* 0.0.0.0/0 203.181.89.241
199S 0.0.0.0/0 203.181.89.1
200C* 127.0.0.0/8 lo
201C* 203.181.89.240/28 eth0
202@end group
203@end example
204@end deffn
205
206@deffn Command {show ipv6 route} {}
207@end deffn
208
209@deffn Command {show interface} {}
210@end deffn
211
212@deffn Command {show ipforward} {}
213Display whether the host's IP forwarding function is enabled or not.
214Almost any UNIX kernel can be configured with IP forwarding disabled.
215If so, the box can't work as a router.
216@end deffn
217
218@deffn Command {show ipv6forward} {}
219Display whether the host's IP v6 forwarding is enabled or not.
220@end deffn