paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1 | @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 |
| 7 | table updates, interface lookups, and redistribution of routes between |
| 8 | different 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 | |
| 22 | Besides 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 |
| 28 | Runs in batch mode. @command{zebra} parses configuration file and terminates |
| 29 | immediately. |
| 30 | |
| 31 | @item -k |
| 32 | @itemx --keep_kernel |
| 33 | When zebra starts up, don't delete old self inserted routes. |
| 34 | |
| 35 | @item -l |
| 36 | @itemx --log_mode |
| 37 | Set verbose logging on. |
| 38 | |
| 39 | @item -r |
| 40 | @itemx --retain |
| 41 | When 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} {} |
| 54 | Up or down the current interface. |
| 55 | @end deffn |
| 56 | |
| 57 | @deffn {Interface Command} {ip address @var{address}} {} |
| 58 | Set ip address for the interface. |
| 59 | @end deffn |
| 60 | |
| 61 | @deffn {Interface Command} {description @var{description} ...} {} |
| 62 | Set description for the interface. |
| 63 | @end deffn |
| 64 | |
| 65 | @deffn {Interface Command} {multicast} {} |
| 66 | @deffnx {Interface Command} {no multicast} {} |
| 67 | Enable or disables multicast flag for the interface. |
| 68 | @end deffn |
| 69 | |
| 70 | @deffn {Interface Command} {bandwidth <1-10000000>} {} |
| 71 | @deffnx {Interface Command} {no bandwidth <1-10000000>} {} |
| 72 | Set bandwidth value to the interface. This is for calculating OSPF |
| 73 | cost. This command does not affect the actual device configuration. |
| 74 | @end deffn |
| 75 | |
| 76 | @node Static Route Commands, zebra Terminal Mode Commands, Interface Commands, Zebra |
| 77 | @comment node-name, next, previous, up |
| 78 | @section Static Route Commands |
| 79 | |
| 80 | Static routing is a very fundamental feature of routing technology. It |
| 81 | defines static prefix and gateway. |
| 82 | |
| 83 | @deffn Command {ip route @var{network} @var{gateway}} {} |
| 84 | @var{network} is destination prefix with format of A.B.C.D/M. |
| 85 | @var{gateway} is gateway for the prefix. When @var{gateway} is |
| 86 | A.B.C.D format. It is taken as a IPv4 address gateway. Otherwise it |
| 87 | is treated as an interface name. |
| 88 | |
| 89 | @example |
| 90 | ip route 10.0.0.0/8 10.0.0.2 |
| 91 | ip route 10.0.0.0/8 ppp0 |
| 92 | @end example |
| 93 | |
| 94 | First example defines 10.0.0.0/8 static route with gateway 10.0.0.2. |
| 95 | Second one defines the same prefix but with gateway to interface ppp0. |
| 96 | @end deffn |
| 97 | |
| 98 | @deffn Command {ip route @var{network} @var{netmask} @var{gateway}} {} |
| 99 | This is alternate version of above command. When @var{network} is |
| 100 | A.B.C.D format, user must define @var{netmask} value with A.B.C.D |
| 101 | format. @var{gateway} is same option as above command |
| 102 | |
| 103 | @example |
| 104 | ip route 10.0.0.0 255.255.255.0 10.0.0.2 |
| 105 | ip route 10.0.0.0 255.255.255.0 ppp0 |
| 106 | @end example |
| 107 | |
| 108 | This is a same setting using this statement. |
| 109 | @end deffn |
| 110 | |
| 111 | @deffn Command {ip route @var{network} @var{gateway} @var{distance}} {} |
| 112 | |
| 113 | @end deffn |
| 114 | |
| 115 | Multiple nexthop static route |
| 116 | |
| 117 | @example |
| 118 | ip route 10.0.0.1/32 10.0.0.2 |
| 119 | ip route 10.0.0.1/32 10.0.0.3 |
| 120 | ip route 10.0.0.1/32 eth0 |
| 121 | @end example |
| 122 | |
| 123 | If there is no route to 10.0.0.2 and 10.0.0.3, and interface eth0 |
| 124 | is reachable, then the last route is installed into the kernel. |
| 125 | |
| 126 | @example |
| 127 | zebra> show ip route |
| 128 | S> 10.0.0.1/32 [1/0] via 10.0.0.2 inactive |
| 129 | via 10.0.0.3 inactive |
| 130 | * is directly connected, eth0 |
| 131 | @end example |
| 132 | |
| 133 | Floating static route |
| 134 | |
| 135 | @deffn Command {ipv6 route @var{network} @var{gateway}} {} |
| 136 | |
| 137 | @end deffn |
| 138 | |
| 139 | @deffn Command {ipv6 route @var{network} @var{gateway} @var{distance}} {} |
| 140 | |
| 141 | @end deffn |
| 142 | |
| 143 | |
| 144 | @deffn Command {table @var{tableno}} {} |
| 145 | Select the primary kernel routing table to be used. This only works |
| 146 | for kernels supporting multiple routing tables (like GNU/Linux 2.2.x |
| 147 | and later). After setting @var{tableno} with this command, |
| 148 | static routes defined after this are added to the specified table. |
| 149 | @end deffn |
| 150 | |
| 151 | @node zebra Terminal Mode Commands, , Static Route Commands, Zebra |
| 152 | @comment node-name, next, previous, up |
| 153 | @section zebra Terminal Mode Commands |
| 154 | |
| 155 | @deffn Command {show ip route} {} |
| 156 | Display current routes which zebra holds in its database. |
| 157 | |
| 158 | @example |
| 159 | @group |
| 160 | Router# show ip route |
| 161 | Codes: K - kernel route, C - connected, S - static, R - RIP, |
| 162 | B - BGP * - FIB route. |
| 163 | |
| 164 | K* 0.0.0.0/0 203.181.89.241 |
| 165 | S 0.0.0.0/0 203.181.89.1 |
| 166 | C* 127.0.0.0/8 lo |
| 167 | C* 203.181.89.240/28 eth0 |
| 168 | @end group |
| 169 | @end example |
| 170 | @end deffn |
| 171 | |
| 172 | @deffn Command {show ipv6 route} {} |
| 173 | @end deffn |
| 174 | |
| 175 | @deffn Command {show interface} {} |
| 176 | @end deffn |
| 177 | |
| 178 | @deffn Command {show ipforward} {} |
| 179 | Display whether the host's IP forwarding function is enabled or not. |
| 180 | Almost any UNIX kernel can be configured with IP forwarding disabled. |
| 181 | If so, the box can't work as a router. |
| 182 | @end deffn |
| 183 | |
| 184 | @deffn Command {show ipv6forward} {} |
| 185 | Display whether the host's IP v6 forwarding is enabled or not. |
| 186 | @end deffn |