Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Jan 2000 10:09:17 -0800 (PST)
From:      "Rodney W. Grimes" <freebsd@gndrsh.dnsmgr.net>
To:        mylists@inr.net (N.B. DelMore)
Cc:        freebsd-stable@FreeBSD.ORG
Subject:   Re: Multiple IP addresses
Message-ID:  <200001241809.KAA68669@gndrsh.dnsmgr.net>
In-Reply-To: <3.0.6.32.20000124043423.009ac550@mail.inr.net> from "N.B. DelMore" at "Jan 24, 2000 04:34:23 am"

next in thread | previous in thread | raw e-mail | index | archive | help
[This is not a -stable question but more of a -question question and
should have been sent to that list]

> Just a couple of questions concerning multiple IP's.   In searching through
> the archives I've seen references to binding the addresses to the NIC as
> well as the loopback, which is the proper method?

Depends on who you ask.  Seriously though, both methods are valid, each
having slightly different behavior and advantages/disadvantages so thier
is no black and white one is proper and the other is wrong. 

Bind to NIC:
   a)  You don't have to screw with routing at all if the IP's are already
       on that network segment, and usually just a single route at the
       gateway if they are not.

   b)  Arp storms can become a problem here, it gives more IP addresses
       that respond to arp's.  Arps are not well filtered at most locations.

Bind to lo0:
   a)  You don't fill up other routers arp tables.  1000+ entry arp tables
       are not fun to look at and not fun for the router to search :-)

   b)  You can easily move a virtual from one machine to another without
       seeing a pile of ``so and so has moved from MAX X to MAX Y.

   c)  Routing protocols can be used to dynamically manage the ip space
       in a VLSM manner or on a host based manner.

> 
> The scenario I have setup is as follows, the server (xl0) has been assigned
> the IP address of yyy.yyy.yyy.8 and the I route an entire Class C to that
> interface in the router, e.g.
> ip route xxx.xxx.xxx.0 255.255.255.0 yyy.yyy.yyy.8
> 
> I then added an entry in /etc/rc.local to run the following shell script:
> 
> #!/bin/sh
> 
> /sbin/ifconfig lo0 xxx.xxx.xxx.0 netmask 0xffffff00 alias
Illegal use of host 0 on a network, surprized that something didn't
gripe about this.

> /sbin/ifconfig lo0 xxx.xxx.xxx.1 netmask 0xffffffff alias

Netmask on this should be changed to 0xffffff00 if you want a /24
route created, otherwise having them all 0xffffffff is fine, and
infact our prefered method here so we don't have to fool with the .1
if we should move things around on servers.

> /sbin/ifconfig lo0 xxx.xxx>xxx.2 netmask 0xffffffff alias
> 
> through
> 
> /sbin/ifconfig lo0 198.77.215.255 netmask 0xffffffff alias
Illegal use of a broadcast address, again surprized that something didn't
grip about this.  

> 
> To recap, my questions are, which interface should be used to bind the ip's
> to

Depends on who you ask :-)  If you ask me only lo0 is the _correct_
thing to do.  Though I manage sites that have them bound to the nic
I really hate it.

> and is it acceptable to bind .0 and .255 to the interface although by
> convention they shouldn't be used for anything.

No, and don't try and use them even if the bind did work, your going
to get strange side effects.


-- 
Rod Grimes - KD7CAX @ CN85sl - (RWG25)               rgrimes@gndrsh.dnsmgr.net


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




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