1

Introduction

I'm attempting to set up basic communication with the RIPv2 protocol between two hosts running the BIRD routing daemon.

I've got Host A with an interface enp0 that has address 10.0.1.50/24.
I've got another host Host B with an interface enp1 that has address 10.1.1.25/24. These interfaces are directly connected by cable. I can ping between both machines if I add a static route on both machines.

Configuration Files

I have the following bird.conf on Host A:

protocol kernel {
        learn;                  # Learn all alien routes from the kernel
        persist;                # Don't remove routes on bird shutdown
        scan time 20;           # Scan kernel routing table every 20 seconds
        export all;             # Default is export none
}

protocol device {
    scan time 10;           # Scan interfaces every 10 seconds
}

protocol direct {
        interface "enp0"
}

protocol rip MyRIP {    
    export all;
    import all;
    interface "enp0" { mode multicast;};
}

The bird.conf on Host B is identical except the enp0 is replaced with enp1

Initial Results

After starting the bird daemon on both hosts, I can do a tcpdump -ni enp0 -vv

13:21:41.943537 IP (tos 0xc0, ttl 1, id 4933, offset 0, flags [none], proto UDP (17), length 132)
    10.1.1.25.520 > 224.0.0.9.7742: [udp sum ok] UDP, length 104
13:21:41.943704 IP (tos 0xc0, ttl 1, id 150, offset 0, flags [none], proto UDP (17), length 272)
    10.0.1.50.520 > 224.0.0.9.7742: [bad udp cksum 0xec48 -> 0x1219!] UDP, length 244

I can hop inside the birdcl command-line and run show rip neighbors and get an empty table.

Making it work

If I set the addresses to be on the same subnet, I can run show rip neighbors and I can see 10.0.1.50 in my lists of neighbors.

Wrap-up

How can I get these routers to list each other as neighbors if the two ends of the link aren't on the same subnet?

I must have some sort of incorrect mental picture of how networks work, don't routers need talk to neighbors which aren't on the same subnet all the time?

I'm not hung up on a BIRD-specific answer.

karobar
  • 145
  • 1
  • 10

1 Answers1

3

Way back in ancient times when there were more protocols on the wire than TCP/IP, I ran RIP. Back then, it was RIPv1, and it used broadcasts. Network topologies looked kind of like this:

[10.0.0.0/24] <-- router --> [10.0.1.0/24] <-- router --> [10.0.2.0/24]
[10.0.3.0/24] <-- router ------^        ^---- router  --> [10.0.4.0/24]
[10.0.5.0/24] <-- router -------^      ^----- router  --> [10.0.6.0/24]

Where all the routers would share a subnet that only had routers on it. For two-router setups, there was a single cable strung between them like you're doing. For larger setups, there would be a fast network device running the subnet (hopefully a switch, but not always). That way everything was 2 hops away, and route-convergence went simply. It's what we had at the time.

Then came RIPv2 and multicasting, and having more hops was less prone to convergence problems. If the multicast TTL was set to +1 over the hop diameter, each router was effectively announcing directly to every other router, which made convergence happen faster.

Key thing to think about, though: Look at the source addresses on your TCPDUMP output.

 10.1.1.25.520 > 224.0.0.9.7742
 10.0.1.50.520 > 224.0.0.9.7742

The router 10.0.1.50 has been told that the router at 10.1.1.25 has a subnet of 10.1.1.0/24 local to it. However, the router at 10.0.1.50 doesn't have a route to address 10.1.1.25, so it won't add it to the table. Multicast is your announcement channel, but it can't carry routed traffic.

All is not lost.

If you are restricted to a single cable for some reason, you can define virtual interfaces. Where enp0.0 is on 10.3.1.0/24 and enp0.1 is on 10.0.1.0/24. That way you can use 10.3.1.0/24 as your 'routing network'.

sysadmin1138
  • 131,083
  • 18
  • 173
  • 296