Using a /31 IP Address Space for Cloud Service Provider Peering
Can I use a 31-bit subnet mask address to establish a BGP peering session with a Cloud Service Provider?
The answer depends on two factors:
if your on-premise device is capable of supporting a configuration with a 31-bit subnet mask
if the Cloud Service Provider is capable of supporting a configuration with a 31-bit subnet mask.
On-premise device support
The most common network device operating system supports the use of a 31-bit subnet mask, with some older versions displaying a warning, such as:
```% Warning: use /31 mask on non point-to-point interface cautiously```
Cloud Service Provider support
The majority of Cloud Service Providers support the use of a 31-bit subnet mask, including AWS, Oracle, Alibaba, and IBM. Here are details provided by each CSP:
Oracle Cloud Infrastructure FastConnect
Quick reference: “For a private virtual circuit, you can specify a /30 or /31 network of your choice, and those IP addresses are assigned to the virtual circuit during the provisioning process. The IP addresses are used for BGP peer establishment. For a public virtual circuit, Oracle Cloud Infrastructure chooses the BGP IP addresses.”
IBM Direct Link
Quick reference: “Our staff at IBM Cloud assigns a /31 or /30 for each connection and configures an interface IP address on the IBM Cloud cross-connect router (XCR) infrastructure.”
AWS Direct Connect Quick reference: “For a private IPv4 VIF, Amazon will provide you a /31 CIDR. Note: you can use a /31 public CIDR for a Public IPv4 VIF.”
Alibaba Cloud Express Connect
You can use a /30 or /31 represented by the subnet mask.
Resource: Connecting to Alibaba Express Connect.
Microsoft Azure ExpressRoute
No support (or plans) for 31-bit subnet masks.
Google Partner Interconnect
Does not currently support the use of 31-bit subnet masks. The mask is fixed and assigned from a 169.254.0.0/16 pool.
Megaport Cloud Router
Supports the use of 31-bit subnet masks on VXCs connected to customer devices, as well as on CSP-facing VXCs where the CSP supports this mask length.
In December 2000, the Internet Engineering Task Force (IETF) released RFC 3021 for using 31-bit prefixes on IPv4 point-to-point links. The RFC investigates changes to the standards to preserve IP address space and reducing the amount of IP addresses assigned to point-to-point links by allowing the use of 31-bit subnet masks.
At that time, the current practice used a 30-bit subnet mask, which required four addresses per point-to-point link: one network address, two hosts addresses, and one broadcast address.
In a point-to-point link, where there can be only two possible identifying hosts and where any packet which is transmitted by one end of the link is always received by the other, using a mask defining four addresses could be seen as a waste in certain situations. This is why the RFC 3021 was developed. Using a 31-bit subnet mask, there are only two possible addresses: a network address and a broadcast address, but in a point-to-point link, these two must be interpreted as host addresses.
And currently, when a company creates a connection to a Cloud Service Provider, the standard practice uses a 30-bit subnet mask to set up BGP peering with the provider. So, with the IP shortage still a current issue, and with many organizations not having enough IP address space, organizations want to use a 31-bit subnet mask address for establishing a BGP peering session with a Cloud Service Provider.