|
Prev: Using "at" command
Next: Search order option
From: Topi on 1 Apr 2008 07:45 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-
From: omri.il on 1 Apr 2008 15:05 On Apr 1, 2:45 pm, Topi <topi.maen...(a)gmail.com> wrote: > 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- Use a bridge. Bridge the camera's interfaces, it's what a layer 2 switch does. will give you the same effect and will solve most (if not all) of your problems. read this http://www.faqs.org/docs/Linux-HOWTO/BRIDGE-STP-HOWTO.html Have fun bridging :)
From: Dean Hamstead on 1 Apr 2008 22:39 Isc's Dhcpd (which comes with every linux dist) will allow you to have different subnet ranges on a per interface basis. Do that, let the cameras get all different IP's. Then enable routing on the linux machine so all the cameras can get to the box as the one ip address. Dean > > Personal opinion - if you really must use a setup with one camera per > Ethernet interface, and can't use static addresses, fix your DHCP server > to hand out addresses based on MAC Address, and set host routes on the > individual interfaces. This will not solve your multicast problem. If > you can tolerate having all cameras on one interface (your PCI bus is > still likely to be the bottleneck no matter which way you go), that > would be the desired solution. > > Old guy -- http://fragfest.com.au
From: Topi Maenpaa on 2 Apr 2008 01:22 Thanks, this really looks like a viable solution. No need to fiddle with routes that would go wrong anyway. I'll give it a try and report what happens :) Regards, Topi > Use a bridge. > Bridge the camera's interfaces, it's what a layer 2 switch does. will > give you the same effect and will solve most (if not all) of your > problems. > > read this http://www.faqs.org/docs/Linux-HOWTO/BRIDGE-STP-HOWTO.html > > Have fun bridging :)
From: Topi Maenpaa on 2 Apr 2008 01:33
Dean Hamstead wrote: > Isc's Dhcpd (which comes with every linux dist) will allow you to have > different subnet ranges on a per interface basis. > > Do that, let the cameras get all different IP's. Then enable routing on > the linux machine so all the cameras can get to the box as the one ip > address. Good, this will solve the problem with individual cameras. But it doesn't solve the multicast problem. Anyhow, I might survive for now without actually sending multicasts if I can receive them, which leaves me with two options: 1) Configure DHCP to serve different subnets to different interfaces. Forget about sending multicasts. 2) Configure Linux to bridge eth{0,2,3,4,5} and use the bridged interface for cameras. Both options are something I didn't know of. Time to learn something new :) Thanks, Topi |