rip2ad

rip2ad, written by Andrea Beck, is a RIP version 2 broadcast (actually multicast) utility available at http://www.ibh.de/∼beck/stuff/ripper/ .rip2ad provides RIP advertising functionality without having to run a full-blown routing daemon or having to support RIP on the local network. In the past, this functionality was often provided by bcastd; however, bcastd is no longer maintained and does not support RIP-2.

A rip2ad Example

Consider the network in Figure 7.5. The Linux router named “ritz” needs to tell the corporate router,“gate” about the local networks 192.168.0.0/24, 192.168.1.0/24, 192.168.2.0/24, and 192.168.3.0/24, which can be summarized as 192.168.0.0/22.

Figure 7.5. rip2ad network example.


The problem could be solved by running RIP within the remote network, having “ritz” run RIP with static routes pointed towards the other LAN networks, or having a static routing entry on “gate;” however, static routes might be prohibited by policy, which has the disadvantage of “gate” always further advertising the route, even when the link is not available due to an outage.

Running a routing protocol daemon on ‘ritz’ is overkill, but router ‘ritz’ can use rip2ad to tell corporate router ‘gate’ about the networks without RIP having to run on itself, ‘jos,’ or ‘hild.’

Compiling and Installing rip2ad

rip2ad is simple to compile with a one-liner:

[root@lefty ripper]# gcc rip2ad.c -o rip2ad 

The rip2ad executable can then be placed in an appropriate place, such as /usr/local/sbin/:

[root@lefty ripper]# cp rip2ad /usr/local/sbin/ 

rip2ad can be used with only command-line arguments, but the -f parameter allows a filename to be specified, which makes its use a bit easier.

For the network shown in Figure 7.5, the following /etc/riptable is entered:

192.168.0.0 255.255.255.0 0 1 
192.168.1.0 255.255.255.0 0 1 
192.168.2.0 255.255.255.0 0 1 
192.168.3.0 255.255.255.0 0 1 

This table is made up of the network address, the netmask, the IP address that advertised the route, and the metric. In this specific example, the 0 in the IP address field tells rip2ad to use the local IP address, which is fine with this example—it isn’t important for ‘gate’ to know anything more specific.

To have rip2ad advertise these routes every 30 seconds, we use

[root@lefty ripper]# rip2ad -f /etc/riptable -c 30 & 

If tcpdump is used to examine the packets, the advertisements will be seen to the RIP-2 multicast address:

[root@lefty ripper]# tcpdump 
Kernel filter, protocol ALL, datagram packet socket 
tcpdump: listening on all devices 
09:33:38.311593 eth0 > 192.168.1.254.route > 224.0.0.9.route: rip-resp 4: 
{192.168.0.0/255.255.255.0}(1) {192.168.1.0/255.255.255.0}(1) 
{192.168.2.0/255.255.255.0}(1) {192.168.3.0/255.255.255.0}(1) [ttl 1] 
1 packets received by filter 

Because the connection between ‘gate’ and ‘ritz’ is a point-to-point link, the multicast just shown will not function. A unicast address is required, which rip2ad supports:

[root@lefty ripper]# rip2ad -f /etc/riptable -c 30 -d 10.1.1.1 & 

And tcpdump shows the unicast:

[root@lefty ripper]# tcpdump 
Kernel filter, protocol ALL, datagram packet socket 
tcpdump: listening on all devices 
09:41:35.679407 eth0 > 192.168.1.254.route > 10.1.1.1.route: rip-resp 4: 
{192.168.0.0/255.255.255.0}(1) {192.168.1.0/255.255.255.0}(1) 
{192.168.2.0/255.255.255.0}(1) {192.168.3.0/255.255.255.0}(1) 
1 packets received by filter 

As mentioned, the networks can be summarized as 192.168.0.0/22 (netmask = 255.255.252.0), so the following /etc/riptable can be used:

192.168.0.0 255.255.252.0 0 1 

If rip2ad is started again with the new /etc/riptable:

[root@lefty ripper]# rip2ad -f /etc/riptable -c 30 -d 10.1.1.1 & 

Then tcpdump will show the new route being advertised:

[root@lefty ripper]# tcpdump -n host 192.168.1.1 
09:49:32.124445 eth0 > 192.168.1.254.route > 10.1.1.1.route: rip-resp 1: 
{192.168.0.0/255.255.252.0}(1) 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset