Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@braian87b
Last active March 30, 2024 20:21
Show Gist options
  • Star 97 You must be signed in to star a gist
  • Fork 30 You must be signed in to fork a gist
  • Save braian87b/bba9da3a7ac23c35b7f1eecafecdd47d to your computer and use it in GitHub Desktop.
Save braian87b/bba9da3a7ac23c35b7f1eecafecdd47d to your computer and use it in GitHub Desktop.
How to setup a Dumb AP, Wired backbone for OpenWRT / LEDE
@RustyRouter
Copy link

RustyRouter commented Mar 4, 2023

Hi @braian87b

Thanks for your help.

Based on your script, and after many tests, I've created the following script, can you please take a quick look?
Please let me know if something wrong in it.

# ========================================================
# Setup a Dumb AP for OpenWRT
# Tested on: Belkin RT3200 (aka. Linksys E8450) 22.03.3
# Script expects factory settings
# ========================================================
# Disable IPv6
# ========================================================
uci delete network.lan.ip6assign
uci set network.lan.delegate='0'
uci delete dhcp.lan.dhcpv6
uci delete dhcp.lan.ra
uci delete dhcp.odhcpd
/etc/init.d/odhcpd disable
/etc/init.d/odhcpd stop
uci delete network.globals.ula_prefix
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
mv /etc/config/firewall /etc/config/firewall.unused

# ========================================================
# Remove WAN logical interfaces
uci delete network.wan
uci delete 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

Notes:
1- Adding WAN physical interface to LAN did not work in my router!, I had to do it manually in LuCi :(
using "network.lan.ifname" is not working anymore, I think now it is "network.lan.device"
If I type: "uci show network" then this is the result:

root@OpenWrt:~# uci show network
network.loopback=interface
network.loopback.device='lo'
network.loopback.proto='static'
network.loopback.ipaddr='127.0.0.1'
network.loopback.netmask='255.0.0.0'
network.globals=globals
network.globals.ula_prefix=''
network.@device[0]=device
network.@device[0].name='br-lan'
network.@device[0].type='bridge'
network.@device[0].ports='lan1' 'lan2' 'lan3' 'lan4'
network.lan=interface
network.lan.device='br-lan'
network.lan.proto='static'
network.lan.ipaddr='192.168.1.1'
network.lan.netmask='255.255.255.0'
network.lan.ip6assign='60'
network.wan=interface
network.wan.device='wan'
network.wan.proto='dhcp'
network.wan6=interface
network.wan6.device='wan'
network.wan6.proto='dhcpv6'

2-The only thing that I could not disable is "Enable IPv6" from the configuration of the "bridge device" under "General device options" tab
do you know the command to do that? Or maybe it is not necessary anymore? I've tried Google without any luck! Please check the screenshot attached:
IPv6

@braian87b
Copy link
Author

braian87b commented Mar 5, 2023

Try not remove /etc/config/firewall file placeholder, leave it as-is, disabling the service is enough, you will not save space since that starts sitting in rom, but you can empty the file if you want, similarly as with /etc/config/dhcp if you want it cleaner.
remember that if you are using recent version of openwrt it won't have swconfig anymore now it uses DSA. so the configuration will be different,
IPv6 you can disable using Luci and see on the pending settings to be commit which changed.
You can always change everything using LuCI and inspect which changes LuCi do and dump those into your script, will be safer if you are not familiar yet with all the configurations.

@RustyRouter
Copy link

I greatly appreciate your help and efforts @braian87b

@braian87b
Copy link
Author

@RustyRouter happy to help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment