setting up network virtual hosts (ifconfig)

Matthew Seaman m.seaman at infracaninophile.co.uk
Tue Mar 9 06:27:01 PST 2004


On Mon, Mar 08, 2004 at 04:50:47PM -0800, Jason Williams wrote:

> >e.g. something like this works fine here :
> >
> ># /etc/rc.local :
> >ifconfig fxp0 alias 192.168.2.222 netmask 0xffffffff
> 
> That seemed to have done the trick, manually. Im guessing, I could put the 
> same thing in my rc.conf file, but with proper syntax:
> 
> ifconfig_fxp0_alias0="inet 192.168.2.222 netmask 0xffffff

The proper syntax for the netmask on the second and subsequent
interface addresses from each distinct network block is to use the
all-ones netmask: you can express that either as 255.255.255.255 or as
0xffffffff or as /32, whichever suit you best. This is a FAQ on this
list but it still keeps tripping people up -- despite being clearly
documented in ifconfig(8):

     alias   Establish an additional network address for this interface.  This
             is sometimes useful when changing network numbers, and one wishes
             to accept packets addressed to the old interface.  If the address
             is on the same subnet as the first network address for this
             interface, a non-conflicting netmask must be given.  Usually
             0xffffffff is most appropriate.

However you look at it, 0xffffff could never be a correct netmask.

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20040309/e974a19c/attachment.bin


More information about the freebsd-questions mailing list