How do I assign multiple IPs from different subnets to the same NIC?
I have NT4 machine which I'm trying to replace with a Debian box. It
currently has a secondary IP in a completely different subnet assigned
to its public NIC. I'm trying to figure out how to do this in Debian -
I think I need to modify /etc/network/interfaces, but I'm not sure how.
For example, the NIC is configured to 192.168.0.2 with netmask
255.255.255.0 and default gateway set to 192.168.0.1. I also need to
assign 172.16.0.2/32 to it. I've seen one technique that adds an entry
for eth0:0, but I have seen comments elsewhere that indicates that this
(aliasing?) is now deprecated. The other instructions for adding a
second IP put a line along the lines of "up ip addr add dev $IFACE
172.16.1.106" in to the interfaces file. I haven't been able to get
that to work.
I'm running Woody (stable) with a 2.4 kernel. Do I need to install the
iproute package (I already). Is there any documentation that you can
point me to? My /etc/network/interfaces file looks like the following -
what do I need to do it?
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
# The loopback interface
auto lo
iface lo inet loopback
# The first network card - this entry was created during the Debian
installation
# (network, broadcast and gateway are optional)
auto eth0
iface eth0 inet static
address 192.168.0.200
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1
auto eth1
iface eth1 inet static
address 10.0.0.200
netmask 255.255.255.0
network 10.0.0.0
broadcast 10.0.0.255
Reply to: