Build a network router on Linux
Build a network router on Linux
Zebra offers a competent substitute for dedicated Cisco routers
Dynamic and robust routing is so essential to the workings of the Internet that any fledgling internetworking engineer must not only understand its concepts but also be able put it into practice in real situations. At the same time, this part of the routing scene is dominated by products from high-end network equipment providers such as Cisco, well outside the means of most individuals: learning would otherwise be limited to school or laboratory environments, with time and availability of the resources as perennial adversaries.
We were faced with such a dilemma when organizing a class on TCP/IP routing. Working with a small test network, we wanted to demonstrate various load-balancing scenarios with Routing Information Protocol (RIP) and Open Shortest Path First (OSPF). However, we were limited by the number of Cisco routers on hand. We did have some PCs available, so we began looking for alternative means to simulate Cisco routers using Linux.
Initially, we attempted to set up our test network using the traditional routed and gated daemons, but we quickly realized that their awkward configuration and limited capabilities created more hindrance than value. We decided to look for more modern means of completing our network and fortunately came upon Zebra.
What is Zebra?
Zebra is TCP/IP routing software that supports BGP-4, BGP-4+, OSPFv2, OSPFv3, RIPv1, RIPv2, and RIPng. It is distributed under the GNU General Public License and runs on Linux as well as other UNIX variants. Zebra is included in most modern distributions as routing software. The latest version, along with documentation, is available at the GNU Zebra Web site (see Resources for a link).
The original Zebra package was written by Kunihiro Ishiguro and Yoshinari Yoshikawa back in 1996. Today, the package is maintained primarily by IP Infusion — of which Mr. Ishiguro is the CTO — with the assistance of networking engineers and open source volunteers.
Zebra is unique in its design because it takes a modular approach to the protocols that it manages. Protocols can be enabled or disabled as network requirements dictate.
By far the most useful feature we found with Zebra was its close similarity to the Cisco IOS configuration formats. While there are some differences from IOS, the feel is close enough that network engineers already familiar with IOS will feel very comfortable in the environment.
While Zebra has not yet hit version 1.0 — the version at the time of this writing is 0.93b — the quality of the product is adequate for small networks that need a core router. [Please note that this article was written using version 0.93b. Later versions may need to be installed and configured differently. -Ed.]
Installing Zebra
Our test platform for Zebra was an old but sturdy ThinkPad X20 running Red Hat Linux 9. The ThinkPad has a built-in Ethernet port, and we added another Ethernet PCMCIA card so it could act as a router. Before proceeding with the Zebra installation, we made sure that both network cards were recognized by Linux and were confirmed to be working.
An RPM for Zebra-0.93b already ships with Red Hat 9. As this was the same version available on the Zebra Web site, we decided to use this instead of downloading and compiling our own. The Zebra RPM installs binaries, scripts, and configuration files as well as the requisite manuals, examples, and documentation files.
Basic Zebra configuration
The zebra daemon is the actual routing manager that controls the other modules; it also provides the primary point of interaction with the user. This was the first thing we needed to configure, and we did it through the /etc/zebra/zebra.conf file.
