Which table use ebtables in DD-WRT vpn v23 SP2?

Post new topic   This topic is locked: you cannot edit posts or make replies.    DD-WRT Forum Index -> Broadcom SoC based Hardware
Goto page 1, 2  Next
Author Message
santiago78
DD-WRT Novice


Joined: 13 Jul 2006
Posts: 19

PostPosted: Thu Oct 05, 2006 16:04    Post subject: Which table use ebtables in DD-WRT vpn v23 SP2? Reply with quote
Hi, I'm writing because I'm trying to use ebtables to block DHCP traffic between two WRT54GL (with DD-WRT vpn v23 SP2 both of them) that are running OpenVPN in bridged mode (one router as server the other as client). The reason why I'm trying to block the DHCP traffic it's because once that the two routers are connected by OpenVPN and because they are at bridged mode, the subnet built between them has 2 DHCP server, but each DHCP server has to give IP information only to clients physically (wired or wireless) connected to the router, and with the VPN tunnel build one DHCP server can give IP information to a client connected to the router in the other side of the tunnel.

I tried to use iptables to block this using this sentence:

iptables -I INPUT -i tap0 --dport bootps -j DROP

but it didn't work. I think it didn't work because before executing openvpn I had to bridge tap0 to br0 as if it was another ethernet port in the router, so tap0 won't have an IP, so iptables won't work over that interface, it would work over br0 which is the interface that has the IP, but if I block bootps over br0 I would block DHCP coming from the VPN tunnel and also the connections from clients physically connected to the router.

When I tried to execute this ebtable sentence:

ebtables -I INPUT -i tap0 -p IPv4 --ip-protocol udp --ip-destination-port 67:68 -j DROP

I get the message: The kernel doesn't support the ebtables 'filter' table.

I also tried to list the ebtables rules with ebtables -L and ebtables -t nat -L and ebtables -t broute -L but always the same message appeared.

Thanks in advance to anyone that can help me.
Sponsor
santiago78
DD-WRT Novice


Joined: 13 Jul 2006
Posts: 19

PostPosted: Sat Oct 07, 2006 2:20    Post subject: Reply with quote
No one knows about this issue?
thenextdon13
DD-WRT User


Joined: 04 Nov 2006
Posts: 89
Location: The Dalles, Oregon USA

PostPosted: Tue Dec 26, 2006 2:33    Post subject: Reply with quote
Hey guys--

Allright, i just figured this deal out:

Ah-hah-- I see-- it seems that ebt_ip is needed, and it is not included in the standard (asus in my case) install under /lib/modules/2.4.34-pre2/, which appears to be where the modules are pulled from. If you have done the ipkg install ebtables, you will have ebt_ip.o in /jffs/lib/modules/2.4.30 -- and you (apprently) can insmod it using the absolute path. Here is my output from walking through it:
Code:

~ # lsmod
Module                  Size  Used by
ip_nat_pptp             2284   0 (unused)
ip_conntrack_pptp       2812   1
ip_nat_proto_gre        1552   0 (unused)
ip_conntrack_proto_gre    2440   0 [ip_nat_pptp ip_conntrack_pptp]
ehci-hcd               20556   0 (unused)
uhci                   30164   0 (unused)
usb-storage            68624   0 (unused)
sd_mod                 12500   0 (unused)
scsi_mod               70616   1 [usb-storage sd_mod]
usbcore                74808   0 [ehci-hcd uhci usb-storage]
vfat                   11692   0 (unused)
fat                    36840   0 [vfat]
ext3                   72788   0 (unused)
jbd                    54872   0 [ext3]
ext2                   41528   0 (unused)
jffs2                 175668   1
crc32                   3152   0 [jffs2]
switch-robo             5004   0 (unused)
switch-core             6128   0 [switch-robo]
wl                    423640   0 (unused)
diag                    2560   0 (unused)
~ # insmod ebtables
~ # insmod ebtable_filter
~ # insmod /jffs/lib/modules/2.4.30/ebt_ip.o
~ # lsmod
Module                  Size  Used by
ebt_ip                  1068   0 (unused)
ebtable_filter           892   0 (unused)
ebtables               22752   2 [ebt_ip ebtable_filter]
ip_nat_pptp             2284   0 (unused)
ip_conntrack_pptp       2812   1
ip_nat_proto_gre        1552   0 (unused)
ip_conntrack_proto_gre    2440   0 [ip_nat_pptp ip_conntrack_pptp]
ehci-hcd               20556   0 (unused)
uhci                   30164   0 (unused)
usb-storage            68624   0 (unused)
sd_mod                 12500   0 (unused)
scsi_mod               70616   1 [usb-storage sd_mod]
usbcore                74808   0 [ehci-hcd uhci usb-storage]
vfat                   11692   0 (unused)
fat                    36840   0 [vfat]
ext3                   72788   0 (unused)
jbd                    54872   0 [ext3]
ext2                   41528   0 (unused)
jffs2                 175668   1
crc32                   3152   0 [jffs2]
switch-robo             5004   0 (unused)
switch-core             6128   0 [switch-robo]
wl                    423640   0 (unused)
diag                    2560   0 (unused)
~ # ebtables -I INPUT -i tap0 -p IPv4 --ip-protocol udp --ip-destination-port 67:68 -j DROP
~ # ebtables -L
Bridge table: filter

