Creating multiple static IPs

Kevin D. Kinsey, DaleCo, S.P. kdk at daleco.biz
Wed Mar 3 08:42:33 PST 2004


Erik Sliman wrote:

> How do you give a computer multiple static IPs?
>
> I've tried many things, including the ifaliases setting in rc.conf:
>
>    ifconfig_vr0="inet 192.168.1.3 netmask 255.255.255.0"
>    ifaliases_vr0="192.168.1.36 255.255.255.0"
>
> but none seem to work. _______________________________________________
>

Obligatory comment:  is that a question?  You have
heard about "freebsd-questions at freebsd.org" ....

Now that I've covered my communal 'tail':

Don't you mean "How do you give an interface
multiple static IPs?"  I mean, you could just install
two NICS .... :-)

The correct syntax is in the handbook, section 6.9, but
you're very close....

Also, note 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.

So you may need to compute another netmask for
the alias address.

HTH,

Kevin Kinsey
DaleCo, S.P.


More information about the freebsd-newbies mailing list