- A <tt>rip2ad</tt> Example
- Compiling and Installing rip2ad
- Conclusion
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 exampleit isn't important for gate to know anything more specific.
To have rip2ad advertise these routes every 30 seconds, 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 version 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 &
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)