can netfilter capture internal network packet?
Dear all,
I got a serious problem with my netfilter programe.
what i am trying to do is capture a packet frmo A to B in the same network and direct it to QUEUE.
My setup is
A B
\ /
\ /
HUB
| (eth0)
GW
|(eth1)
|
|is that possible to: when A send a message to B port 1700 (for example) , the iptales in GW can grep the packet and put into queue for processing and put it back to the line?
I tried to the rules like:
iptables -A INPUT -i eth0 -p udp --dport 17-- -j QUEUE
or
iptables -A INPUT -o eth1 -p udp --dport 17-- -j QUEUE
or both of them.
I can get it works.
I also have a netfilter module, insepecting packetsrc/dest port in the PRE_ROUTING hook point, also can't get it.
is that any way I can do what I want to do in module? in iptables?
Thanks very much for any of your help..
Regards,
Calvin
Quoted 19 lines · calvin
Dear all,
I got a serious problem with my netfilter programe.
what i am trying to do is capture a packet frmo A to B in the same network and direct it to QUEUE.
My setup is
A B
\ /
\ /
HUB| (eth0) GW |(eth1) | |
Quoted 3 lines
is that possible to: when A send a message to B port 1700 (for example) , the iptales in GW can grep the packet and put into queue for processing and put it back to the line?
no, of course not. You seem to have a basic misunderstanding about network topology. A and B are on the same layer 2, they are never sent through your gateway. The GW is only involved when the packet needs to be passed from one layer 2 segment to the other layer 2 segment.
Quoted 1 line
is that any way I can do what I want to do in module? in iptables?
No. And this is not a limitation of iptables, it's a fundamental principle of ethernet.
Quoted 2 lines
Regards,
Calvin
Signature · 5 lines
- Harald Welte <[email protected]> http://www.netfilter.org/ ============================================================================ "Fragmentation is like classful addressing -- an interesting early architectural error that shows how much experimentation was going on while IP was being designed." -- Paul Vixie
Calvin,
The ebtables project might interest you.
http://ebtables.sourceforge.net/
You can intercept packets by putting a bridge between A and B.
Cheers
Matt
Quoted 20 lines · calvin
Dear all,
I got a serious problem with my netfilter programe.
what i am trying to do is capture a packet frmo A to B in the same network and direct it to QUEUE.
My setup is
A B
\ /
\ /
HUB| (eth0) GW |(eth1) | |
Quoted 4 lines
is that possible to: when A send a message to B port 1700 (for example) , the iptales in GW can grep the packet and put into queue for processing and put it back to the line?
Cheers
Matt
Signature · 3 lines
Matthew Natalier, Systems Programmer, SnapGear, Inc. Ph: +61 7 3435 2805, Fx: +61 7 3891 3630 Email: [email protected], Web: http://www.SnapGear.com
Quoted 24 lines · Matthew Natalier
Calvin,
The ebtables project might interest you.
http://ebtables.sourceforge.net/
You can intercept packets by putting a bridge between A and B.
Quoted 16 lines
My setup is
A B
\ /
\ /
HUB| (eth0)GW |(eth1)is that possible to: when A send a message to B port 1700 (for example)
, the iptales in GW can grep the packet and put into queue for processing and put it back to the line?
You'll need to use iptables on the bridge if you want to queue the packet to userspace, though. Just replace the hub by a Linux bridge and use iptables on it...
cheers,
Bart