installing openwrt as an access point
24 Nov 2017
In previous post I wrote about how to use openwrt as a wireless repeater, this time I’ll use it as an independent access point with its own subnet, how practical!
$ wget downloads.openwrt.org/snapshots/trunk/ar71xx/generic/openwrt-ar71xx-generic-tl-wdr4300-v1-squashfs-factory.bin
Or, when there is a previous openwrt version installed:
$ wget downloads.openwrt.org/snapshots/trunk/ar71xx/generic/openwrt-ar71xx-generic-tl-wdr4300-v1-squashfs-sysupgrade.bin
After completing the download, install it by going to the Firmware Upgrade menu and selecting the openwrt firmware.
Be aware that the trunk build is minimal, it doesn’t include the luci web interface, so it’s up to every person to decide if they want it or not.
To install additional software connect to the device and share temporary your laptop/desktop internet
# flush previous iptables rules $ sudo iptables -F $ sudo iptables -X $ sudo iptables -t nat -F $ sudo iptables -t nat -X $ sudo iptables -t mangle -F $ sudo iptables -t mangle -X $ sudo iptables -P INPUT ACCEPT $ sudo iptables -P FORWARD ACCEPT $ sudo iptables -P OUTPUT ACCEPT
# route laptop traffic through wlan0 (wireless) interface $ sudo iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE $ echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward $ while true; do sudo ifconfig eth0 192.168.1.2; sleep 1; done $ telnet 192.168.1.1 #type "passwd" to set the root passwd # be aware than in current openwrt releases telnet is no longer provided # in those cases just skip this step $ ssh email@example.com #from other terminal window openwrt # passwd #set the root passwd in case telnet service isn't available openwrt # ifconfig br-lan 10.9.8.7 $ while true; do sudo ifconfig eth0 10.9.8.10; sleep 1; done #bypass networkmanager $ ssh firstname.lastname@example.org openwrt # route add default gw 10.9.8.10 openwrt # echo "nameserver 18.104.22.168" > /etc/resolv.conf openwrt # opkg update openwrt # opkg install luci openwrt # /etc/init.d/uhttpd enable openwrt # /etc/init.d/uhttpd start
Upon completing the installation, go to http://10.9.8.7 and reconfigure the LAN interface to make permanent the IP address:
- Network ▷ Interfaces ▷ LAN
Create the Access Point (linked to the lan interface)
- Network ▷ Wifi ▷ Add
Connect an ethernet cable to the WAN interface (on this device it’s a blue port behind) and enjoy!, happy browsing ✌