The proper netmask for an alias IP address

aliasipnetmask

I did a lot of searching, but there seems to be conflicting info on what the proper netmask for an aliased IP address should be. Some of the conflicting info seems to be FreeBSD-specific. I'm looking for the "most technically proper" answer, if there is one.

I've been assigned x.x.x.168/29.

Here is eth0:

address x.x.x.170
netmask 255.255.255.248
gateway x.x.x.169

So the proper eth0:0 netmask should be 255.255.255.something.

EDIT: Per the comment from Chris S, I am not using FreeBSD; I am using Debian. My understanding is that FreeBSD users should use .255 for aliases. But I could be wrong, so you should do your own research.

Best Answer

Your eth0:0 subnet mask should be 255.255.255.248, unless you have some reason that you do not want eth0:0 to communicate directly with the rest of the hosts in the subnet. If you make it smaller, you will need a router to allow that IP to communicate with the rest of the network.