[null, {"document_url": "https://wiki.dd-wrt.com/wiki/index.php/Separate_LAN_and_WLAN", "unformatted_src": "/wiki/images/b/b7/MultiWLAN_create_bridge.png", "src": "https://wiki.dd-wrt.com/wiki/images/b/b7/MultiWLAN_create_bridge.png", "formatted_filename": "MultiWLAN create bridge", "alt_text": "Image:MultiWLAN_create_bridge.png", "rendered_width": 600, "rendered_height": 340}, null, {"document_url": "https://wiki.dd-wrt.com/wiki/index.php/Separate_LAN_and_WLAN", "unformatted_src": "/wiki/images/1/12/MultiWLAN_assign_bridge.png", "src": "https://wiki.dd-wrt.com/wiki/images/1/12/MultiWLAN_assign_bridge.png", "formatted_filename": "MultiWLAN assign bridge", "alt_text": "Image:MultiWLAN_assign_bridge.png", "rendered_width": 600, "rendered_height": 230}, null, null]
Separate LAN and WLAN




This guide explains how to separate the wireless interface from the "LAN&WLAN" bridge so that they are on different subnets. You are then able to control communication between the interfaces using iptables commands.

If your router is configured as a Wireless Access Point (WAN is disabled) then you must be sure to set the gateway and local DNS as recommended in the WAP guide. This also applies to WDS client nodes (but not the main WDS node) which are bridged to another router that does routing for them. Keep your eye out for the places this guide gives alternative instructions for WAP's.

Note: If you're separating virtual interfaces then use the instructions from the Multiple WLAN Guide.

[edit] Preparation

Go to the Administration -> Commands page, insert the command below, and press the Run Commands button to find out the actual name of your wl0 interface. If you have a wl1 interface that you want to unbridge then change the command accordingly.

Before beginning, read Bug 1853 about a minor bug with bridge creation and a haphazard fix to the bug that was introduced in changeset 16181. This guide will NOT be changed to reflect the bridge creation changes until recommended builds are affected by the change.


[edit] Step 1: Remove the Wireless Interface from the LAN bridge Note: The picture below displays a virtual wireless interface being assigned to br1 instead of the physical interface. Be sure to assign your physical interface as instructed already. [edit] Step 2: Add DHCP for the unbridged WLAN interface If DHCP is disabled on your main LAN in Basic Setup, then the Multiple DHCP method above will not work. Instead you will need to use Additional DNSMasq Options.

Go to the Services tab and find the DNSMasq section. Make sure that DNSMasq is Enabled. Adjust the following options to fit your environment (omit the comment lines starting with '#') and them to the Additional DNSMasq Options text area.

If you would like to use different DNS servers for the VAP then you can use this DNSMasq option regardless of which DHCP configuration method you used.

You should now be able to connect to the unbridged wireless interface and receive a DHCP lease with an IP address that is in the 192.168.2.0/24 subnet. Make sure that you can connect to it, receive a DHCP lease, and connect to the router's 192.168.2.1 address before you do anything further. If your WAN port is active (ie. you're not making a WAP) then you should also be able to browse the internet. If you are making a WAP then you must either use the iptables commands for WAP's in the next section, or create routes throughout your network.

[edit] Step 3: Controlling Access

Now that you have your WLAN separated you can start limiting what access it has. Here are several iptables commands that you can save to your firewall script on the Administration -> Commands page. These commands are written in the same order that the should appear in your firewall script, changing the order can affect the way that they work. Mix and match them however you like, just be sure to keep them in the order they appear on this page.

If you have any problems with your firewall script, then create a forum thread and be sure to describe in great detail what you're trying to do, what it is actually doing, and post your firewall script.

Enable NAT on the WAN port to correct a bug in builds over 17000

Allow br1 access to br0, the WAN, and any other subnets (required if SPI firewall is on)

Restrict br1 from accessing br0 (do not use on WAP's)

Restrict br0 from accessing br1

Restrict br1 from accessing the WAN port (no internet access!)

Restrict br1 from accessing the WAN subnet (still has internet, do not use on WAPs)

Restrict br1 from accessing br0's subnet but pass traffic through br0 to the internet (for WAP's - WAN port disabled)

Enable NAT for traffic being routed out br0 so that br1 has connectivity (for WAP's - WAN port disabled)

Restrict br1 from accessing the router's local sockets (software running on the router)

Allow br1 to access DHCP on the router

Allow br1 to access DNS on the router


Retrieved from "http://wiki.dd-wrt.com/wiki/index.php/Separate_LAN_and_WLAN"

Categories: Interfaces | Wlan | Lan | Basic tutorials

This page was last modified 21:29, 7 March 2018. This page has been accessed 499,439 times.