Bookmark

Building a bridged Wi-Fi AP with LuCI, DHCP, and configuration files

OpenWrt can act as a bridged access point, but “bridge” does not mean that every port can be used interchangeably. This guide uses a simple LAN-to-LAN design: the main router provides DHCP and DNS while OpenWrt only provides Wi-Fi and forwards traffic to the main LAN.

Warning: connect the management computer to the correct LAN port, back up the network configuration first, and keep a direct recovery path. Never run two DHCP servers on the same LAN.

Decide the topology first

Record the real values before changing anything:

  • The main router management IP, for example 192.168.1.1.
  • Its DHCP range and an unused AP address, for example 192.168.1.2.
  • The OpenWrt LAN interface, bridge device, and radios to use.
  • The uplink port. Use LAN-to-LAN for this simple AP design, not the WAN port.

Back up the relevant files over SSH:

1
2
3
cp /etc/config/network /root/network.before-bridged-ap
cp /etc/config/wireless /root/wireless.before-bridged-ap
cp /etc/config/dhcp /root/dhcp.before-bridged-ap

Configure it in LuCI

  1. Open Network > Interfaces and edit LAN.
  2. Set a fixed IPv4 address in the main LAN but outside its DHCP pool, such as 192.168.1.2.
  3. Set the gateway and DNS to the main router, such as 192.168.1.1.
  4. Do not create a separate WAN uplink for a LAN-to-LAN AP.
  5. Under Network > DHCP and DNS, disable the AP's DHCP server. Leave DHCP on the main router.
  6. Open Network > Wireless, enable the radio, create the SSID, and set a private WPA2/WPA3 password.
  7. Attach the wireless network to LAN, not WAN.
  8. Click Save & Apply, wait for the change to finish, and reconnect at the new IP.
  9. Connect the main router LAN to an AP LAN port. Join the Wi-Fi and confirm that the client receives an address from the main router.

Inspect the configuration from SSH

After LuCI works, inspect the result rather than editing blindly:

1
2
3
4
5
uci show network
uci show wireless
uci show dhcp
ip addr
ip route

The main files are /etc/config/network, /etc/config/wireless, and /etc/config/dhcp. Section and device names vary by target, so never copy a complete configuration from another model. If you use UCI, commit and reload one subsystem at a time:

1
2
3
4
5
6
uci commit network
uci commit wireless
uci commit dhcp
/etc/init.d/network reload
wifi reload
/etc/init.d/dnsmasq restart

Verify and recover

A client must receive DHCP from the main router and reach the gateway, DNS, and Internet. Check logread -e dnsmasq when a client receives the wrong address. If LuCI disappears after the IP change, try the new address, connect to the correct LAN port, or restore the backup through the model's SSH/UART recovery path. Do not re-enable DHCP on the AP as a random fix; it creates intermittent conflicts.

Source


0 Bình luận

Góp Ý / Bình Luận / Đánh giá