linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Stupid question of the day: Ethernet IP aliases on startup
@ 1999-09-21 21:04 John L Grantham
  1999-09-22 19:12 ` Michel Lanners
  0 siblings, 1 reply; 2+ messages in thread
From: John L Grantham @ 1999-09-21 21:04 UTC (permalink / raw)
  To: linuxppc-dev


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:

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

# First set up IPs
/sbin/ifconfig lo 127.0.0.1
/sbin/ifconfig eth0 up
/sbin/ifconfig eth0 192.168.1.1
/sbin/ifconfig eth0:0 192.168.1.10
/sbin/ifconfig eth0:1 192.168.1.11
/sbin/ifconfig eth0:2 192.168.1.12
/sbin/ifconfig eth0:3 192.168.1.13
/sbin/ifconfig eth0:4 192.168.1.14
/sbin/ifconfig eth0:5 192.168.1.15
/sbin/ifconfig eth0:6 192.168.1.16
/sbin/ifconfig eth0:7 192.168.1.17

# Now set up routing and loopback
/sbin/route add -net 127.0.0.0 
/sbin/route add -net 192.168.1.0 dev eth0
/sbin/route add -host 192.168.1.1 dev eth0
/sbin/route add -host 192.168.1.10 dev eth0:0
/sbin/route add -host 192.168.1.11 dev eth0:1
/sbin/route add -host 192.168.1.12 dev eth0:2
/sbin/route add -host 192.168.1.13 dev eth0:3
/sbin/route add -host 192.168.1.14 dev eth0:4
/sbin/route add -host 192.168.1.15 dev eth0:5
/sbin/route add -host 192.168.1.16 dev eth0:6
/sbin/route add -host 192.168.1.17 dev eth0:7
/sbin/route add default gw 192.168.1.200

# End script

Any ideas, O great sirs and madams?

cya

John

---

John Grantham | Freelance Graphic and Web Designer
              | Dipl.-Designer (FH)
              | Homepage: http://surf.to/multimedia
              | MacLinux: http://www.maclinux.de/


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Stupid question of the day: Ethernet IP aliases on startup
  1999-09-21 21:04 Stupid question of the day: Ethernet IP aliases on startup John L Grantham
@ 1999-09-22 19:12 ` Michel Lanners
  0 siblings, 0 replies; 2+ messages in thread
From: Michel Lanners @ 1999-09-22 19:12 UTC (permalink / raw)
  To: jgrantha; +Cc: linuxppc-dev


On  21 Sep, this message from John L Grantham echoed through cyberspace:
> 
> 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 you need is a symbolic link from one (or more) of the directories
/etc/rc.d/rcx.d, called Syy.netscripts, pointing to your script.

The key is that only scripts in those directories are executed, if and
only if the runlevel no. x is entered. Scripts named Syy.something are
 called with the argument 'start', those named Kyy.something are called
with 'stop'. In any case, yy is a number that defines the order in which
the scripts are executed.

The standard runlevels are 3 (regular console) or 5 (with X, usually
through xdm).

Michel

-------------------------------------------------------------------------
Michel Lanners                 |  " Read Philosophy.  Study Art.
23, Rue Paul Henkes            |    Ask Questions.  Make Mistakes.
L-1710 Luxembourg              |
email   mlan@cpu.lu            |
http://www.cpu.lu/~mlan        |                     Learn Always. "


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-09-22 19:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-09-21 21:04 Stupid question of the day: Ethernet IP aliases on startup John L Grantham
1999-09-22 19:12 ` Michel Lanners

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).