PuppyIP Resource Center
Network & Connection Troubleshooting 11 min Published 2026-11-17

Split an OpenWrt LAN Switch Port into Its Own Subnet: DHCP, Firewall and PassWall Routing

Moving a LAN port into its own subnet requires coordinated switch-port, Layer 3 interface, DHCP, firewall and proxy-source settings.

OpenWrt LAN port isolation br-lan DHCP Firewall zone PassWall source routing

Service eligibility and regional restrictions

PuppyIP serves only compliant overseas businesses and their authorized personnel. Proxy services are not available in mainland China. The service may only be used for lawful business activities outside mainland China. Use of this service within mainland China is prohibited.

Hosting a proxy IP or server overseas does not change these restrictions. The service must not be provided to end users in mainland China through relaying, forwarding, sharing or resale. Before use, read the Terms of Service.

Key Takeaways

  • Port separation is more than one bridge setting; the port, interface, address, DHCP and firewall must agree.
  • OpenWrt DSA and legacy swconfig use different port names. Inspect the active topology instead of copying UCI from another model.
  • Back up network, DHCP, firewall and PassWall configuration, and keep a separate management path before applying network changes.
  • Confirm isolation only after a client on the new subnet passes address, gateway, DNS, internet and proxy-policy checks.

Identify the switch and bridge architecture first

To create a regular LAN and a dedicated proxy LAN, remove one physical switch port from the existing LAN bridge and attach it to another Layer 3 interface. Exact steps depend on whether the device uses DSA or legacy swconfig, its device-tree port names and current bridge-VLAN layout. A port called LAN1 on one model may map to a different device on another.

In LuCI's device and interface pages, confirm which bridge currently contains the physical port and how management access reaches the router. If the port you plan to detach is the only management path, prepare a local console, another management port or a recoverable backup first. Removing a bridge member over SSH through that same port can immediately disconnect you.

Back up network and proxy settings; plan the address space

Before editing, save network, DHCP, firewall and PassWall configuration and record the current management address, uplink and port membership. Choose a private subnet that does not overlap the existing LAN, WAN, VPN or upstream networks. Reserve a clear router address and DHCP pool. Fill in addresses and device names from the actual network plan; do not copy a fixed example subnet or interface name.

The command below archives only /etc/config/network, /etc/config/dhcp and /etc/config/firewall. set -e stops the shell if tar fails; tar -tf then lists the archive so you can confirm that all three expected files are present and no other files are being mistaken for a backup. This archive does not include a firmware image, wireless settings, PassWall configuration or other external state. Export PassWall separately from its management interface and store it separately. Confirm local management access and available disk space before changing networking in LuCI.

Back up network, DHCP and firewall configuration

sh
set -e
BACKUP="/root/network-dhcp-firewall-before-lan-split-$(date +%Y%m%d-%H%M%S).tar"
tar -cpf "$BACKUP" /etc/config/network /etc/config/dhcp /etc/config/firewall
tar -tf "$BACKUP"
Creates a tar archive of only these three OpenWrt config files. A tar failure stops the shell; the listing is shown for verification. Back up PassWall, wireless settings, firmware and external state separately.

Create a separate interface, DHCP scope and firewall zone in LuCI

Confirm the target port identifier in the switch/device page, then remove it from the original LAN bridge and add it only to a new bridge or VLAN. Create a static interface bound to that device, using the planned router address and mask. Enable a separate DHCP scope for the new subnet and ensure its lease range does not overlap existing pools. If the driver requires VLAN filtering or bridge-VLAN settings, follow the device topology; creating a bridge alone may not isolate a port.

Give the new interface a dedicated firewall zone with explicit input, output and forwarding policies, plus only the required forwarding to WAN. Restrict access to router management services by default; allow DNS/DHCP only as required. Do not bridge the new subnet back into the old LAN or disable the firewall to make a page load. Apply in stages and confirm management still uses the original path.

Apply PassWall policy to the source subnet

A separate subnet can be used as the source for a PassWall routing policy. First determine the actual addresses DHCP gives the clients, then assign a node, rule group or direct policy to that subnet in PassWall access control or source routing. Menu names and rule priority vary by release. For one device, prefer a DHCP reservation or explicit address over a broad rule that could capture the old LAN.

Export PassWall configuration and record the default policy before editing. After saving, inspect the generated rules for the new source interface/subnet; a saved UI page alone does not prove the rule matched. Change one variable at a time when editing DNS mode, node and source subnet so DNS, routing, firewall and core failures remain distinguishable.

Verify each layer from a client on the new port

Connect a test computer to the target physical port and confirm it receives an address in the new subnet, the correct gateway and DHCP DNS, and can reach necessary router services. Then test WAN access, DNS and an authorized HTTP/HTTPS destination in sequence. Use a client-side egress check to confirm that its requests follow the PassWall policy. Verify that old-LAN clients retain their original addresses, routes and access.

If the new client obtains an address but has no internet, check interface binding, default routing, firewall-zone forwarding, DNS and PassWall rules in order. Router-local proxy success does not prove client routing. Confirm that the client source matched the intended rule and that the destination returned a response.

Rollback and deployment limits

If management access is lost or the new LAN cannot forward traffic, use the local console or a reserved management interface to restore the original bridge membership, then restore the network, DHCP, firewall and PassWall backups. Check device names and configuration before reloading networking. OpenWrt releases differ in how interface changes are applied; a blind remote reboot can extend an outage.

Port names, bridge layout, VLAN configuration, subnet and PassWall pages depend on device and release. Isolation is complete only after a client passes address, DNS, WAN, source policy and actual request checks while the old LAN remains unaffected. Do not treat an unsaved UCI session or UI flow from one device as a portable configuration.

Sources

Frequently Asked Questions

Is removing a physical port from br-lan enough to isolate it?

No. Bind it to a separate Layer 3 interface, configure addressing, DHCP and firewall policy, then test forwarding.

Can I copy port names and UCI from another OpenWrt router?

Avoid that. DSA, swconfig, device trees and bridge-VLAN layouts differ. Inspect the port-to-bridge mapping on the actual device.

How do I route only the new LAN through PassWall?

Confirm client source addresses, add a source rule or fixed lease for the new subnet, then verify rule matching and the actual request from that client.

What if a remote change disconnects me?

Use the reserved local console or alternate management interface to restore port membership and configuration. Do not detach the only management port remotely.