Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 03 Mar 2004 16:35:51 +0000
From:      Holger Kipp <Holger.Kipp@alogis.com>
To:        p500.2004@openstandards.net
Cc:        freebsd-java@freebsd.org
Subject:   Re: Multiple static IPs
Message-ID:  <200403031635.i23GZub30704@alogis.com>

next in thread | raw e-mail | index | archive | help


Erik Sliman (p500.2004@openstandards.net) 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.

a) See /etc/defaults/rc.conf
b) Try "man ifconfig" -> alias
c) Use netmask of 255.255.255.255

For your example, try something like
ifconfig_vr0="inet 192.168.1.3 netmask 255.255.255.0"
ifconfig_vr0_alias0="inet 192.168.1.36 255.255.255.255"

d) To understand how this works, look at rc.network. The
   corresponding entry is

         eval ifconfig_args=\$ifconfig_${ifn}_alias${alias}
         if [ -n "${ifconfig_args}" ]; then
                 ifconfig ${ifn} ${ifconfig_args} alias
                 eval showstat_$ifn=1
                 alias=$((${alias} + 1))
         else
                 break;
         fi

And I think this is a faq anyway ;-)

Regards,
Holger



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200403031635.i23GZub30704>