Wireless access point

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 22:16, 12 October 2006 (edit)
Beej (Talk | contribs)
(How to use DHCP to set the AP's IP Address - what if /tmp/udhcpc doesn't exist?)
← Previous diff
Revision as of 22:30, 12 October 2006 (edit) (undo)
Beej (Talk | contribs)
(Plug in your router to one of the LAN ports - how WAN port gets assigned to switch)
Next diff →
Line 28: Line 28:
Normally, your router does layer 3 IP routing. By plugging into the lan port, your router will bypass that functionality and just pass on the layer 2 ethernet packets from your wired network to the wireless network and vice versa. Normally, your router does layer 3 IP routing. By plugging into the lan port, your router will bypass that functionality and just pass on the layer 2 ethernet packets from your wired network to the wireless network and vice versa.
-Alternatively, I have a WRT54GL. I assigned the WAN port to the switch and connected the WAN port as my uplink to the main router. All this really buys you is an extra port (4 available instead of 3), but why not? This might also work for other devices that have the 'assign WAN port to switch' feature.+Alternatively, if you have a router that supports assigning the WAN port to the switch:<br />
 +Setup -> Basic Setup -> Internet Connection Type -> Connection Type = Disabled<br />
 +Setup -> Basic Setup -> Network Setup -> WAN Port -> Assign WAN Port to Switch<br />
 +you can connect the WAN port as your uplink to your main router. All this really buys you is an extra port (4 available instead of 3), but why not?
 + 
 +The WRT54GL and WHR-G54S support this.
== How to use DHCP to set the AP's IP Address == == How to use DHCP to set the AP's IP Address ==

Revision as of 22:30, 12 October 2006

Contents

Summary -- why would you want to do this

If you have a larger network, for which dd-wrt is not a suitable core router you will probably want to have wireless clients be a part of the larger network. In this case, clients would get DHCP configuration from some other DHCP server, and could be accessed by other clients on the network.

Some colleges that still allow students to have their own wireless access points require that they not hand out private DHCP addresses (as dhcp does by default) because it makes it difficult to track down which wireless client is causing problems (eg. has a virus.)

Typically vendors such as Linksys charge more for devices which work as access points rather than routers because routers are typically used by home users and APs by businesses. With dd-wrt you can buy a device marketed as a router and use it as an AP.


How to set up dd-wrt as an access point

There are three basic configuration changes required to set up your router as an access point.

Turn off DHCP

If you do not turn off DHCP, when you plug your router into the network (later) you will give other clients on the wired network ip addresses which are inappropriate for that network. This will make your network administrator VERY unhappy. (This is true even if you are your network administrator, as it will make you unhappy.)

Because its so important I'll repeat myself. Turn off DHCP before you continue.

Set the IP address of the LAN Interface

Preferably immediately after turning off DHCP, while you still have the ip address the AP gave you, set the ip address of the LAN interface to the ip address you want the AP to use. Alternatively you can use the instuctions below to set the APs ip address via DHCP.

If you can't connect to the AP to set the ip address, it is probably because your computer no longer has an IP address on the same subnet. Simply set your computer's ip address and subnet to 192.168.1.2 and 255.255.255.0 respectivly. You should then be able to point your browser at 192.168.1.1.

Plug in your router to one of the LAN ports

Plug the LAN port of your router to the network port on your existing wired network. Yes, I meant the LAN port.

Normally, your router does layer 3 IP routing. By plugging into the lan port, your router will bypass that functionality and just pass on the layer 2 ethernet packets from your wired network to the wireless network and vice versa.

Alternatively, if you have a router that supports assigning the WAN port to the switch:
Setup -> Basic Setup -> Internet Connection Type -> Connection Type = Disabled
Setup -> Basic Setup -> Network Setup -> WAN Port -> Assign WAN Port to Switch
you can connect the WAN port as your uplink to your main router. All this really buys you is an extra port (4 available instead of 3), but why not?

The WRT54GL and WHR-G54S support this.

How to use DHCP to set the AP's IP Address

It is not possible to set the lan interface to get its IP address via DHCP using the web interface. You can, however, set your startup script to obtain an ip address.

Simply set your IP Address to:

udhcpc -i br0 -p /var/run/udhcpc.pid -s /tmp/udhcpc -H test-wrt-wireless
hostname `nslookup \`ifconfig br0 | grep 'inet addr' |cut -f 2 -d ':'\` | grep 'Name:' | awk '{print $2;}' | cut -f 1 -d '.'`
if test `hostname` != `nvram get wan_hostname`; then nvram set wan_hostname=`hostname`; nvram set router_name=`hostname`; nvram commit; fi

Only the first line is required if you don't want your AP to set its name based on the ip address it gets. However if you want to save a configuration file which will apply to several APs, that can be a handy feature.

It seems that in some cases, the /tmp/udhcpc link doesn't exist. in that case, prepend:
ln -s /sbin/rc /tmp/udhcpc
to your startup script.