Using /31 subnets on point-to-point links

A recent post on /30 and /31 addressing prompted one reader to ask when 31-bit subnet masks are appropriate, or supported. It turns out they've been supported for a while.

Thirty-one-bit subnets were first proposed in RFC 3021, which was primarily motivated by the potential for public address space conservation. Recall that shrinking a /30 subnet to a /31 effectively doubles the number of point-to-point links you can address from a finite range. Cisco IOS has supported /31 subnets for point-to-point links since release 12.2(2)T. A thorough explanation of the feature is presented here.

We can put this theory into practice by addressing a point-to-point connection between two routers as 10.0.0.0/31. Note that this even applies to Ethernet interfaces, technically a broadcast medium.

Router(config)# interface f0/0
Router(config-if)# ip address 10.0.0.0 255.255.255.254
% Warning: use /31 mask on non point-to-point interface cautiously

An ominous warning message, no doubt, but it works just fine. We can successfully ping the far-end interface (10.0.0.1), and the subnet is accurately reflected in the routing table:

Router# ping 10.0.0.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/16/20 ms
Router# show ip route
...
     10.0.0.0/31 is subnetted, 1 subnets
C       10.0.0.0 is directly connected, FastEthernet0/0

About the Author

Jeremy Stretch is a freelance networking engineer, instructor, and the maintainer of PacketLife.net. He currently lives in Fairfax, Virginia, on the edge of the Washington, DC metro area. Although primarily an R&S guy, he likes to get into everything, and runs a free network training lab out of his basement for fun. You can contact him by email or follow him on Twitter.

Comments

Nice, but I have never seen this in a production network!

Nice , never knew that Before

Cool. But what happens if there is similar route but with a /30 subnet mask in the routing table?

I think a directly connected network would win

Good one. thanks.

any known problems with using /31 subnets?

We use /31's almost exclusively in our very large international network. No problems discovered after years of usage.

"Cool. But what happens if there is similar route but with a /30 subnet mask in the routing table?" before we even get into the connected route winning, the longer match would be preferable thus the /31 would win

This goes against my CCNA training, I've been living a lie!

Sooooo wrong to be able to ping .0 !

This probably never caught on with providers because there was no mechanisim to roll it out whout readressing your existing customers' circuits. If you are using .0/20, then your usable hosts are .1 and .2, then .5 and .6 in the next block. /31 opens up .0/.1, .2/.3, /.4/.5. . . .If there was a way to keep your existing endpoint IPs and make available p-p circuits of .3/.4, so you could just change masks and then add circuits in the "dead space"

Think, not only of all the customer reconfiguration, but route table overhauls.

It was a good idea in theory.

Is there anyway to have this work up on an ASA? I've used it with sucess for point-to-point links on routers etc, but seems like both pix's and ASA's throw a "ERROR: /31 mask is not allowed"

I've raked for docs, and cant find anything!

(By the way, Loving the CAPTCHA, reduce spam, reduce fools :D )

COol...cisco rollout.

Very nice. Never seen it in production networks yet, thou !

Leave a Comment


Register to comment as a member. You'll look cooler.

Optional; will not be displayed publicly or given out.

No commercial links. Only personal (e.g. blog, Twitter, or LinkedIn) and/or on-topic links, please.
The term "bit" is short for _____ digit.