Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Feb 2000 10:14:14 +0000 (GMT)
From:      Cliff Rowley <dozprompt@onsea.com>
To:        Brian Free <bfree@sonici.com>
Cc:        "'freebsd-questions@freebsd.org'" <freebsd-questions@FreeBSD.ORG>
Subject:   Re: Second IP Address on Single NIC
Message-ID:  <Pine.BSF.4.21.0002081009090.583-100000@merlin.onsea.com>
In-Reply-To: <8FEAC4F0CAC9D111A88B006008A993C18ADDF3@slc1mail1.sonici.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi there :)

You need to:

(a) use netmask 0xffffffff

(b) place entries in rc.conf for your aliases.  rc.conf already has
functionality for you to do this.  For example, here is a segment of my
rc.conf:

# primary address
ifconfig_xl0="inet 10.0.0.2 netmask 0xffffff00"
# aliases
ifconfig_xl0_alias0="inet 10.0.0.10 netmask 0xffffffff"
ifconfig_xl0_alias1="inet 10.0.0.11 netmask 0xffffffff"
ifconfig_xl0_alias2="inet 10.0.0.12 netmask 0xffffffff"

Hope I helped some ;)

Cliff Rowley

- while (!asleep) { code(); }

On Mon, 7 Feb 2000, Brian Free wrote:

> I am trying to assign multiple IP addresses to a single NIC for virtual
> hosting on a FreeBSD 3.3 server.
> Here is the current output of ifconfig:
> bash-2.03# ifconfig ep0
> ep0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
>         inet 10.0.0.2 netmask 0xffffffe0 broadcast 10.0.0.1
>         ether 00:a0:27:06:ef:fe
>  
> The command I am trying to use is:
> ifconfig ep0 alias 10.0.0.3 netmask 255.255.255.224 up
> I have also tried entering the info into rc.conf, but after rebooting, the
> only address that worked was the second one.
>  
> The command returns:
> ifconfig: ioctl (SIOCAIFADDR): File exists
> Which I believe means that the interface already has an address, and not a
> problem.
>  
> After executing the command, ifconfig ep0 shows:
> bash-2.03# ifconfig ep0
> ep0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
>         inet 10.0.0.2 netmask 0xffffffe0 broadcast 10.0.0.1
>         inet 10.0.0.3 netmask 0xffffffe0 broadcast 10.0.0.1
>         ether 00:a0:27:06:ef:fe
>  
> So I assume it has take the second address, however it will not reply to a
> ping to the second address.  
> Any thoughts or suggestions would be appreciated.
> 
> Brian Free 
> IT Manager 
> SONIC innovations 
> Email: bfree@sonici.com 
> 
>  
> 



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0002081009090.583-100000>