[clug] Virtual Ethernet Interfaces and Routing

Joel Pearson pearj at writeme.com
Fri Jun 18 14:07:11 GMT 2004


Hi,

The problem I have is I have an ADSL router in the office, and it does dhcp
and it mostly works pretty well.  But I have decided that I'll like to have
a transparent proxy, plus have the ability to do load balancing as well as
having some records of where all our traffic is going.

So the idea I had was to have the router on a different subnet to the rest
of the network, but not actually bother having it on a separate physical
network, because I'm quite certain I don't have to worry about people
changing their ip to a different subnet.

This is the current network layout:
Router - WAN -  150.101.151.96 (Go Internode!)
Router - LAN - 192.168.1.254
Server - eth0 - 192.168.1.101

So from what I can gather all I need to do is create a vitual ethernet
interface, like so:
ifconfig eth0:1 192.168.40.1 netmask 255.255.255.0 So then the plan would be
to put everyone on the 192.168.40.0 subnet and set their default gateway as
192.168.40.1 and then the server would route everything to 192.168.1.254,
because it would be set as the default gateway.
But for some some reason I just couldn't make it route packets.  Is there
something that needs to be enabled in the kernel, caus I don't want to do ip
masquerading because that seems a bit silly in this situation.
But just thinking now do I need to tell the adsl router about the
192.168.40.0 network?  Because I can add static routes to its routing table.
Hmm now that I actually come to think of it I think that could be the
problem, because when I was testing all the other computers had their
gateways set as 192.168.1.254, and if I tried to ping them the traffic would
probably get to the destination computer (from the 192.168.40.0 network),
but when they tried to respond the router(192.168.1.254) wouldn't know what
to do with the 192.168.40.0 subnet.

Anyway, my main question is, do virtual interfaces work that way? and does
the kernel need to have something enabled to make routing work between
subnets for other computers?

Thanks in advance

-Joel





More information about the linux mailing list