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