DDWRT Access Point ...
 

MegaSack DRAW - This year's winner is user - rgwb
We will be in touch

[Closed] DDWRT Access Point IPTable rules anyone?

11 Posts
7 Users
0 Reactions
150 Views
Posts: 305
Free Member
Topic starter
 

At the end of my tether so mostly a cry for help but you never know.

Trying to set-up a router as a wireless access point (LAN cable from Main HUB to this one). Easy enough to make this work but I want to try and force all devices connected to this access point through a family-friendly OPENDNS.

I've managed this fine using IPTABLES firewall rules when the router's on a different subnet acting as a proper router with DHCP etc but when I do this in Access Point mode (WAN Connection disabled) it seems to just ignore the rules and everything goes through the main hub.

These are the rules which worked on the old set-up.
iptables -t nat -A PREROUTING -i br0 -p udp --dport 53 -j DNAT --to 208.67.222.123
iptables -t nat -A PREROUTING -i br0 -p tcp --dport 53 -j DNAT --to 208.67.222.123
iptables -I FORWARD -p tcp --dport 53 -j DROP

I've tried changing PREROUTING to OUTPUT to no avail.
Settings for creating the DDWRT Access Point are [url= https://www.dd-wrt.com/wiki/index.php/Wireless_Access_Point#Simple_Version ]Here - see 'Long Version'[/url]

Time to stop banging my head against this brick wall.. any ideas appreciated


 
Posted : 10/05/2017 11:13 pm
Posts: 7995
Free Member
 

I have a DDWRT device at home, not that I'm there now....

So, "bump", and I'll take a look tonight if I can.


 
Posted : 11/05/2017 5:59 am
Posts: 305
Free Member
Topic starter
 

Thanks GoFaster, any help appreciated


 
Posted : 11/05/2017 6:59 am
Posts: 0
Free Member
 

Why not just use the OpenDNS nameservers on the router rather than using the defaults or IPTables? Seems a lot of faff instead of just entering the IP addresses in the setup. It's how I manage with having one router for local access, one for my DNS-hack that gives me access to UK TV.


 
Posted : 11/05/2017 7:07 am
Posts: 305
Free Member
Topic starter
 

Why not just use the OpenDNS nameservers on the router

The family-friendly DNS is too restrictive - blocks things like national lottery and some news sites - so I want the main router to use its usual DNS and only devices coming through the access point to use it.


 
Posted : 11/05/2017 8:55 am
Posts: 1369
Free Member
 

I don't know anything about DDWRT, but it looks though like PREROUTING says:

-perform these commands prior to routing

And:

br0- bridge0? ie, the WWAN?

Could it be that you're not actually routing, so this doesn't work- it will just switch at this point.

Why not set up DHCP and routing, put another subnet on the device?

EDIT:

Although it may look at the destination IP address, say: not on this subnet, so this should be routed...


 
Posted : 11/05/2017 9:13 am
Posts: 0
Full Member
 

Does the switch its connected to support vLANs? I'd create one for the access point, and configure a DHCP server on that segment (or via IP Helper and do some cleverness on the router dhcp server .. might not be possible to assign a different options set) to assign the DNS settings.

Or just hard code the kiddies devices dns settings.

Or set a filtering proxy server on their devices.

Or flip it, set OpenDNS on the dhcp scope as a default, and hard code the DNS on devices you wish to receive Gentlemans Entertainment on.


 
Posted : 11/05/2017 9:34 am
Posts: 305
Free Member
Topic starter
 

Could it be that you're not actually routing, so this doesn't work- it will just switch at this point.

Feels like this is probably the nub of it. Reason for not having a subnet is that I want everything to be able to see each other - access media on the NAS, access the CCTV cams coming through the access point, see the wireless printer etc.. solution works great when it's a subnet with DHCP.
Might try setting it up to do DHCP on a subset of the range..

Or flip it, set OpenDNS on the dhcp scope as a default..

Definitely the fallback position, not convinced the BT router will ignore a locally-configured DNS though.


 
Posted : 11/05/2017 11:12 am
Posts: 7995
Free Member
 

I don't think I have anything to add beyond what is above.


 
Posted : 11/05/2017 5:11 pm
Posts: 4693
Full Member
 

When I used OpenDNS, you could set up a whitelist. Maybe that would help.


 
Posted : 11/05/2017 5:14 pm
Posts: 305
Free Member
Topic starter
 

When I used OpenDNS, you could set up a whitelist

Thanks - I abandoned that version of their DNS, it played havoc with things like google mail as it constantly thought the traffic was getting intercepted and reported security attacks.


 
Posted : 11/05/2017 5:25 pm
Posts: 0
Free Member
 

Your rules are applying on the NAT table and i doubt you are NATing the traffic as it's not routing to the internet.

Try using the forward table.

edit:

Looking at it this bit (iptables -I FORWARD -p tcp --dport 53 -j DROP) is specifically stopping the router from forwarding from the LAN to anywhere else on port 53 after it has applied the re-write on the NAT table. You'll probably need to miss that out and just add some rules to the forward table.


 
Posted : 11/05/2017 6:03 pm