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

Re: 2 IPs on 1 Network Card



* Stephen Hargrove (stephen@exitwound.org) [030429 21:34]:
> 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
> 	address 192.168.29.43
> 	netmask 255.255.255.0
> 	network 192.168.29.0
> 	broadcast 192.168.29.255
> 	gateway 192.168.29.254
> 
> auto eth0:0
> iface eth0:0 inet static
> 	address	216.63.139.43
> 	netmask	255.255.255.248
> 	network 216.63.139.0
> 	broadcast 216.63.139.255
> 	gateway 216.63.139.134
> 
> 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.
> 
> Is what I'm trying to do possible?  If so, where am I missing it?

Yes.  You don't use two 'gateway' lines.  There's only one default
gateway.  If you want to do more complex routing, you can do that (read
the howto and install iproute).  But the simple case is that traffic to
any local net is sent out on the appropriate interface, and traffic that
needs to be routed elsewhere goes to the default gateway.

I'm guessing you want to remove the gateway line from your private
(192.168) interface.

good times,
Vineet
-- 
http://www.doorstop.net/
-- 
One nation, indivisible, with equality, liberty, and justice for all.

Attachment: pgpVmU2zRanq_.pgp
Description: PGP signature


Reply to: