Adding Static Routes via Routing Daemons

Based on this chapter, you should now understand why adding static routes from the UNIX command line differs from adding static routes to the configuration of routing protocol daemons. The former acts directly on the FIB, whereas the latter acts on the RIB.

You should also note that because of this design paradigm, the routing engines differentiate between redistributing static routes added via routing protocol daemons and kernel routes added via the shell. For a complete treatise, three example configuration fragments for MRTd, GateD, and Zebra are offered (Examples 8-12 through 8-14). You can configure a preference value (administrative distance in Cisco notation) for comparison with other internal routing feeds, whereas from the UNIX shell only metrics are possible.

Example 8-12. MRTd Static Routes

[root@callisto:~#] cat /etc/mrtd.conf

...

router rip

  network 192.168.1.0/24

  network 192.168.14.0/24

  redistribute connected

  redistribute static

  redistribute kernel

!

route 0.0.0.0/0  192.168.1.254 1

...


Example 8-13. GateD Static Routes

[root@callisto:~#] cat /etc/gated.conf

...

static{

       host 172.16.5.5 gateway 192.168.1.254 reject;

       host 172.16.5.6 gateway 192.168.1.254 retain;

host 172.16.5.7 gateway 192.168.1.254 noinstall;

       172.16.1.0 mask 255.255.255.0 gateway 192.168.1.254 preference 1

       interface eth1;

       172.16.2.0 masklen 24 gateway 192.168.1.254 blackhole;

       default gateway 192.168.1.254;

};

export proto rip{

        proto static;

        proto direct;

        proto kernel;

};

...


Example 8-14. Zebra Static Routes

[root@callisto:~#] cat /usr/local/etc/zebra.conf

...

ip route 172.16.7.0/24 eth1 1

ip route 172.16.44.0/24 Null0

...