VLAN OVER VPN



  • HI everyone

    I got one pfsense with one WAN on NIC 1 and two lan on NIC 2 separated by VLAN :
    LAN 1 - 192.168.12.0/24 - VLAN ID 100
    LAN 2 - 192.168.2.0/24 - VLAN ID 200

    Both LAN are manage by a Layer 2 Switch .

    The Switch VLAN management is on 200.

    I got one VPN acces to pfsense with route to both LAN

    I succeed to get acces to pfsense box but not on devices located on each LAN . I suppose is because via my openvpn tunnel i don't push VLAN id on my packet .

    I would like to know if someone succed to implement such design ??
    Is there a way to push vlan id via openvpn ??

    KR



  • Hi! Did you add local networks to openvpn server settings?
    8eb4fa8e-a5fd-4784-8b32-cfd5a7c4ac9e-image.png
    I don't think VLAN is different from physical LAN access. VLAN id is not to be translated to VPN tunnel.



  • @max33 said in VLAN OVER VPN:

    I would like to know if someone succed to implement such design ??

    Normal tunnel VPNs do not support VLANs, as VLANs are layer 2 and VPNs carry layer 3 traffic. The only thing you can do is run the VPN in TAP mode, which is essentially a bridge.





  • @Pippin said in VLAN OVER VPN:

    It is planned to be included into version 2.5:

    What's to be included???



  • Vlan capability, but I think I was too quickly, it's for tap mode, not tun.



  • @Pippin said in VLAN OVER VPN:

    Vlan capability, but I think I was too quickly, it's for tap mode, not tun.

    That's curious. As TAP mode is supposed to be equivalent to a bridge, there should be no difference between handling VLANs and any other type of Ethernet frame. The only difference between a VLAN frame and any other is the contents of the Ethertype field and the additional 4 bytes. A TAP VPN should be able to handle any Ethernet frame, including VLAN.

    Ethernet bridges represent the software analog to a physical ethernet switch.





  • @Pippin said in VLAN OVER VPN:

    Please read here:
    https://sourceforge.net/p/openvpn/mailman/message/34991937/

    First off, I have no experience with TAP. My take on that is adding VLAN support to the TAP interface, as would be done on an Ethernet interface. Is that correct? Does TAP support bridging from a physical interface? If so, it should be transparent to VLAN tags.



  • @JKnott said in VLAN OVER VPN:

    First off, I have no experience with TAP. My take on that is adding VLAN support to the TAP interface, as would be done on an Ethernet interface. Is that correct? Does TAP support bridging from a physical interface? If so, it should be transparent to VLAN tags.

    Neither do I but yes, it's about adding VLAN support to TAP interface.

    But I think it's OT here...



  • @max33 I'd like to clarify your request.
    What do you need?:

    1. translate VLAN id to client-side network (i don't know the reason)
    2. just need to access to devices behind VPN tunnel from your client device
      If 2nd - just give access on VPNserver settings page. You don't need to translate VLAN IDs to tunnel.
      Take a look this:
      861589bb-357d-49ae-a2cb-b502e2ac1303-image.png
      29bd7e5d-f4bc-41dc-94c2-8f8e025869f4-image.png
      OpenVPN server settings 4c3b3487-b85d-4869-880d-dee1c403d9c4-image.png

    As a result VPN client doesn't even know about tags, vlans etc.
    ping from VPN client to VLAN20 gateway (packets between VPN client and VPN server are untagged)
    6c13ce5d-355d-4fec-8ec7-4134b2f5e44d-image.png



  • Is VLAN over VPN even necessary? VLANs are normally different IP address ranges. Why not just route the traffic from the VLANs to the other end according to address? Similarly, the other end will then forward to the appropriate VLAN.



  • Thanks to all for taking time to respond

    I think my question was not clear so i will try to explain : I just want to connect to my switch via vpn client.

    I confirm that i correctly set my open vpn (the IVP4 local network range) but unable to reach web interface of the switch .

    Currently schema is :

    NIC 1 of PFSENSE connected to WAN
    NIC 2 of PFSENSE connect to Switch Layer 2

    Two VLAN interface declared on PFSENSE NIC 2
    VLAN 100 for TELEPHONY - 192.168.10.0/24
    VLAN 200 for PC - 192.168.0.0/24

    Switch are on VLAN 200 (Management VLAN 200) on IP 192.168.0.253

    PC are connected to Phone devices (YEALINK T46) and phone connected to Switch.

    Phone Device tagged packet in order to manage VOIP traffic on VLANN 100 and PC traffic on VLAN 200

    All works when i am on local network (connected to switch) but when i am outside in order to manage the network i implemented OPENVPN on pfsense and set the two network on IPV4 Local Network.

    I got acces to web interface of phone but not on web interface of switch so i am asking myself if it could be due to vlan.

    I will try to perform more test tonight and come back later.


  • LAYER 8 Netgate

    Looking at that VLAN feature it sounds like it will be in the OpenVPN tap process - sort of like iroutes in the tun process. If it also integrates with, say, tagged VLANs on an OpenVPN assigned interface that would be...interesting.

    All works when i am on local network (connected to switch)

    I got acces to web interface of phone but not on web interface of switch so i am asking myself if it could be due to vlan.

    Is the default gateway on the switch's management interface set properly?




  • LAYER 8 Netgate

    Yeah. that would be interesting.



  • One question, what's at the other end of the VPN? With a TAP VPN, the network will have to be in the same subnet as this end.



  • HI
    Thanks a lot Derelict you got the point , the issue was coming from wrong gateway setting on the switch.
    A stupid simple config......

    By the way thanks a lot to all people whose taking time to respond....

    Have a good day all............



  • @max33 great! have a nice day)


Log in to reply