Packet interception before IP routing takes place

Submitted by Anonymous
on September 24, 2008 - 7:58pm

Hello fellows,

I'm trying to implement a mechanism where I could have control over packets coming in from an interface or going out of the IP stack, so that I could stop the normal flow (dictated by IP routing) and then choose a different network interface for the traffic to flow. So, for example, if IP routing determines that a packet should go out via interface eth0, I'd like to stop that and redirect it to interface wlan0, for example. In the same way, when the packet is coming from the link-layer, before reaching IP, I'd like to stop it and send it to a different interface, or just letting it up if this is the destination.

I read some documentation (which unfortunaly is pretty scarce) on netfilter doing this, but I'm not sure if it is possible, since netfilter seems to operate for layer 3 and above. I'm trying to work on something like layer 2.5.

Any ideas on how this could be accomplished? I could give more examples if the explanation is not clear enough.

best regards,

- Breno

ebtables?

on
September 25, 2008 - 1:38am

i still don't understand what you want to do and why you can't just change the routing table, but have you checked http://ebtables.sourceforge.net/ ?

Ethernet Bridge

Breno Jacinto (not verified)
on
September 28, 2008 - 4:04pm

Hello, thanks for your answer.

I'm aware of Linux Ethernet Bridgig, and that it would be a very good candidate for what I'm trying to do. But by reading previous posts on their list, they mention that to bridge an 802.11 connection and a Bluetooth connection, you must set 802.11 cards in managed mode. Well, since I'm trying to implement a transparent bridge of 802.11 ad hoc and Bluetooth networks, may be it would not fit for the task. Besides, I'd need some traffic control functionality, such as sending a broadcast message to everybody (which means everyone in both networks). There's a simple topology written in the post below.

I'll try ebtables, and see if I get any meaningful results.

thanks again for you help.

cheers,

- Breno

policy routing

Anonymous (not verified)
on
September 26, 2008 - 3:47am

You most likely want to use policy routing. You can have multiple routing tables with "ip rule" command. The routing table to be used can be decided based on source ip or fwmark (which can be set using iptables rules).

Hi.. Netfilter hooks will

vivek satpute (not verified)
on
September 27, 2008 - 11:09am

Hi..

Netfilter hooks will serve your purpose..
You should go with it.. I have already did it..

netfilter hooks

Breno Jacinto (not verified)
on
September 28, 2008 - 3:54pm

Hello, thanks to all of your answers.

I intend to try that with netfilter, but documenation is so scarce. Do you have any resources about this issue that you could share?

Basically what I wish to do is implement the following scenario:

802.11 ad hoc network              Bluetooth BNEP network 

Node A ---- Node B ---- (( Node C ))--- Node D --- Node E 
                       (802.11/BT gw)  

I'd like to make Node A (802.11 only) talk to Node E, which is Bluetooth only. Node C would be the 802.11/Bluetooth Gateway. I'm sure this could be done by IP, but since in the future we may try other protocols abover layer 2, being network-layer neutral and operating at layer 2.5 is a must.

best regards,

- Breno

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.