blob: c13bdef5f6fd4447e4b350eb0e408112349e7543 [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
33@item -l
34@itemx --log_mode
35Set verbose logging on.
36
37@item -r
38@itemx --retain
39When program terminates, retain routes added by zebra.
40
41@end table
42
paul76b89b42004-11-06 17:13:09 +000043@node Interface Commands
paul718e3742002-12-13 20:15:29 +000044@section Interface Commands
45
46@deffn Command {interface @var{ifname}} {}
47@end deffn
48
49@deffn {Interface Command} {shutdown} {}
50@deffnx {Interface Command} {no shutdown} {}
51Up or down the current interface.
52@end deffn
53
paul971a4492003-06-20 01:18:07 +000054@deffn {Interface Command} {ip address @var{address/prefix}} {}
55@deffnx {Interface Command} {ip6 address @var{address/prefix}} {}
56@deffnx {Interface Command} {no ip address @var{address/prefix}} {}
57@deffnx {Interface Command} {no ip6 address @var{address/prefix}} {}
58Set the IPv4 or IPv6 address/prefix for the interface.
59@end deffn
60
61@deffn {Interface Command} {ip address @var{address/prefix} secondary} {}
62@deffnx {Interface Command} {no ip address @var{address/prefix} secondary} {}
63Set the secondary flag for this address. This causes ospfd to not treat the
64address as a distinct subnet.
paul718e3742002-12-13 20:15:29 +000065@end deffn
66
67@deffn {Interface Command} {description @var{description} ...} {}
68Set description for the interface.
69@end deffn
70
71@deffn {Interface Command} {multicast} {}
72@deffnx {Interface Command} {no multicast} {}
73Enable or disables multicast flag for the interface.
74@end deffn
75
76@deffn {Interface Command} {bandwidth <1-10000000>} {}
77@deffnx {Interface Command} {no bandwidth <1-10000000>} {}
paul971a4492003-06-20 01:18:07 +000078Set bandwidth value of the interface in kilobits/sec. This is for
79calculating OSPF cost. This command does not affect the actual device
80configuration.
81@end deffn
82
83@deffn {Interface Command} {link-detect} {}
84@deffnx {Interface Command} {no link-detect} {}
85Enable/disable link-detect on platforms which support this. Currently
86only linux and with certain drivers - those which properly support the
87IFF_RUNNING flag.
paul718e3742002-12-13 20:15:29 +000088@end deffn
89
paul76b89b42004-11-06 17:13:09 +000090@node Static Route Commands
paul718e3742002-12-13 20:15:29 +000091@section Static Route Commands
92
93Static routing is a very fundamental feature of routing technology. It
94defines static prefix and gateway.
95
96@deffn Command {ip route @var{network} @var{gateway}} {}
97@var{network} is destination prefix with format of A.B.C.D/M.
98@var{gateway} is gateway for the prefix. When @var{gateway} is
99A.B.C.D format. It is taken as a IPv4 address gateway. Otherwise it
paul971a4492003-06-20 01:18:07 +0000100is treated as an interface name. If the interface name is @var{null0} then
101zebra installs a blackhole route.
paul718e3742002-12-13 20:15:29 +0000102
103@example
104ip route 10.0.0.0/8 10.0.0.2
105ip route 10.0.0.0/8 ppp0
paul971a4492003-06-20 01:18:07 +0000106ip route 10.0.0.0/8 null0
paul718e3742002-12-13 20:15:29 +0000107@end example
108
109First example defines 10.0.0.0/8 static route with gateway 10.0.0.2.
paul971a4492003-06-20 01:18:07 +0000110Second one defines the same prefix but with gateway to interface ppp0. The
111third install a blackhole route.
paul718e3742002-12-13 20:15:29 +0000112@end deffn
113
114@deffn Command {ip route @var{network} @var{netmask} @var{gateway}} {}
115This is alternate version of above command. When @var{network} is
116A.B.C.D format, user must define @var{netmask} value with A.B.C.D
117format. @var{gateway} is same option as above command
118
119@example
120ip route 10.0.0.0 255.255.255.0 10.0.0.2
121ip route 10.0.0.0 255.255.255.0 ppp0
paul971a4492003-06-20 01:18:07 +0000122ip route 10.0.0.0 255.255.255.0 null0
paul718e3742002-12-13 20:15:29 +0000123@end example
124
paul971a4492003-06-20 01:18:07 +0000125These statements are equivalent to those in the previous example.
paul718e3742002-12-13 20:15:29 +0000126@end deffn
127
128@deffn Command {ip route @var{network} @var{gateway} @var{distance}} {}
paul971a4492003-06-20 01:18:07 +0000129Installs the route with the specified distance.
paul718e3742002-12-13 20:15:29 +0000130@end deffn
131
132Multiple nexthop static route
133
134@example
135ip route 10.0.0.1/32 10.0.0.2
136ip route 10.0.0.1/32 10.0.0.3
137ip route 10.0.0.1/32 eth0
138@end example
139
140If there is no route to 10.0.0.2 and 10.0.0.3, and interface eth0
141is reachable, then the last route is installed into the kernel.
142
paul971a4492003-06-20 01:18:07 +0000143If zebra has been compiled with multipath support, and both 10.0.0.2 and
14410.0.0.3 are reachable, zebra will install a multipath route via both
145nexthops, if the platform supports this.
146
paul718e3742002-12-13 20:15:29 +0000147@example
148zebra> show ip route
149S> 10.0.0.1/32 [1/0] via 10.0.0.2 inactive
150 via 10.0.0.3 inactive
151 * is directly connected, eth0
152@end example
153
paul971a4492003-06-20 01:18:07 +0000154@example
155ip route 10.0.0.0/8 10.0.0.2
156ip route 10.0.0.0/8 10.0.0.3
157ip route 10.0.0.0/8 null0 255
158@end example
159
160This will install a multihop route via the specified next-hops if they are
161reachable, as well as a high-metric blackhole route, which can be useful to
162prevent traffic destined for a prefix to match less-specific routes (eg
163default) should the specified gateways not be reachable. Eg:
164
165@example
166zebra> show ip route 10.0.0.0/8
167Routing entry for 10.0.0.0/8
168 Known via "static", distance 1, metric 0
169 10.0.0.2 inactive
170 10.0.0.3 inactive
171
172Routing entry for 10.0.0.0/8
173 Known via "static", distance 255, metric 0
174 directly connected, Null0
175@end example
paul718e3742002-12-13 20:15:29 +0000176
177@deffn Command {ipv6 route @var{network} @var{gateway}} {}
paul971a4492003-06-20 01:18:07 +0000178@deffnx Command {ipv6 route @var{network} @var{gateway} @var{distance}} {}
179These behave similarly to their ipv4 counterparts.
paul718e3742002-12-13 20:15:29 +0000180@end deffn
181
182
183@deffn Command {table @var{tableno}} {}
184Select the primary kernel routing table to be used. This only works
185for kernels supporting multiple routing tables (like GNU/Linux 2.2.x
186and later). After setting @var{tableno} with this command,
187static routes defined after this are added to the specified table.
188@end deffn
189
paul76b89b42004-11-06 17:13:09 +0000190@node zebra Terminal Mode Commands
paul718e3742002-12-13 20:15:29 +0000191@section zebra Terminal Mode Commands
192
193@deffn Command {show ip route} {}
194Display current routes which zebra holds in its database.
195
196@example
197@group
198Router# show ip route
199Codes: K - kernel route, C - connected, S - static, R - RIP,
200 B - BGP * - FIB route.
201
202K* 0.0.0.0/0 203.181.89.241
203S 0.0.0.0/0 203.181.89.1
204C* 127.0.0.0/8 lo
205C* 203.181.89.240/28 eth0
206@end group
207@end example
208@end deffn
209
210@deffn Command {show ipv6 route} {}
211@end deffn
212
213@deffn Command {show interface} {}
214@end deffn
215
216@deffn Command {show ipforward} {}
217Display whether the host's IP forwarding function is enabled or not.
218Almost any UNIX kernel can be configured with IP forwarding disabled.
219If so, the box can't work as a router.
220@end deffn
221
222@deffn Command {show ipv6forward} {}
223Display whether the host's IP v6 forwarding is enabled or not.
224@end deffn