Virtual Interfaces and Subnet Masks

John Brooks john at
Fri Jun 24 13:01:02 GMT 2005

it's my understanding that when you add an alias to an interface
AND that alias is within the same network as the main address on
the interface that it should be set with a /32 bit netmask.

for example:

ifconfig_fxp0="inet netmask"
ifconfig_fxp0_alias0="inet netmask"

IF the address is in a DIFFERENT network then the netmask
should reflect that network.

ifconfig_fxp0_alias1="inet netmask"


(ps - make sure your alias numbering is numerically sequential
without gaps)

John Brooks
john at 

> -----Original Message-----
> From: owner-freebsd-questions at
> [mailto:owner-freebsd-questions at]On Behalf Of Martin
> McCormick
> Sent: Friday, June 24, 2005 6:34 AM
> To: freebsd-questions at
> Subject: Re: Virtual Interfaces and Subnet Masks 
> "Daniel Marsh" writes:
> >Why don't you just setup an IP alias for the fxp0 interface?
> >
> >ie:
> >ifconfig_fxp0_alias0="inet"
> 	Thank you.  that both validates some of what I did, but raises
> new questions.  Originally, I tried to bring up a second Ethernet card
> which is on the system in question and which I thought we would use if
> we ever had to.  This had worked once before when the dead system we
> were replacing was on a different network and I just assumed it would
> work on the same network.  Big mistake!
> 	After discovering the hard way about conflicting instances of
> the same subnetmask and getting a bit nervous because we were still
> down on the interface we needed most, I tried bringing up fxp1 as
> follows:
> ifconfig fxp1
> This worked, but I soon realized that ifconfig gave it a default mask of
> which is wrong for that network.
> 	I then tried the alias for fxp0 exactly as you indicated and
> got it but the packets going out still had a mask.  I
> ended up, somehow, with that bad mask on both the primary interface
> and the alias after trying to start over with ifconfig.
> if config -alias
> ifconfig fxp0 inet netmask
> ifconfig fxp0 alias
> I thought of bringing fxp0 down first but was doing all of this
> remotely from home and was concerned that I'd loose the system
> completely and it would be some minutes before one of us could
> physically go there and take control.
> 	We or at least I don't do this very thing nearly often enough
> because things under FreeBSD and Linux just don't break that often and
> it is difficult to duplicate every possible permutation of trouble
> meaning that sometimes, one gets nasty surprises.
> 	While not laughing at what happened too hard, can you think of
> how I ended up with the bad mask that wouldn't go away?  Many thanks.
> Martin McCormick WB5AGZ  Stillwater, OK 
> OSU Information Technology Division Network Operations Group
> _______________________________________________
> freebsd-questions at mailing list
> To unsubscribe, send any mail to 
> "freebsd-questions-unsubscribe at"

More information about the freebsd-questions mailing list