Stupid question of the day: Ethernet IP aliases on startup

John L Grantham jgrantha at
Wed Sep 22 07:04:13 EST 1999

Hi all,

My stupid question of the day, on a similar vein to some other questions 
recently: I'm trying to set up my Linux box (PowerMac G3 MT/266, LinuxPPC 
1999 crossed with YDL 1.1) to start up Ethernet IP aliases each time the 
computer boots. First attempt was using netcfg, which set up the aliases 
okay, and in each case the files for eth0:0 through eth0:7 in 
/etc/sysconfig/ says ONBOOT=YES, but the aliases don't start on boot. So 
I wrote a shell script to do so, and the script works if I call it 
(though it complains that the files already exist, but it does start the 
ports); the script I wrote is in /etc/sysconfig/network-scripts/, with a 
symbolic link pointing to it from /etc/rc.d/init.d/. But no dice--on 
startup, nothing doing, and I have to call the script myself.

What I'm looking to do is bind a specific IP address to an Ethernet 
alias. Then, each IP gets a domain name in my isolated LAN, and also each 
IP is used for a virtual server for HTTP. So long as I run the script, 
everything works. The script looks like this:

# John's attempt at a script to start up Ethernet IP aliases
# /etc/sysconfig/network-scripts/ipaliases

# First set up IPs
/sbin/ifconfig lo
/sbin/ifconfig eth0 up
/sbin/ifconfig eth0
/sbin/ifconfig eth0:0
/sbin/ifconfig eth0:1
/sbin/ifconfig eth0:2
/sbin/ifconfig eth0:3
/sbin/ifconfig eth0:4
/sbin/ifconfig eth0:5
/sbin/ifconfig eth0:6
/sbin/ifconfig eth0:7

# Now set up routing and loopback
/sbin/route add -net 
/sbin/route add -net dev eth0
/sbin/route add -host dev eth0
/sbin/route add -host dev eth0:0
/sbin/route add -host dev eth0:1
/sbin/route add -host dev eth0:2
/sbin/route add -host dev eth0:3
/sbin/route add -host dev eth0:4
/sbin/route add -host dev eth0:5
/sbin/route add -host dev eth0:6
/sbin/route add -host dev eth0:7
/sbin/route add default gw

# End script

Any ideas, O great sirs and madams?




John Grantham | Freelance Graphic and Web Designer
              | Dipl.-Designer (FH)
              | Homepage:
              | MacLinux:

** Sent via the linuxppc-dev mail list. See

More information about the Linuxppc-dev mailing list