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

Re: routing + 2 NICs on teh same network

On Tuesday 22 March 2005 15:34, Dave Ewart wrote:
> On Tuesday, 22.03.2005 at 14:48 +0200, Chavdar Videff wrote:
> > We have the following problem with the routing.
> > We have the following structure:
> > Internet   >>>>  Real Ip address on Cisco Router >>>> Internal ip address
> > on Cisco Router ( >>>>> LAN
> >
> > In the LAN space we deploy a Debian Linux gateway and firewall to be in
> > between Cisco Router and LAN. We noticed the following problem:
> >
> > On Debian gateway:
> > eth0 -
> > eth1 -
> >
> > is the gateway IP address for all hosts on the LAN.
> > However if deployed with above settings - there is no routing possible.
> > If we assign the IP address to eth0:1 everything works as
> > expected.
> >
> > If eth1 is another network ( , again for hosts in that network
> > everything is OK).
> >
> > My question is:
> > Why isn't it possible to have 2 NICs on same network and have routing
> > achieved or, if it is possible, how is it accomplished.
> It is possible, you need to get your routes and networks properly
> configured though.  Each network interface on the Debian gateway needs
> to have a sensible netmask set, and can have a gateway for each
> interface.
> Looking at your setup, I'm unclear as to why you've picked these IP
> addresses.  You need to choose them carefully so that the netmasks work.
> 1. You have two networks here, one including the internal interface on
> the router and eth0 on the gateway; the second which is eth1 on the
> gateway and the rest of the LAN.
> 2. The first network requires two IPs, a network broadcast IP and a
> network number - this is a total of four addresses.  Suggestion:
> on the router and on the gateway both with a
> netmask of (/30).  This network's number is
> and its broadcast is ...
> 3. The second, main internal network could be 10.50.2.x ...
> (It's unclear why you've chosen the IP addresses you have, so I'm
> assuming it's clearer to change them to something else)
> If you need to keep those IP addresses, then you need to figure out what
> the network number, netmask, broadcast are for the subnets.  Use the
> tool 'ipcalc' for that.  e.g. if you want and on
> the same subnet (the router's internal IP and the gateway's eth0), then
> you can't use and on a *different* network.
> That's logically wrong.
> Dave.

The reason why we do this is because the Cisco router is maintained by our ISP 
and it is configured for the entire LAN. I cannot touch there. And I cannot 
change the LAN address space because there are servers accessed from outside.
This is the reason why both interfaces of the Debian gateway have addresses in 
the same subnetwork. I use SNAT/DNAT in iptables to masquerade the hosts 
behind the Debian box, so that replies from the Cisco Router pass through the 
Debian box instead of going directly to that host.
It works if I use 1 NIC with 2 aliases: eth0 = and eth0:1 = My problem is when the above addresses are assigned to 2 NICs 
on the same host, i.e. eth0 = and eth1 =


Chavdar Videff

Reply to: