On Fri, Mar 22, 2002 at 09:50:53AM -0500, Backend Chan wrote:
> 
> In the newest 4-stable kernel whose source codes are synchronized by cvsup,
> it would fail if trying to add an alias address whose network and netmask
> are the same as the orignal one on that network interface:
> 
> # uname -a
> FreeBSD intra.example.com 4.5-STABLE FreeBSD 4.5-STABLE #5: Fri Mar 22
> 13:45:41 CST 2002    [EMAIL PROTECTED]:/usr/src/sys/compile/SERVER i386
> # ifconfig xl0 inet 192.168.1.100 netmask 0xffffff00
> # ifconfig xl0 inet 192.168.1.101 netmask 0xffffff00 alias
> ifconfig: ioctl (SIOCDIFADDR): File exists
> 
> But it worked for 4.4-Release (I'd tested):
> 
> #uname -a
> FreeBSD bsd.example.com 4.4-RELEASE FreeBSD 4.4-RELEASE # 17: Fri Mar 22
> 12:09:36 CST 2002    [EMAIL PROTECTED]:/usr/src/sys/compile/SERVER i386
> # ifconfig xl0 inet 192.168.1.100 netmask 0xffffff00
> # ifconfig xl0 inet 192.168.1.101 netmask 0xffffff00 alias
> # ifconfig xl0
> xl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
[snip]
>         inet 192.168.1.100 netmask 0xffffff00 broadcast 192.168.1.255
>         inet6 fe80::201:2ff:fe80:2a8b%xl0 prefixlen 64 scopeid 0x2 
>         inet 192.168.1.101 netmask 0xffffff00 broadcast 255.255.255.0
> 
> Below is a workground patch:
[snip patch]
> 
> Should it be done so?

Not really.

The ifconfig(8) manual page has documented this since.. well, for a LONG time:

  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 netmask of 0xffffffff has to be specified.

This is also covered in the FreeBSD FAQ, chapter 12 - "Networking",
question 12.2 - "How do I set up Ethernet aliases?".

The correct setup is to use a netmask of 0xffffffff (255.255.255.255)
for the alias.

G'luck,
Peter

-- 
Peter Pentchev  [EMAIL PROTECTED]        [EMAIL PROTECTED]
PGP key:        http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
This would easier understand fewer had omitted.

Attachment: msg33046/pgp00000.pgp
Description: PGP signature

Reply via email to