Bridge chain: INPUT, entries: 1, policy: ACCEPT
-p IPv4 -i tap0 --ip-proto udp --ip-dport 67:68 -j DROP

Bridge chain: FORWARD, entries: 0, policy: ACCEPT

Bridge chain: OUTPUT, entries: 0, policy: ACCEPT
~ #


So, this appears to be how to do this! :)

Hope this helps!
thenextdon13
cyberde
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 1488
Location: the Netherlands

PostPosted: Tue Mar 13, 2007 17:44    Post subject: Reply with quote
Sorry about the kick, but any luck on this? Cause I'm having the exact same issue here.
It should be able to run from a startup script and still allow dhcp requests from other clients but one.

[edit]
After using insmod etc I got the folowing:
Code:
~ # ebtables -L
Bridge table: filter

Bridge chain: INPUT, entries: 0, policy: ACCEPT

Bridge chain: FORWARD, entries: 0, policy: ACCEPT

Bridge chain: OUTPUT, entries: 0, policy: ACCEPT
~ # ebtables -I INPUT -i tap0 -p IPv4 --ip-protocol udp --ip-destination-port 67:68 -j DROP
The kernel doesn't support a certain ebtables extension, consider recompiling your kernel or insmod the extension.

_________________
Firmware: DD-WRT v24-sp2 (latest available) mega
WRT320N

Donater
thenextdon13
DD-WRT User


Joined: 04 Nov 2006
Posts: 89
Location: The Dalles, Oregon USA

PostPosted: Tue Mar 13, 2007 19:40    Post subject: Reply with quote
Be sure you do the insmods in the right order-
Make sure they are actually insmoded my running lsmod. (post it?)

Other than that, i don't know what to tell you... sorry!

Camden
cyberde
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 1488
Location: the Netherlands

PostPosted: Tue Mar 13, 2007 19:52    Post subject: Reply with quote
Code:
~ # insmod ebtables
~ # insmod ebtable_filter
~ # lsmod
Module                  Size  Used by
ebtable_filter           924   0 (unused)
ebtables               23696   1 [ebtable_filter]
ip_nat_pptp             2364   0 (unused)
ip_conntrack_pptp       2956   1
ip_nat_proto_gre        1648   0 (unused)
ip_conntrack_proto_gre    2520   0 [ip_nat_pptp ip_conntrack_pptp]
wl                    712072   0 (unused)
switch-robo             5548   0 (unused)
switch-core             6400   0 [switch-robo]
diag                    2736   0 (unused)


Or is there another way to stop dhcp through the VPN since iptables won't work cause they only work between WAN and LAN (I was told to).

_________________
Firmware: DD-WRT v24-sp2 (latest available) mega
WRT320N

Donater
thenextdon13
DD-WRT User


Joined: 04 Nov 2006
Posts: 89
Location: The Dalles, Oregon USA

PostPosted: Tue Mar 13, 2007 20:07    Post subject: Reply with quote
This is EBtables, not IPTables. It is for bridges... which is why you need it.

This will work to stop dhcp over a bridge, i've used it successfully.

