Saving IP space on your point to point peering subnets using /31 subnets aka RFC3021

Most of us are used to allocating a /30 subnet for point to point peering, which gives us 2 device IP’s, a network address, and a broadcast address. With the exhaustion of IPV4 space it’s useful to be able to save wherever you can, so where possible you should consider /31 allocation instead of /30. Most modern day vendors support RFC3021 and using it is as simple as just specifying the /31 subnet mask. I have used this on various Juniper and Cisco devices in the past without any issues, but unfortunately not all vendors or models support it so your mileage will vary.

I would also, always recommend performing further testing beyond just a ICMP reachability tests if broadcast protocols are involved. A prime example is if you use something like the OSPF routing protocol that uses broadcast as a discovery mechanism. It should work but if it does not then possibly see if you can set it o P2P operation before reverting back to a /30 allocation.
I need to mention Mikrotik specifically here because they do not support RFC3021 in an obvious way. If you just specify x.x.x.x/31 it wont work. You need to specify a /32 with a matching network address. So 1.1.1.0/31 would look like so

/ip address add address=1.1.1.0/32 network=1.1.1.1 interface=ether1

The above example is compatible with RFC3021 but is actually different in that the network address does not have to fall within the same /31 as the IP. I have struggled to find the RFC for this assignment scheme but it allows you to be able to add the same IP multiple times with a different network address. This allows you to reach multiple devices on the same network segment using only a single IP per device. This obviously only works if all devices support this format.

Example of using this to connect to 2 other routers with IP’s 2.2.2.2 and 3.3.3.3.

/ip address add address=1.1.1.0/32 network=2.2.2.2 interface=ether1
/ip address add address=1.1.1.0/32 network=3.3.3.3 interface=ether1
Posted in Uncategorised and tagged , , .

Leave a Reply

Your email address will not be published. Required fields are marked *