Jan
31
Imagine a task on the CCIE RS Lab that reads something like this: “Create a new loopback on RX, this would be a point-to-point link, ensure that the loopback uses the ip address 150.150.0.1 with minimal waste of IP addresses”
What would be your first reaction? Probably use a /30 network mask, but this would be wrong since the optimal solution would be to use a /31 network mask. With a /30 network mask we would have four IP addresses: two for hosts, one all-zeros for the network and one all-ones for the broadcast, while with a /31 network mask we only have two: one all-zeros and one all-ones.
/31 network masks were implemented on the RFC 3021 (Using 31-Bit Prefixes on IPv4 Point-to-Point Links), Cisco added the feature on 12.2(2)T. The idea of /31 masks is that their use will reduce the address space used on point-to-point links by 50%, assuming of course you are currently using /30s.
Especially useful for those resisting the #IPocalypse.
So, let’s lab it up, this will be our topology:

We are using 192.168.0.0/31 and 192.168.0.2/31 to interconnect the devices.
Since I am using FastEthernet interfaces for the interconnection between routers, not the typical point-to-point interface, the IOS produces a warning (everything works OK regardless):
R2(config)#int fa0/0
R2(config-if)#ip address 192.168.0.1 255.255.255.254
% Warning: use /31 mask on non point-to-point interface cautiously
R2(config)#int fa0/1
R2(config-if)#ip address 192.168.0.2 255.255.255.254
% Warning: use /31 mask on non point-to-point interface cautiously
After all is said and done, including static routes on R1 and R3 pointing to R2, everything works normally. We can see that the routing table of R2 shows what would have been in the past a single /30, used as two /31 to interconnect R1-R2 and R2-R3:
R2#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
192.168.0.0/31 is subnetted, 2 subnets
C 192.168.0.0 is directly connected, FastEthernet0/0
C 192.168.0.2 is directly connected, FastEthernet0/1
A traceroute from R1 to R2 Fa0/1:
R1#traceroute 192.168.0.2
Type escape sequence to abort.
Tracing the route to 192.168.0.2
1 192.168.0.1 4 msec * 4 msec
More info
Using 31-Bit Prefixes on IPv4 Point-to-Point Links
RouterGods – Configuring a /31 mask on Cisco Routers
Using /31 subnets on point-to-point links
Cisco RFC 3021

The RFC 3021: How to reduce by 50% your IPv4 usage on P2P links by CCIE Blog, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.



