Robert Klemme <shortcutter@googlemail.com> writes:
[ ... ]
You actually can have *two* IP addresses on *one* NIC? Are you sure
about that? How would you configure that for example on Linux?
This varies slightly under different flavors of Linux. On one of the
linux boxes I use (RedHat, kernel version
2.6.9-022stab078.21-enterprise), it's done like this:
In /etc/sysconfig/network-scripts, the following files exist (IP
addr's changed):
ifcfg-venet0
contents: DEVICE=venet0
BOOTPROTO=static
ONBOOT=yes
IPADDR=127.0.0.1
NETMASK=255.255.255.255
BROADCAST=0.0.0.0
ifcfg-venet0:0
contents: DEVICE=venet0:0
ONBOOT=yes
IPADDR=1.2.3.4
NETMASK=255.255.255.255
ifcfg-venet0:1
contents: DEVICE=venet0:1
ONBOOT=yes
IPADDR=1.2.3.5
NETMASK=255.255.255.255
ifcfg-venet0:2
contents: DEVICE=venet0:2
ONBOOT=yes
IPADDR=1.2.3.6
NETMASK=255.255.255.255
ifcfg-venet0:3
contents: DEVICE=venet0:3
ONBOOT=yes
IPADDR=1.2.3.7
NETMASK=255.255.255.255
This sets up 127.0.0.1 plus four other IP's.
Also, the following fragment exists in the standard, non-modified
version of /etc/init.d/network that's in use at my site:
[ ... etc. ... ]
cd /etc/sysconfig/network-scripts
. network-functions
# find all the interfaces besides loopback.
# ignore aliases, alternative configurations, and editor backup files
interfaces=`ls ifcfg* | LANG=C egrep -v '(ifcfg-lo|:|rpmsave|rpmorig|rpmnew)' | \
LANG=C egrep -v '(~|\.bak)$' | \
LANG=C egrep 'ifcfg-[A-Za-z0-9\._-]+$' | \
sed 's/^ifcfg-//g'`
[ ... etc. ... ]
Later in the script, the $interfaces variable is searched for all
valid interfaces to start up.
That machine has a single NIC which is configured to listen on multiple
IP's. The server farm which manages this machine routes the four IP
addresses to this host. I'm pretty sure that it's not necessary to have
a special NIC for this.
···
--
Lloyd Zusman
ljz@asfast.com
God bless you.