[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: 2 IPs on 1 Network Card

Stephen Hargrove <stephen@exitwound.org> writes:

> This is a weird one, so hopefully someone out there has tread before me.
> eth0 is defined as  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
        (, gateway on .254)
> auto eth0:0
> iface eth0:0 inet static
> 	address
> 	netmask
> 	network
> 	broadcast
> 	gateway

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 and a broadcast address of; if you used
the same convention for the gateway machine, it'd be
Alternatively, those settings are workable with a netmask of (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
   interface.  Otherwise,
-- Send the packet to the (single) default gateway, which must be on a
   local network.

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         dmaze@debian.org      http://people.debian.org/~dmaze/
"Theoretical politics is interesting.  Politicking should be illegal."
	-- Abra Mitchell

Reply to: