cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
281916
Views
112
Helpful
23
Replies

when and why we use /31 subnet

mahesh18
Level 6
Level 6

Hi all,

i know about /30 subnet we use when we have to use point to point network.

/30 we use when we need only 2 hosts on either end of network.

cansomeone tell me why and when we use /31 subnet mask.

thanks

mahesh

3 Accepted Solutions

Accepted Solutions

Hi Mahesh,

My understanding is that since a point to point doesn't really need a  broadcast address, instead of using a /30 which is 4 addresses, you can  use a /31 and use 2 address and it works. I havenot really tried it but it works.

Cheers,

-amit singh

View solution in original post

Hi,

Using a /31 subnet mask helps conserve your IP address space for point to point links. It doubles the number of links that you can number from a given block of addresses. Think of large organisations that have hundreds of WAN links but are rapidly running out of address space.

This is especially useful if you have paid for a block of public addresses from your ISP and so you want to use as many of them as possible.

Not only can a /31 subnet be used on serial interfaces but it can also be assigned to ethernet interfaces:

http://packetlife.net/blog/2008/jun/18/using-31-bit-subnets-on-point-point-links/

View solution in original post

I have never tried using a /31 but I can say that the 2 address you have configured 192.168.5.2 and 192.158.5.1 are different segments if you use a /31 mask (255.255.255.254)

what happens if you use .2 and .3? (may require you to change some static routes)

View solution in original post

23 Replies 23

Hi amit,

thanks for reply.

so my understanding was we use /30 for point to point  links.

what is difference between /30  /31  then?

mahesh

Hi Mahesh,

My understanding is that since a point to point doesn't really need a  broadcast address, instead of using a /30 which is 4 addresses, you can  use a /31 and use 2 address and it works. I havenot really tried it but it works.

Cheers,

-amit singh

Hi,

Using a /31 subnet mask helps conserve your IP address space for point to point links. It doubles the number of links that you can number from a given block of addresses. Think of large organisations that have hundreds of WAN links but are rapidly running out of address space.

This is especially useful if you have paid for a block of public addresses from your ISP and so you want to use as many of them as possible.

Not only can a /31 subnet be used on serial interfaces but it can also be assigned to ethernet interfaces:

http://packetlife.net/blog/2008/jun/18/using-31-bit-subnets-on-point-point-links/

Many thanks to amit and sean too.

mahesh

Hi Amit,

i tried to use  /31  on my network but it did  not work.

my router has direct connection to layer 3 switch.

router connects to isp cable modem.

layer 3 config

interface FastEthernet0/11
description Lan connection to 2650XM Router
no switchport
ip address 192.168.5.2 255.255.255.252
spanning-tree portfast

router config to layer 3 switch

sh run int fa1/0
Building configuration...

Current configuration : 183 bytes
!
interface FastEthernet1/0
description Lan connection to Switch 3550SMIA
ip address 192.168.5.1 255.255.255.252

i change the mask to 255.255.255.254 and it did  not work?

mahesh

I have never tried using a /31 but I can say that the 2 address you have configured 192.168.5.2 and 192.158.5.1 are different segments if you use a /31 mask (255.255.255.254)

what happens if you use .2 and .3? (may require you to change some static routes)

Hi,

Many thanks i used IP address 192.168.5.2 and .3  and it worked.

regards

mahesh

In that range the .0 and .1 are in the same /31 using a .0 seems crazy but since you don't have a network and broadcast address that is how it works. 

Correct, think of your subnet training.  /31 leave two IPs together, 0 and 1 are both in the same "network". (don't need the quotes, it's true, just no broadcast and network add needed as stated. It is similar to using the .0 address in a full /23.  Seems totally odd, but is still an address and yet not, in this subnet, the network address.  

Correct, think of your subnet training.  /31 leave two IPs together, 0 and 1 are both in the same "network". (don't need the quotes, it's true, just no broadcast and network add needed as stated. It is similar to using the .0 address in a full /23.  Seems totally odd, but is still an address and yet not, in this subnet, the network address.


@Ben Rodriguez wrote:

In that range the .0 and .1 are in the same /31 using a .0 seems crazy but since you don't have a network and broadcast address that is how it works. 


Using 0 as an address only seems crazy if your thinking about /24 or smaller address space (/31 & /32 aside) if you work with /23 or bigger address apace 0 becomes an entirely valid and normal address to use as the Subnet Boundaries beging with /23 will span multiple octets so if you left 0 out you would be wasting a lot of addresses very quickly  

Hi Denis,

I believe the first rule to create Point-to-Point link is that we need to configure IP address from the same sub net that opposite end interface is configured with.

My apologies! I should have kept reading the reply's!

 

The enterprise business I work for has been using /30 for almost all point to point connections. Wait til they see this!

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Innovations in Cisco Full Stack Observability - A new webinar from Cisco