Bug 68559

Summary: Cannot create alias IP address
Product: Base System Reporter: Oleg Kepp <hostmaster>
Component: i386Assignee: freebsd-i386 (Nobody) <i386>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description Oleg Kepp 2004-07-01 15:30:23 UTC
Command:
ifconfig xl0 inet 192.168.2.4 netmask 255.255.255.0 alias
Shows the following output:
ifconfig: ioctl (SIOCAIFADDR): File exists

rc.conf parameter

ifconfig_xl0_alias0="inet 192.168.2.4 netmask 255.255.255.0"

has no effect as well.
In the same time, IP aliases are working well on FreeBSD 4.4-RELEASE.

Could you help me to set up additional IP addresses for my network interface?

How-To-Repeat: No special actions should be taken; the system has been installed by default with GENERIC kernel.
The problem appears when I tried all available network interfaces:
xl0  3Com 905B-TX adapter;
ep0  3Com 509 ISA adapter;
fxp0 Intel 82559 PRO/100 adapter.
Comment 1 Dag-Erling Smørgrav 2004-07-01 16:13:51 UTC
Oleg Kepp <hostmaster@netgrs.co.ru> writes:
> ifconfig xl0 inet 192.168.2.4 netmask 255.255.255.0 alias
> Shows the following output:
> ifconfig: ioctl (SIOCAIFADDR): File exists

This is a FAQ: if xl0 already has an address on the 192.168.2.0/24
subnet, you need to use an all-bits-one netmask (255.255.255.255) for
the alias.

DES
--=20
Dag-Erling Sm=F8rgrav - des@des.no
Comment 2 Simon L. B. Nielsen freebsd_committer freebsd_triage 2004-07-01 16:21:43 UTC
State Changed
From-To: open->closed

Close the PR since this is a configuration error: 

From 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. 

In short, change netmask 255.255.255.0 to netmask 255.255.255.255.  It 
is better to use the freebsd-questions mailing list for these kind of 
configuration problems.