View Full Version : Howto Configure Extra IPs (on any distribution)
ben_myles
07-14-2005, 03:43 PM
Create a script like the one below and have your system run it upon startup - I use Slackware and call the script from rc.local.
#!/bin/bash
#setting up IP alias interfaces
echo "Setting IP Aliases ..."
/sbin/ifconfig eth0:0 xxx.xxx.xxx.xxx
/sbin/ifconfig eth0:1 xxx.xxx.xxx.xxx
/sbin/ifconfig eth0:2 xxx.xxx.xxx.xxx
/sbin/ifconfig eth0:3 xxx.xxx.xxx.xxx
/sbin/ifconfig eth0:4 xxx.xxx.xxx.xxx
#setting up the routes
echo "Setting IP routes ..."
/sbin/route add -host xxx.xxx.xxx.xxx eth0:0
/sbin/route add -host xxx.xxx.xxx.xxx eth0:1
/sbin/route add -host xxx.xxx.xxx.xxx eth0:2
/sbin/route add -host xxx.xxx.xxx.xxx eth0:3
/sbin/route add -host xxx.xxx.xxx.xxx eth0:4
milegrin
02-03-2006, 07:58 AM
Greetings
I have tried this solution and the one suggested under the debian OS section (http://www.unixshell.com/forum/showthread.php?t=371) to no avail.
Anyone have additional IP's setup on their debian system that would be prepared to share their configs and setup? What I have should be working but it is not and I am wits end.
Here is a copy of my /etc/network/interfaces file (eth0 is default as per the Xen debian initial setup):
<Quote>
auto lo eth0 eth0:0
iface lo inet loopback
iface eth0 inet static
address 65.254.45.228
netmask 255.255.255.255
broadcast 0.0.0.0
up ip route replace 169.254.1.1 dev eth0
up ip route add default via 169.254.1.1
iface eth0:0 inet static
address 65.254.45.225
netmask 255.255.255.255
</Quote>
Am I missing summin? :confused: Any assistance would be appreciated
Regards
Michael
stu42j
03-01-2006, 09:27 PM
Instead of the eth0:0 alias, I would just use the 'ip address add' command. Something like:
iface eth0 inet static
address 65.254.45.228
netmask 255.255.255.255
broadcast 0.0.0.0
up ip address add 65.254.45.999 dev eth0
wibleh
03-08-2006, 12:23 PM
Hi all, does anyone have an elegant/working method to do this on fedora (core 4)?
matta
03-08-2006, 02:42 PM
Just create ifcfg-eth0:X files. You can then even "ifup eth0:X" (or restart network init script or reboot).
Example alias config file for /etc/sysconfig/network-scripts/ifcfg-eth0:0
DEVICE=eth0:0
ONBOOT=yes
BOOTPROTO=static
IPADDR=xxx.xxx.xxx.xxx
NETMASK=255.255.255.255
wibleh
03-09-2006, 05:36 PM
Thanks for the help, think it was me being dumb as usual.
Speaking of which...
although i've set the broadcast to 0.0.0.0 it comes back as the IP address of the 'virtual' card. Is this normal for this type of configuration?
vBulletin v3.0.6, Copyright ©2000-2009, Jelsoft Enterprises Ltd.