V24: WLAN separate from LAN, with independent DHCP

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 21:28, 16 September 2008 (edit)
TestedDoughnut (Talk | contribs)
(The previous tutorial sucked)
← Previous diff
Revision as of 11:12, 30 September 2008 (edit) (undo)
Jozevolf (Talk | contribs)

Next diff →
Line 22: Line 22:
Click Save Firewall, reboot the router for good measure, and BAM! You now have your LAN on the 192.168.1.1/24 network and your wireless on 192.168.2.1/24, without access to each other. Click Save Firewall, reboot the router for good measure, and BAM! You now have your LAN on the 192.168.1.1/24 network and your wireless on 192.168.2.1/24, without access to each other.
 +
 +----
 +--[[User:Jozevolf|Jozevolf]] 13:12, 30 September 2008 (CEST)
 +
 +I followed your article on v24 sp1. I had problems with wifi clients not being able to acquire IP from DHCP. I found out that there was a problem with the nas authentication service running without '-l' parameter. I then included the following two commands in post boot script:
 +
 +<pre>
 +killall nas
 +nas -P /tmp/nas.wl0lan.pid -H 34954 -l eth1 -i eth1 -A -m 132 -k yourpsk -s yourssid -w 6 -g 3600 &
 +# adjust other nas parameters according to your security needs
 +# use http://wiki.openwrt.org/OpenWrtDocs/nas as reference
 +</pre>
 +
 +For firewall part, I gues the following is more appropriate:
 +
 +<pre>
 +iptables -I FORWARD 1 -i eth1 -d $(nvram get lan_ipaddr)/$(nvram get lan_netmask) -j DROP
 +iptables -I FORWARD 2 -i br0 -d $(nvram get eth1_ipaddr)/$(nvram get eth1_netmask) -j DROP
 +</pre>

Revision as of 11:12, 30 September 2008

The goal of this article is to separate the wireless LAN from the hardwired LAN, with an independent class c network for both interfaces. For security purposes, we will prevent communication between both networks, as well as between wireless clients. This way, the wireless network is able to be a little more lax on security without the threat of unsecured access to the wired network. This is a good implementation for wireless cafés and other businesses that provide wireless Internet access to their customers.

Contents

Setup

The configuration takes about 20 minutes to complete. For this tutorial, I used a WRT54GL v1.1 with DD-WRT NoKaid v24 sp1. I've also done this setup on a WRT54G v8.2 with DD-WRT Micro v24 sp1, so I imagine that any version of DD-WRT v24 sp1 would work with this. For this scenario, we will set the wired network to 192.168.1.1/24 and the wireless network to 192.168.2.1/24.


Configuration

Step 1

First, we will log into the router interface and go to Wireless > Basic Settings. Change Network Configuration from Bridged to Unbridged. This will bring up 3 new settings. For IP Address enter 192.168.2.1 and for Subnet Mask enter 255.255.255.0. Click Apply Settings. Now click on Wireless > Advanced Settings. Change AP Isolation from Disable to Enable and click Apply Settings. This will prevent wireless clients from communicating with each other. As far as wireless encryption goes, that's up to your preferences. I'm not going to cover it in this article.

Step 2

Now that we have the wireless network setup, we need to have the DHCP server issue IP addresses within its range. To do this, first go to Setup > VLANs. Scroll to the bottom and change Wireless from LAN to None. Click Apply Settings. Now go to Setup > Networking. Scroll to the bottom and click Add under Multiple DHCP Server. This will bring up several new options. Set the first option to eth1 (the wireless adapter) and leave the other default settings as they are. Click Apply Settings.

Step 3

Now we have the wireless and wired on their own class c networks, all we have to do now is prevent them from talking to each other. Goto Administration > Commands. Now put the following commands into the text box:

iptables  -t nat -I PREROUTING -i eth1 -d $(nvram get lan_ipaddr)/$(nvram get lan_netmask) -j DROP
iptables  -t nat -I PREROUTING -i br0 -d $(nvram get eth1_ipaddr)/$(nvram get eth1_netmask) -j DROP

Click Save Firewall, reboot the router for good measure, and BAM! You now have your LAN on the 192.168.1.1/24 network and your wireless on 192.168.2.1/24, without access to each other.


--Jozevolf 13:12, 30 September 2008 (CEST)

I followed your article on v24 sp1. I had problems with wifi clients not being able to acquire IP from DHCP. I found out that there was a problem with the nas authentication service running without '-l' parameter. I then included the following two commands in post boot script:

killall nas
nas -P /tmp/nas.wl0lan.pid -H 34954 -l eth1 -i eth1 -A -m 132 -k yourpsk -s yourssid -w 6 -g 3600 &
# adjust other nas parameters according to your security needs
# use http://wiki.openwrt.org/OpenWrtDocs/nas as reference 

For firewall part, I gues the following is more appropriate:

iptables -I FORWARD 1 -i eth1 -d $(nvram get lan_ipaddr)/$(nvram get lan_netmask) -j DROP 
iptables -I FORWARD 2 -i br0 -d $(nvram get eth1_ipaddr)/$(nvram get eth1_netmask) -j DROP