Skip to content

Instantly share code, notes, and snippets.

@RustyRouter
Last active May 4, 2024 15:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save RustyRouter/3869713d7645608f1f7394812f11e931 to your computer and use it in GitHub Desktop.
Save RustyRouter/3869713d7645608f1f7394812f11e931 to your computer and use it in GitHub Desktop.
OpenWrt router into a dumb Access Point.
#!/bin/ash
# ========================================================
# Setup a Dumb AP for OpenWRT
# Tested on: Belkin RT3200 (aka. Linksys E8450) 22.03.3
# Script expects factory settings
# Copy the script file to your /tmp folder with SCP
# SSH your router
# Type sh /tmp/dumb_ap.sh
# ========================================================
# Disable IPv6
# ========================================================
uci del dhcp.lan.ra
uci del dhcp.lan.dhcpv6
uci del network.lan.ip6assign
uci set network.lan.delegate='0'
uci set network.cfg030f15.ipv6='0'
uci del network.globals.ula_prefix
uci del dhcp.odhcpd
/etc/init.d/odhcpd disable
/etc/init.d/odhcpd stop
uci commit
# ========================================================
# Disable Dnsmasq completely and discard dhcp
uci commit dhcp; echo '' > /etc/config/dhcp
/etc/init.d/dnsmasq disable
/etc/init.d/dnsmasq stop
# ========================================================
# Disable firewall
/etc/init.d/firewall disable
/etc/init.d/firewall stop
# ========================================================
# Remove WAN logical interfaces
uci del network.wan
uci del network.wan6
# ========================================================
# To identify better when connected to SSH and when seen on the network
uci set system.@system[0].hostname='DumbAP'
uci set network.lan.hostname="`uci get system.@system[0].hostname`"
uci commit system
# ========================================================
# Set static network configuration (sample config for 192.168.1.0/24)
# 192.168.1.1 is the Main Router
# ========================================================
uci set network.lan.ipaddr='192.168.1.2'
uci set network.lan.dns='192.168.1.1'
uci set network.lan.gateway='192.168.1.1'
uci set network.lan.netmask='255.255.255.0'
uci set network.lan.broadcast='192.168.1.255'
uci commit network
echo '====================================================================='
echo 'Reboot your router'
echo 'you can now connect the LAN port of this device to the LAN port'
echo 'of your main router.'
echo '192.168.1.2 is now your Access Point IP Address'
echo '====================================================================='
sync
reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment