[K12OSN] eth alias help

Steve Wright paua at quicksilver.net.nz
Thu Feb 26 15:18:01 UTC 2004


On Fri, 2004-02-27 at 09:04, Caleb Wagnon wrote:
> Steve Wright said:
> > Yes, you can, but it is the old way to do it.
> >
> > Simply add both addresses to the interface.  The interface will
> > establish itself as usual, and then add the secondary IP address
> > directly, thusly ;
> >
> >
> > # ip address add 192.168.n.254/24 dev eth0
> >
> > and it is done!  You may add as many scopes (subnets) as you like to one
> > interface, and then offer a range of different services on each
> > interface - just like they were separate physical networks.  The
> > networks will be invisible to each other (sort of.)
> 
> Huh? That's not the old way I know =)
> 
> What do I do to my startup scripts? Or do I just type that command and all is
> well forever and ever? =)


off the top of my head ;

You will need an additional startup script.  iproute2 is not implemented
well in userspace just yet - the tools are there, but not the supporting
scripting.  Add a script in /etc/init.d and ln -s to it from somewhere
as early as possible, but after your main networking has started.

Take care that swapping runlevels back and forth will not load and
re-load this script repeatedly, or bad things will happen.. baaad
things, man.

/etc/init.d/iproute2

#!/bin/bash
# chkconfig: 
# description: load our iproute2 stuff

ip address add 192.168.n.254/24 dev eth0

# done


I expect at this point you may simply hand-run /etc/init.d/iproute2
and restart your services and you should on-the-air!  ;-)



Enjoy!  networking rocks!
/steve






More information about the K12OSN mailing list