[lug] Binding multiple IPs to one NIC

Brad Doctor bdoctor at mancala.com
Wed Dec 15 13:11:02 MST 1999


Or, you could just copy /etc/sysconfig/network-scripts/ifcfg-eth0
to
/etc/sysconfig/network-scripts/ifcfg-eth0:1
/etc/sysconfig/network-scripts/ifcfg-eth0:2
/etc/sysconfig/network-scripts/ifcfg-eth0:3
/etc/sysconfig/network-scripts/ifcfg-eth0:4

Make sure you change the DEVICE entry, and you should be all set.
And, you will need to specify the correct information within the file, which
should be self-explanatory.

If it is eth1, change eth0 to reflect, of course.
The kernel will do the network routes for you, so no need to specify.

-brad

> 
> On Wed, Dec 15, 1999 at 03:00:21PM -0700, Chris M wrote:
> > Turn on aliasing in the kernel if not already.  Then something like:
> > 
> > #older kernels
> > #/sbin/insmod    /lib/modules/2.0.31/ipv4/ip_alias.o
> > #
> > # setup the loopback, eth0 and the IP's
> > #
> > echo "Using ifconfig to setup the IP addresses for Virtual Hosts..."
> > /sbin/ifconfig lo 127.0.0.1
> > /sbin/ifconfig eth0 up
> > /sbin/ifconfig eth0 your.main.IP
> > 
> > /sbin/ifconfig eth0:154 your.other.IP
> > 
> > /sbin/route add -host your.gateway.IP dev eth0
> > 
> > /sbin/route add -host your.other.IP dev eth0:154
> > 
> > 
> > Please kids, enjoy this in moderation.
> > 
> > Happy holidays!
> > Chris
> > Peak to Peak Internet
> 
> Excellent.  Bonus question: any idea what this looks like in linuxconf?
> 
> -Andrew
> 
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> 





More information about the LUG mailing list