Bug 22489

Summary: mass IP aliasing via ifconfig broken
Product: Base System Reporter: R Beasley <ryanb>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description R Beasley 2000-11-01 23:20:01 UTC

Fix: 

The only work around I know of is pacing the act of boundin the IPs.
ie: inserting a "sleep 1" in the above script, which then works fine.
(In our situation, that drives the boot time to over 10 minutes.)
How-To-Repeat: 
  1)    Get yourself a flat text file w/ a lot of addresses separated
	by newlines.

  2)	As root, execute the following lame-o script:

	#!/bin/sh
	for tmp in `cat <filename>`; do ifconfig <device_here> inet $tmp netmask 255.255.255.255 alias; done
	
  IPs will appear as being properly bound, yet are truely unusable to the
network outside of your machine.
Comment 1 Bill Swingle 2001-05-30 06:43:34 UTC
Why don't you just use the aliasing mechanisim that is built into
/etc/rc.network?

ifconfig_de0_alias0="inet 64.81.6.35 netmask 255.255.255.255"
ifconfig_de0_alias1="inet 64.81.6.36 netmask 255.255.255.255"
ifconfig_de0_alias2="inet 64.81.6.37 netmask 255.255.255.255"
ifconfig_de0_alias3="inet 64.81.6.38 netmask 255.255.255.255"
etc....

I'm not so sure this is a problem with FreeBSD since there is a
perfectly reasonable way to go about this that works.

-Bill

-- 
-=| --- Bill Swingle --- http://www.dub.net/
-=| unfurl@dub.net  - unfurl@freebsd.org 
-=|    Do Not Taunt Happy Fun Ball(tm)
Comment 2 R Beasley 2001-05-30 15:46:10 UTC
On Tue, May 29, 2001 at 10:43:34PM -0700, Bill Swingle wrote:
> Why don't you just use the aliasing mechanisim that is built into
> /etc/rc.network?
> 
> ifconfig_de0_alias0="inet 64.81.6.35 netmask 255.255.255.255"
> ifconfig_de0_alias1="inet 64.81.6.36 netmask 255.255.255.255"
> ifconfig_de0_alias2="inet 64.81.6.37 netmask 255.255.255.255"
> ifconfig_de0_alias3="inet 64.81.6.38 netmask 255.255.255.255"
> etc....

	The file controlling all of the addresses is an RCS'd flat text
	file with _just_ IPs listed under it.  The purpose is so that
	the "junior" types could run around and add/remove addresses to
	be bound to this machine.  I trust them much more w/ a flat text
	of IP<newline>IP<newline>etc than I would anyone mucking up
	rc.conf.  :)

> I'm not so sure this is a problem with FreeBSD since there is a
> perfectly reasonable way to go about this that works.

	Either way, the rc.network essentially does the same thing;
	ifconfig <blah1> alias, ifconfig <blah2> alias, etc.  The only
	difference is that I use a for/do/done loop whereas rc.network
	uses while/do/done.

	Anywho, if I run ifconfig and find all the addresses I bound
	listed there, but they're NOT responsive to external network
	traffic, I think that _is_ a FreeBSD problem.

	... but on another note, I completely forgot that this was still
	open.  ca-1 is running w/ a kernel from 12/19/2000 and I couldn't
	replicate the behavior anymore.  (woot.)  Guess it's time to
	close the PR. ;)

--
Ryan Beasley				<ryanb@enteract.com>
FreeBSD SysAdmin			http://www.enteract.com
Comment 3 Bill Swingle 2001-05-30 17:36:44 UTC
On Wed, May 30, 2001 at 09:46:10AM -0500, ryan beasley wrote:
> On Tue, May 29, 2001 at 10:43:34PM -0700, Bill Swingle wrote:
> > Why don't you just use the aliasing mechanisim that is built into
> > /etc/rc.network?
> > 
> > ifconfig_de0_alias0="inet 64.81.6.35 netmask 255.255.255.255"
> > ifconfig_de0_alias1="inet 64.81.6.36 netmask 255.255.255.255"
> > ifconfig_de0_alias2="inet 64.81.6.37 netmask 255.255.255.255"
> > ifconfig_de0_alias3="inet 64.81.6.38 netmask 255.255.255.255"
> > etc....
> 
> 	The file controlling all of the addresses is an RCS'd flat text
> 	file with _just_ IPs listed under it.  The purpose is so that
> 	the "junior" types could run around and add/remove addresses to
> 	be bound to this machine.  I trust them much more w/ a flat text
> 	of IP<newline>IP<newline>etc than I would anyone mucking up
> 	rc.conf.  :)

I can totally understand that.

> > I'm not so sure this is a problem with FreeBSD since there is a
> > perfectly reasonable way to go about this that works.
> 
> 	Either way, the rc.network essentially does the same thing;
> 	ifconfig <blah1> alias, ifconfig <blah2> alias, etc.  The only
> 	difference is that I use a for/do/done loop whereas rc.network
> 	uses while/do/done.

Have you tried while/do/done to see if it makes a difference? have you
tried using the rc.network method to see if this problem exist then?

> 
> 	Anywho, if I run ifconfig and find all the addresses I bound
> 	listed there, but they're NOT responsive to external network
> 	traffic, I think that _is_ a FreeBSD problem.

That's very true.

> 	... but on another note, I completely forgot that this was still
> 	open.  ca-1 is running w/ a kernel from 12/19/2000 and I couldn't
> 	replicate the behavior anymore.  (woot.)  Guess it's time to
> 	close the PR. ;)

Glad to hear it. :)

-Bill

> 
> -- 
> Ryan Beasley				<ryanb@enteract.com>
> FreeBSD SysAdmin			http://www.enteract.com

-- 
-=| --- Bill Swingle --- http://www.dub.net/
-=| unfurl@dub.net  - unfurl@freebsd.org 
-=|    Do Not Taunt Happy Fun Ball(tm)
Comment 4 Peter Pentchev freebsd_committer freebsd_triage 2001-07-06 09:48:27 UTC
State Changed
From-To: open->closed

Submitter reports the problem has gone away.