
Tutorial Config Wireless Router Access Point OpenWRT
Config Basic Wireless Router AP OpenWRT – The changes below assume an OpenWrt default configuration, the relevant files are:
1. Add and edit file /etc/config/network
Please edit and add the following as the rest let the default
[root@MyAP:/root]# vi /etc/config/network
config interface ‘lan’
option type ‘bridge’
option proto ‘static’
option netmask ‘255.255.255.0’
option macaddr ’00:01:41:80:b3:80′
option _orig_ifname ‘eth2.1 ra0’
option _orig_bridge ‘true’
option dns ‘8.8.8.8’
option ifname ‘eth2.1 ra0’
option ipaddr ‘192.168.2.2’
option gateway ‘192.168.2.1’
config interface ‘ra0’
option proto ‘static’
option ipaddr ‘192.168.0.1’
option netmask ‘255.255.255.0’
Note : Make sure that the chosen IP address is in a different subnet than the one used by the lan interface.
2. Change the existing wireless network
In /etc/config/wireless, locate the existing wifi-iface section and change its network option to point to the newly created interface section.
[root@MyAP:/root]# vi /etc/config/wireless
config wifi-iface
option device ‘ra0’
option network ‘ra0’
option mode ‘ap’
option encryption ‘psk-mixed’
option key ‘My-Key-WPA’
option ssid ‘My-SSID-WIFI’
In the existing section, network was changed to point to the ra0 interface defined in the previous step.
3. Define a new DHCP pool (Optional)
Since wireless is not bridged to LAN anymore, no DHCP leases are served to wireless clients yet. In order to support DHCP on wireless as well, a new dhcp pool must be defined in /etc/config/dhcp
[root@MyAP:/root]# vi /etc/config/dhcp
add the following line
config ‘dhcp’ ‘ra0’
option ‘interface’ ‘ra0’
option ‘start’ ‘100’
option ‘limit’ ‘150’
option ‘leasetime’ ’12h’
4. Adjust firewall settings
By default, traffic originating from the wireless network is not allowed to reach the WAN or the LAN interface. There is also no firewall zone defined for it yet, so only the default policies apply to the wireless network.
Edit /etc/config/firewall and add new zone section covering the wifi interface:
[root@MyAP:/root]# vi /etc/config/firewall
add the following line
config zone
option name ra0
list network ‘ra0’
option input ACCEPT
option output ACCEPT
option forward REJECT
Now that the zone is defined, traffic forwarding control for the wireless network can be implemented. To allow wireless clients to use the WAN interface, add the following forwarding section:
config ‘forwarding’
option ‘src’ ‘ra0’
option ‘dest’ ‘wan’
If LAN clients should be able to contact wireless clients, add the following forwarding:
config ‘forwarding’
option ‘src’ ‘lan’
option ‘dest’ ‘ra0’
To allow wireless clients to reach the LAN network, add the reversed rule below as well:
config ‘forwarding’
option ‘src’ ‘ra0’
option ‘dest’ ‘lan’
If clients on the wifi network can’t connect to the outside Internet, you may also need to enable masquerade (NAT) on your lan. To do this, add “option masq ‘1’” to your lan zone config as follows:
config zone
option name ‘lan’
option network ‘lan’
option input ‘ACCEPT’
option output ‘ACCEPT’
option forward ‘REJECT’
option masq ‘1’
5. Apply changes
ifup ra0
ra0
/etc/init.d/firewall restart
/etc/init.d/dnsmasq restart
Or it could also reboot your OpenWRT AP
Ref : http://wiki.openwrt.org/doc/
Please check your feed, the data was entered incorrectly.