OPNsense Forum

English Forums => General Discussion => Topic started by: ubear on February 18, 2021, 10:05:59 AM

Title: VLAN's drive me crazy
Post by: ubear on February 18, 2021, 10:05:59 AM
Hello wise and mighty people.
I am using OPNsense for a SOHO environment with TP-Link smart switches such as TP-SG108E.
I have ~50 client machines on the LAN side of my OPNsense.
I have recently got it into my head to use VLAN's and it's driving me crazy:

on OPNsense:
i set up the 3 VLAN's on the OPNsense LAN line.
Base: DHCP is set 192.168.2.100-199 on LAN line
DHCP is set 192.168.40.100-199 on VLAN40
DHCP is set 192.168.50.100-199 on VLAN50
DHCP is set 192.168.60.100-199 on VLAN60

The smart switch is connected to the LAN line:
One trunk  port(8) is assigned to VLAN 40,50 and 50.
port 1 assigned to VLAN 40
port 2 assigned to VLAN 50
port 3 assigned to VLAN 60

Note: TP-link switches will ALWAYS pass VLAN 1 (un tagged packets) to all ports to prevent control lockout.

Problem:
When I connect my laptop to ANY port on the switch, I get the same 192.168.2.100 address.
I expected to connect the laptop to port 1 of the switch and get an IP 192.168.40.100 but got 192.168.2.100

Thoughts: Since the switch passes VLAN1 in any case, perhaps this DHCP server answers first? Can I change the order of DHCP servers?

Thanks
Uri
Title: Re: VLAN's drive me crazy
Post by: Gauss23 on February 18, 2021, 10:15:53 AM
Quote from: ubear on February 18, 2021, 10:05:59 AM
Note: TP-link switches will ALWAYS pass VLAN 1 (un tagged packets) to all ports to prevent control lockout.

I don't think so.

German page, but I think you get the point:
https://znil.net/index.php/VLAN_auf_TL-SG108E_mit_802.1Q_einrichten

You need to change the PVID too.
Title: Re: VLAN's drive me crazy
Post by: ubear on February 19, 2021, 08:52:21 AM
Thank you VERY much!
That did the trick!

My trust in machines (and people) is restored!

Thanks again
Uri
Title: Re: VLAN's drive me crazy
Post by: Patrick M. Hausen on February 19, 2021, 09:13:06 AM
Whoever permitted tagged and untagged frames on the same port in 802.1q deserves to be shot.