Donncha writes:
> This is what I did to get two IPs on one interface. There's a mini howto
> on the subject (IP_Alias I think)
>> /sbin/ifconfig eth0:0 192.168.0.35
> /sbin/route add -host 192.168.0.35 dev eth0:0
Under kernel 2.2, you don't need to explicitly add routes to a
particular host/net; it automatically binds each interface to its
subnet, unless you specify multiple interfaces on the same subnet, in
which case the first is the default route to that subnet.
Eg: if I do "ifconfig eth0 192.168.1.1 netmask 255.255.255.0", and
"ifconfig eth0:0 10.0.22.5 netmask 255.0.0.0" then I
automatically get a route to 192.168.1.0/24 through eth0, and one to
10.0.0.0/8 through eth0:0
It's a good idea, in these days of classless delegation, to always
explicitly add a netmask to your ifconfig commands, the defaults may not
be correct, and you end up with bad routes and broadcast addresses.
Colm
--
Colm Buckley BA BF | NewWorld Commerce, 44 Westland Row, Dublin 2, Ireland
colm at tuatha.org (personal) | colm.buckley at nwcgroup.com (business)
+353 87 2469146 | whois cb3765 | http://www.tuatha.org/~colm/
If you don't know where you're going, you're never lost.
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!