Please help with IP Aliasing
Hi!
I am currently setting up a Mail and Webserver (hamm, 2.0.33). I have got
a whole package of 256 IP addresses that I want to assign to this server.
In the NET-3-HOWTO I read that I have to set it up like this:
/etc/init.d/network: (part of the addresses X-ed out)
#! /bin/sh
ifconfig lo 127.0.0.1
route add -net 127.0.0.0
# here is the "real" IP address for this linux box
IPADDR=XXX.30.72.69
NETMASK=255.255.255.0
NETWORK=XXX.30.72.0
BROADCAST=XXX.30.72.255
GATEWAY=XXX.30.72.70
ifconfig eth0 ${IPADDR} netmask ${NETMASK} broadcast ${BROADCAST}
route add -net ${NETWORK}
[ "${GATEWAY}" ] && route add default gw ${GATEWAY} metric 1
# here I am trying to set up the IP-Aliasing for the whole
# subnetwork XXX.231.206.x
ifconfig eth0:1 XXX.231.206.1 netmask 255.255.255.0 up
route add -net XXX.231.206.0 netmask 255.255.255.0 eth0:1
ifconfig eth0:2 XXX.231.206.2 netmask 255.255.255.0 up
route add -net XXX.231.206.2 netmask 255.255.255.255 eth0:2
ifconfig eth0:3 XXX.231.206.3 netmask 255.255.255.0 up
route add -net XXX.231.206.3 netmask 255.255.255.255 eth0:3
# [...]
# and so on, until:
ifconfig eth0:253 XXX.231.206.253 netmask 255.255.255.0 up
route add -net XXX.231.206.253 netmask 255.255.255.255 eth0:253
ifconfig eth0:254 XXX.231.206.254 netmask 255.255.255.0 up
route add -net XXX.231.206.254 netmask 255.255.255.255 eth0:254
What I want seems to work this way, but I can't imagine that this
is the right way to do it. And if I will ever get another subnetwork
to add, how would I add it using the above method? I found that
eth0:255 is the highest possible virtual network number. So I
couldn't add any more?
All you network-gurus: Please give me a hint or any pointer as
to where I can find more info on that.
Thank you so much in advance!
Andy.
--
Andy Spiegl, University of Technology, Muenchen, Germany
E-Mail: andy@spiegl.de URL: http://www.spiegl.de
PGP fingerprint: B8 48 24 7B DB 96 6F 1C D9 6D 8E 6C DB C2 E7 E9
o _ _ _
--------- __o __o /\_ _ \\o (_)\__/o (_)
------- _`\<,_ _`\<,_ _>(_) (_)/<_ \_| \ _|/' \/
------ (_)/ (_) (_)/ (_) (_) (_) (_) (_)' _\o_
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
Unsubscribe? mail -s unsubscribe debian-user-request@lists.debian.org < /dev/null
Reply to: