Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
General Discussion
»
Setting Up Multiple LANs
« previous
next »
Print
Pages: [
1
]
2
Author
Topic: Setting Up Multiple LANs (Read 10186 times)
JB
Newbie
Posts: 9
Karma: 0
Setting Up Multiple LANs
«
on:
September 23, 2023, 04:31:27 pm »
Hello,
I'm trying to set up a second LAN on my router and I can't get passed the DHCP part and since I'm a noob at this maybe DHCP isn't the last of the process to get the second LAN working. So I'm here looking for help.
LAN1 is set to 192.168.1.50
LAN2 is set to 192.168.1.51
What I'm intending to do is use my LAN1 to connect to my switch for all my wired connections and LAN2 to be connected to my WIFI extender, this way I monitor how much bandwidth is being used by wired and wireless devices separately.
LAN1 has its DHCP set up and I used a YouTube tutorial to get through that (
https://youtu.be/_IzyJTcnPu8
)
For LAN2 I haven't found a tutorial of any kind that has worked for me, last night while I tried to figure this out it just broke my brain.
I believe that Firewall rules are also needed to allow internet access to LAN2 based on Google searches, that too I cannot figure out.
Any help would be appreciated.
P.S. Not sure if it matters but to point it out the computer I'm using is a laptop and I'm using USB to Ethernet adapters for Ethernet ports.
Logged
Monviech (Cedrik)
Global Moderator
Hero Member
Posts: 1601
Karma: 176
Re: Setting Up Multiple LANs
«
Reply #1 on:
September 23, 2023, 07:20:19 pm »
Theres two choices, you either create a new subnet, so for example
- LAN1 is set to 192.168.
1
.50/24
- LAN2 is set to 192.168.
2
.50/24 (You need to create firewall rules on the new interface)
Or you create a transparent bridge between LAN 1 and LAN 2, and the Bridge Interface gets the IP 192.168.1.50.
https://docs.opnsense.org/manual/how-tos/lan_bridge.html
(Would not recommend the bridge with usb lan though)
«
Last Edit: September 23, 2023, 07:22:20 pm by Monviech
»
Logged
Hardware:
DEC740
JB
Newbie
Posts: 9
Karma: 0
Re: Setting Up Multiple LANs
«
Reply #2 on:
September 23, 2023, 07:42:19 pm »
Okay, thanks for the information and how exactly would the new firewall rules look like?
When I go to the firewall rules to DHCP there is a message in Available range that reads "No available address range for configured interface subnet size." I put the Subnet as suggested 192.168.2.50.
Logged
Monviech (Cedrik)
Global Moderator
Hero Member
Posts: 1601
Karma: 176
Re: Setting Up Multiple LANs
«
Reply #3 on:
September 23, 2023, 07:47:39 pm »
You could also choose 192.168.2.1/24 as your interface, then it would work right away. And for the firewall rules, just go in Firewall: Rules: Lan and clone the rules there, just change the interface to LAN 2 and save/apply.
Logged
Hardware:
DEC740
JB
Newbie
Posts: 9
Karma: 0
Re: Setting Up Multiple LANs
«
Reply #4 on:
September 23, 2023, 08:00:35 pm »
Interesting
So I went with 192.168.2.50 and I cloned the rules as you suggested, my phone is getting a connection to my WIFI BUT when trying to load anything on the internet on my phone nothing will actually load. What am I missing?
Logged
Monviech (Cedrik)
Global Moderator
Hero Member
Posts: 1601
Karma: 176
Re: Setting Up Multiple LANs
«
Reply #5 on:
September 23, 2023, 08:18:59 pm »
Maybe you are missing an Outbound NAT rule.
Logged
Hardware:
DEC740
JB
Newbie
Posts: 9
Karma: 0
Re: Setting Up Multiple LANs
«
Reply #6 on:
September 23, 2023, 08:31:23 pm »
Perhaps I am. The generation is set to automatic and not trying to pretend like I know what I'm doing just logically it seems I have 2 options
1) switch to hybrid NAT rule generation to keep the automated generation going to keep all my current settings and then manually add an outgoing rule for LAN2, I guess??
2) If Port Forwarding is as it sounds to me then I could port LAN2 to the WAN port... if that is correct it sounds easier but also slower than the first option.
Logged
Monviech (Cedrik)
Global Moderator
Hero Member
Posts: 1601
Karma: 176
Re: Setting Up Multiple LANs
«
Reply #7 on:
September 23, 2023, 08:38:09 pm »
If its on automatic then it should create the outbound nat rules automatically. Did you put a dns server into your DHCP server (e.g. 8.8.8.8 for google dns)? And is the gateway in the dhcp server 192.168.2.50?
Logged
Hardware:
DEC740
JB
Newbie
Posts: 9
Karma: 0
Re: Setting Up Multiple LANs
«
Reply #8 on:
September 23, 2023, 09:07:50 pm »
It was on automatic I switched it to Hybrid and then I fiddled with an outbound rule to no avail. My phone indicates that my WIFI is connected without internet. About a minute ago I deleted the outbound rule I made since it wasn't helping any way. I use 1.1.1.1 and 8.8.8.8 for global DNS.
Including a screenshot for the DHCP of my LAN2
Logged
JB
Newbie
Posts: 9
Karma: 0
Re: Setting Up Multiple LANs
«
Reply #9 on:
September 23, 2023, 09:14:55 pm »
Based on what I'm seeing here, LAN2 is able to receive but not able to send out so I guess that means an outbound rule is needed?
Logged
Monviech (Cedrik)
Global Moderator
Hero Member
Posts: 1601
Karma: 176
Re: Setting Up Multiple LANs
«
Reply #10 on:
September 23, 2023, 09:36:14 pm »
Please go to Firewall: Diagnostics: Statistics: rules and expand "nat rules" and post all rules that have "nat" as description.
Then go to Firewall: Rules: LAN2 and make a screenshot of the rule you created and post it here.
Logged
Hardware:
DEC740
JB
Newbie
Posts: 9
Karma: 0
Re: Setting Up Multiple LANs
«
Reply #11 on:
September 23, 2023, 09:41:20 pm »
Here you go
Logged
Monviech (Cedrik)
Global Moderator
Hero Member
Posts: 1601
Karma: 176
Re: Setting Up Multiple LANs
«
Reply #12 on:
September 23, 2023, 09:44:39 pm »
Change the source in both firewall rules to "LAN2 net"
Logged
Hardware:
DEC740
JB
Newbie
Posts: 9
Karma: 0
Re: Setting Up Multiple LANs
«
Reply #13 on:
September 23, 2023, 09:52:39 pm »
Eh, that worked, I don't really get why or how haha but it worked. Thank you so much.
Logged
Monviech (Cedrik)
Global Moderator
Hero Member
Posts: 1601
Karma: 176
Re: Setting Up Multiple LANs
«
Reply #14 on:
September 23, 2023, 09:58:34 pm »
Good, happy it worked for you.
And if you want to know why it did, its a firewall. All connections need a rule that allow that connection.
Prior to the adjustment, the rule allowed all incoming traffic on the interface LAN2 that had the network LAN1 net as source. But since your phone had LAN2 net as source the traffic was blocked.
Now its allowed.
Logged
Hardware:
DEC740
Print
Pages: [
1
]
2
« previous
next »
OPNsense Forum
»
English Forums
»
General Discussion
»
Setting Up Multiple LANs