I see that the ebt_ip module isn't loaded on your lsmod list. It may be possible that it needs to be loaded. (not for sure, its been a while since i did this.)

HTH
Camden
cyberde
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 1488
Location: the Netherlands

PostPosted: Tue Mar 13, 2007 20:22    Post subject: Reply with quote
True, that's not inserted indeed, where can I find that module? Since it's not included with DD-WRT by default Sad
_________________
Firmware: DD-WRT v24-sp2 (latest available) mega
WRT320N

Donater
thenextdon13
DD-WRT User


Joined: 04 Nov 2006
Posts: 89
Location: The Dalles, Oregon USA

PostPosted: Tue Mar 13, 2007 23:14    Post subject: Reply with quote
Tell you the truth, i don't remember where i found it.

PM me with your email, maybe i can dig it up and get it sent to you. Or perhaps it is somewhere not standard in the directory structure.

Sorry that i don't remember. I'll see if I can't figure out where I got it from

try googling it too

take care

Camden
marv
DD-WRT Novice


Joined: 15 Jan 2007
Posts: 1
Location: Florida

PostPosted: Sun Mar 25, 2007 14:32    Post subject: Reply with quote
This is such a small file, seems like it would be easy to include with the official release since it seems quite a few people would use it!
cyberde
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 1488
Location: the Netherlands

PostPosted: Sat Mar 31, 2007 8:19    Post subject: Reply with quote
So true...
_________________
Firmware: DD-WRT v24-sp2 (latest available) mega
WRT320N

Donater
tkbletsc
DD-WRT Novice


Joined: 12 Apr 2008
Posts: 3

PostPosted: Sat Apr 12, 2008 4:15    Post subject: Reply with quote
Thanks for the info, folks.

I found a way to cram ebt_ip.o into the NVRAM, so the router can load the module after a reboot.

Full write-up here:
http://dsss.be/w/make_a_dd-wrt_bridge_silently_eat_dhcp_traffic
SilverPuppy
DD-WRT Novice


Joined: 16 Sep 2010
Posts: 30

PostPosted: Tue Mar 29, 2011 18:55    Post subject: Nothing short of ingenious, BUT...... Reply with quote
Well, it works. Sort of. Unfortunately, in my implementation, it seems to break the bridge entirely. I have tried it as provided, and also with INPUT -i changed to OUTPUT -o and nothing seems to work. The bridge is not working at all now.

I speculate that what is happening is that the DHCP for the remote box is getting eaten as well, so it never connects. Perhaps tonight I will see what happens if I leave it as INPUT -i and put it on the remote box. Perhaps that would at least keep the main location from getting the remote gateway.

Sigh...this is a very frustrating problem. Why hasn't a permanent fix for this been implemented into the OpenVPN code? Or has it? I am running some older firmware (2009). Do I need to update it and hope nothing else breaks? I hate to do that because it is working perfectly aside from this one issue. If it ain't broke, don't fix it, right?
SilverPuppy
DD-WRT Novice


Joined: 16 Sep 2010
Posts: 30

PostPosted: Wed Mar 30, 2011 1:35    Post subject: Finally, the right answer. Reply with quote
A lot of the information here seems to be quite dated. I had to look HARD for this. The needle in the haystack is to be found HERE: http://www.dd-wrt.com/phpBB2/viewtopic.php?p=477032

THIS is the solution that finally seems to work with no problems for me. I have been fooling around with this for literally YEARS looking for the correct solution to this problem. Now I am sure I have found it. MUCH THANKS to the creator of the CRON job that fixes this frustrating problem!

EDIT: As he says, DO VERIFY THE FILE PATHS. I had to change .37 to .36 because I'm using a slightly older DD-WRT and I refuse to change because everything is working perfectly as-is.
RainMotorsports
DD-WRT User


Joined: 16 Feb 2011
Posts: 51

PostPosted: Wed Mar 30, 2011 2:28    Post subject: Reply with quote
SilverPuppy you replied to a thread about a firmware no longer being developed. The thread was mainly 2006/2007 bumped once in 2008.....

I believe the final build of v23 is a little bit later? I like it but v24 is the only one in development now.
Goto page 1, 2  Next Display posts from previous:    Page 1 of 2
Post new topic   This topic is locked: you cannot edit posts or make replies.    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum