# Subnet mask 255.255.255.255

## xtz

Just curious, cause I have never tested it. Yes, I have used IP aliases with this mask, but never tried to set up networking, using this mask, so I just wonder if it is possible. The most simple configuration, ex:

2 computers network, gateway, node A and node B:

GW - 1.1.1.1

A - 1.1.1.2

B - 1.1.1.3

If A & B got subnet mask /24 for example, that means they are in the same subnet, and traffic from one to another will pass directly, without going through the gateway. However, if using /32 for a subnet mask, I think they would not be able to see the gateway aswell. Is it possible to get connectivity with this subnet mask (using only these addresses)?

----------

## d2_racing

I don't think that a 255.255.255.255 mask is possible.

----------

## xtz

Okay, I will give u an example:

```

center ~ # ip a s dev eth0

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc htb state UP qlen 1000

    link/ether 00:0e:0c:c4:18:7c brd ff:ff:ff:ff:ff:ff

    inet 83.228.79.1/24 brd 83.228.79.255 scope global eth0

    inet 83.228.83.1/24 brd 83.228.83.255 scope global eth0

    inet 10.1.1.250/24 brd 10.1.1.255 scope global eth0

```

Now, we add 10.2.2.2/32:

```

center ~ # ip a a 10.2.2.2/32 dev eth0

center ~ # ip a s dev eth0

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc htb state UP qlen 1000

    link/ether 00:0e:0c:c4:18:7c brd ff:ff:ff:ff:ff:ff

    inet 83.228.79.1/24 brd 83.228.79.255 scope global eth0

    inet 83.228.83.1/24 brd 83.228.83.255 scope global eth0

    inet 10.1.1.250/24 brd 10.1.1.255 scope global eth0

    inet 10.2.2.2/32 scope global eth0

```

There is no broadcast, because it is not needed... the only address in the "subnet" is this one... same with subnet address, not needed, cause there is no subnet, it's only this address. So?

----------

## depontius

I'm not sure, but I believe the endpoints in a ppp link might be set up with such subnet masks, but I'm not even sure about that.  I know that for my OpenVPN sessions I set up with 255.255.255.248 subnet masks, just for simplicity and because I know it'll work without having to debug oddities.

----------

## think4urs11

In theory it shouldn't be possible to get connections to anywhere with a /32 netmask. In real live this can depend on the actual implementation.

PPP doesn't handle netmasks at all thats why this 'faked' netmask is used.

----------

## ianw1974

A /32 bit subnet mask is possible, but it's just one single address.

If you want to restrict number of IP's available, and of course a /24 bit subnet mask gives 254 addresses with the 255 being the broadcast and is probably too many available for a home network even if you don't use the complete range.  You could effectively use a subnet mask of /29 or 255.255.255.248 if you want to restrict the number of available addresses and have 6 free IP addresses with the seventh being the broadcast.  So 10.2.2.1 to 10.2.2.6 usable with the broadcast 10.2.2.7.

Have a play with this to generate your requirements: http://www.subnet-calculator.com/subnet.php?net_class=A

----------

## xtz

ianw1974, thanks, I know how to calculate my subnets  :Cool:  My question was, if it was possible to have an actual connection with a /32 subnet mask, since even the gateway won't be on my subnet (which consists of only myself  :Razz: ). If I use an IP alias for an already configured adapter on a working machine, of course this address is accessible and working, but this is because the machine already has a correctly set-up routing table, using the other addresses. So, I guess it only makes sense, if these addresses are used for standalone configurations and/or IP aliases?

----------

## papahuhn

 *xtz wrote:*   

> My question was, if it was possible to have an actual connection with a /32 subnet mask, since even the gateway won't be on my subnet (which consists of only myself ).

 

You can have that mask, but then you need to setup a host-route to any device in your switched environment.

In your case for A:

```

ifconfig eth0 1.1.1.2 netmask 255.255.255.255 broadcast 66.66.66.66

route add -host 1.1.1.1 dev eth0

route add -host 1.1.1.3 dev eth0

route add default gw 1.1.1.1
```

The broadcast won't matter.

Edit: I lied, you can also have a simple network route.

----------

## xtz

Thanks, this seems to make sence. Can you confirm it actually works, or it should work in theory?

----------

## papahuhn

It works.

----------

## xtz

 *papahuhn wrote:*   

> ...
> 
> Edit: I lied, you can also have a simple network route.

 

I've missed the edit part.

What do u mean?

----------

