Re: 2 IPs on 1 Network Card
Stephen Hargrove <email@example.com> writes:
> This is a weird one, so hopefully someone out there has tread before me.
> eth0 is defined as 192.168.29.43. On that same NIC, I need to define
> eth0:0 as 216.63.319.43. Here's my /etc/network/interfaces:
> auto eth0
> iface eth0 inet static
(192.168.29.43/24, gateway on .254)
> auto eth0:0
> iface eth0:0 inet static
> address 220.127.116.11
> netmask 255.255.255.248
> network 18.104.22.168
> broadcast 22.214.171.124
> gateway 126.96.36.199
First off, this set of settings isn't consistent. If the netmask is
right (a /29 network), then that address would have a network address
of 188.8.131.52 and a broadcast address of 184.108.40.206; if you used
the same convention for the gateway machine, it'd be 220.127.116.11.
Alternatively, those settings are workable with a netmask of
255.255.255.0 (a /24 network).
> This sets up fine, but I can't communicate out eth0:0. I'm positive
> that it has something to do with the default gateway.
Linux's default routing policy is:
-- Is the destination address on a local network? Send to that
-- Send the packet to the (single) default gateway, which must be on a
If you don't want to define a more complicated routing scheme, you
should set up /etc/network/interfaces so that one iface stanza but not
the other has a 'gateway' line. '/sbin/route -n' will show you the
current routing table.
David Maze firstname.lastname@example.org http://people.debian.org/~dmaze/
"Theoretical politics is interesting. Politicking should be illegal."
-- Abra Mitchell