The zebra routing manager is required if you want to use any of the Zebra routing daemons. zebra maintains the kernel routing table, maintains the network interface list, defines the static routes, and manages the sharing of information between the different routing protocols.
zebra is configured by the zebra.conf file. Listing 7.5 shows a sample zebra.conf file for a Linux system using two Ethernet interfaces:
Listing 7.5: Sample zebra.conf File
! The hostname of this router hostname subnet60gw
! The password required for vtysh access password Wats?Watt?
! The password required for privileged vtysh commands enable password CHLLlns ! The first network interface interface eth0
ip address 172.16.60.1/24 multicast ! The second network interface interface eth1
ip address 172.16.1.9/24 ! The path to the log file log file /var/log/zebra.log ! A sample static route ip route 172.16.50.0/24 172.16.1.50 !
Comments in the various Zebra configuration files begin with an exclamation mark (!). The comments in Listing 7.5 explain the commands that follow them.
The sample file in Listing 7.5 is larger and more complex than most. It was made that way to provide a full range of examples, but it is worthwhile to remember that your zebra.conf file will probably be smaller.
The hostname command defines the hostname of the router. This is the name that will be used in routing protocol exchanges that use router names. zebra.conf files often start with this command.
Next come two commands that define passwords. The password command is necessary if you plan to use the vtysh interface. If this password is not defined, the vtysh interface is disabled for zebra. The second password provides greater configuration control to the vtysh interface. Without the password defined by the enable password command, the vtysh interface can only be used to query zebra for information. With this second password, the zebra configuration can be controlled from the interface. We look at vtysh in more detail later.
The first interface command defines the configuration of eth0. The command contains two clauses: ip address, which defines the address of the interface; and multicast, which turns on the multicasting flag for the interface. The multicast flag might be used if you planned to use a multicasting protocol, such as RIPv2, on this interface. The second interface command is much like the first, except that it does not set the multicast flag.
The log file command defines the file into which zebra should write its logging information. In Listing 7.5, the log is written to /var/log/zebra.log. Alternatives to logging to a specific file are to use the log stdout command to log to standard output or the log syslog command to log through syslogd.
The last command in Listing 7.5 defines a static route. Although static routes may be distributed by protocols configured in other files, such as ripd.conf, the static routes are defined in the zebra.conf file. The keywords ip route are followed by the destination of the route and then the router used to reach that destination. In Listing 7.5, the destination is network number 172.16.50.0. A 24-bit address mask is being used to match addresses to the destination. The gateway for the route is 172.16.1.50. Of course, this is just an example. You probably won't use static routes when you run routing protocols.
Two lines in the zebra.conf file shown in Listing 7.5 define passwords for the vtysh interface. This file should therefore be readable only by administrators. Before going on to the configuration of individual routing protocols, let's look at how these passwords are put to use for the vtysh interface.
Was this article helpful?