PDA

View Full Version : 2 ip addresses on a single interface?


jeff.carrell
3rd March 2007, 23:40
is there a way to have 2 ip addresses on a single interface?

i tried this:
root@s3:~# cat /etc/network/interfaces

# The primary network interface
auto eth0
iface eth0 inet static
address 10.1.1.203
netmask 255.255.255.0
gateway 10.1.1.1
dns-nameservers 206.176.129.2
address 192.168.150.254
netmask 255.255.255.0


and the result when i restarted networking was:

root@s3:~# /etc/init.d/networking restart
* Reconfiguring network interfaces...
/etc/network/interfaces:15: duplicate option
ifdown: couldn't read interfaces file "/etc/network/interfaces"
/etc/network/interfaces:15: duplicate option
ifup: couldn't read interfaces file "/etc/network/interfaces"
...fail!

do i need to configure sub-interfaces like on WAN router interfaces?

thanx in advance...jeff

martinfst
4th March 2007, 12:33
Here's an example that I use on my local system. Keep in mind that I run a local DNS server also.# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
address 172.16.3.75
netmask 255.255.255.0
network 172.16.3.0
broadcast 172.16.3.255
gateway 172.16.3.254
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 172.16.3.70
dns-search tiempo.loc

auto eth0:0
iface eth0:0 inet static
address 172.16.3.76
netmask 255.255.255.0
network 172.16.3.0
broadcast 172.16.3.255
gateway 172.16.3.254
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 172.16.3.70
dns-search tiempo.loc