Group: comp.os.linux.networking
From: Topi
Date: Tuesday, April 01, 2008 6:45 AM
Subject: Routing to multiple interfaces

Hi,

I have a Linux box with six ethernet adapters eth[0-5]. eth1 is for
internet access and works as a dhcp client. The others are for lan
cameras. I have a dhcp server running on eth{0,2,3,4,5} and it
delivers addresses in 192.168.1.0/24 to all cameras. All camera
interfaces have the same static ip 192.168.1.1.

My problem is that I cannot find a way to set up routing tables so
that traffic would get delivered to the correct interface, because all
cameras are in the same subnet. Since traffic gets delivered to the
interface of the first matching routing table entry, a camera in
another device will never get the ip packets. Let's assume the
situation is as follows:

eth1: default route via 10.10.10.1
eth0: connected to camera with ip 192.168.1.2
eth2: connected to camera with ip 192.168.1.3

Now, if I set up a static route to 192.168.1.0/24 through eth0,
packets to 192.168.1.3 will be routed to eth0, and the camera in eth2
will never see them. I could, of course, solve the problem by giving
the cameras static IP addresses, but this isn't feasible in my
application.

Another problem that could not be solved with static addresses is with
multicast traffic. The cameras are detected with UPnP, which builds on
IP multicasts. The class D address space UPnP uses is 239.0.0.0/8.
Now, whenever I send a UPnP message, it apparently goes down eth1,
which is my default route. One camera starts working if I set up a
static route to 239.0.0.0/8 through its interface, but the others
won't, of course. My second question is: how do I make sure multicast
messages will always get delivered to all the interfaces?

I'm sure this is possible because even a simplest 15 EURO switch will do
the trick. If I connect the cameras to such a box and attach it to my
eth0, everything is fine. But how do I configure Linux to do the same
thing with many network adapters?

Any help is appreaciated.
-Topi-

Safety Articles | Usenet Groups | Usenet News | Bluegrass