Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revisionBoth sides next revision
user:huj3r:separate_lan_using_wan_port [2022/05/21 19:32] – created huj3ruser:huj3r:separate_lan_using_wan_port [2023/04/13 05:49] – separate configuration for main/secondary routers huj3r
Line 13: Line 13:
 ====== Steps ====== ====== Steps ======
  
-0. setup the VLAN for the WAN ethernet port; make sure that you have a VLAN row (`2` for example) where one CPU core (`eth0` for example) is `tagged` and the `WAN` port is `untagged`; both must be `off` in any other VLAN row +This is the configuration to apply to the secondary router (the one where the separate LAN exists). 
-1. under Network -> Interfaces, select Devices tab and click "Add device configuration" + 
-2. select "Bridge device" as type and name it `br-lan2` (you probably already have a `br-lan`) +  - setup the VLAN for the WAN ethernet port; make sure that you have a VLAN row (`2` for example) where one CPU core (`eth0` for example) is `tagged` and the `WAN` port is `untagged`; both must be `off` in any other VLAN row 
-3. under bridge ports select `eth0.2` (or whichever is your WAN port); save +  under Network -> Interfaces, select Devices tab and click "Add device configuration" 
-4. go to Network -> Interfaces and add a new interface (e.g. `LAN2`) using `br-lan2` +  select "Bridge device" as type and name it `br-lan2` (you probably already have a `br-lan`) 
-5. under Protocol specify "Static address" and in IPv4 address specify your sub-LAN router IP e.g. `192.168.2.1`; use a `/24` subnet mask +  under bridge ports select `eth0.2` (or whichever is your WAN port); save 
-6. select the Firewall Settings tab and create a new zone by typing there `LAN2`; save +  go to Network -> Interfaces and add a new interface (e.g. `LAN2`) using `br-lan2` 
-7. configure DHCP for this new network +  under Protocol specify "Static address" and in IPv4 address specify your sub-LAN router IP e.g. `192.168.2.1`; use a `/24` subnet mask 
-8. on the main router (which might not be the one your are currently configuring) add a static route for `192.168.2.0/24` routing through the router with the WAN port's IP address on the main LAN+  select the Firewall Settings tab and create a new zone by typing there `LAN2`; save 
 +  configure DHCP for this new network 
 + 
 +Configuration for the main router
 +  - add a static route for `192.168.2.0/24` routing through the router with the secondary router WAN port's IP address on the main LAN
  
 ====== Firewall configuration ====== ====== Firewall configuration ======
  
-LAN -> LAN2: accept, accept, accept 
 LAN2 -> reject: accept, accept, reject LAN2 -> reject: accept, accept, reject
 +
 +LAN -> LAN2: accept, accept, accept
  
 {{https://forum.openwrt.org/uploads/default/optimized/3X/6/a/6ae566325c9a2da7d3e90d0136a563b4e1601dd1_2_510x500.jpeg}} {{https://forum.openwrt.org/uploads/default/optimized/3X/6/a/6ae566325c9a2da7d3e90d0136a563b4e1601dd1_2_510x500.jpeg}}
Line 32: Line 37:
 Add a forwarding rule to allow internet access: Add a forwarding rule to allow internet access:
 From LAN2 To Any zone, `!192.168.1.0/24` (your main LAN network) From LAN2 To Any zone, `!192.168.1.0/24` (your main LAN network)
 +Make sure you select 'Any` for traffic.
  
 {{https://forum.openwrt.org/uploads/default/optimized/3X/5/a/5afc7ce73be3ccbab09942a7f84c2d34df68ead4_2_690x328.jpeg}} {{https://forum.openwrt.org/uploads/default/optimized/3X/5/a/5afc7ce73be3ccbab09942a7f84c2d34df68ead4_2_690x328.jpeg}}
  
  
  • Last modified: 2023/04/13 06:00
  • by huj3r