Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    (solve)HyperV 2012 vlans support(hn0)

    Scheduled Pinned Locked Moved Virtualization
    17 Posts 3 Posters 2.2k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • perikoP
      periko @johnpoz
      last edited by

      @johnpoz I will check this, thanks.

      Necesitan Soporte de Pfsense en México?/Need Pfsense Support in Mexico?
      www.bajaopensolutions.com
      https://www.facebook.com/BajaOpenSolutions
      Quieres aprender PfSense, visita mi canal de youtube:
      https://www.youtube.com/c/PedroMorenoBOS

      1 Reply Last reply Reply Quote 0
      • perikoP
        periko
        last edited by

        I had confirm from windows forum that pfsense doesn't have support for vlans under hyperV.

        Necesitan Soporte de Pfsense en México?/Need Pfsense Support in Mexico?
        www.bajaopensolutions.com
        https://www.facebook.com/BajaOpenSolutions
        Quieres aprender PfSense, visita mi canal de youtube:
        https://www.youtube.com/c/PedroMorenoBOS

        1 Reply Last reply Reply Quote 0
        • johnpozJ
          johnpoz LAYER 8 Global Moderator
          last edited by johnpoz

          Sorry but its not pfsense/freebsd that doesn't have the support... Did you allow hyper-v to pass the tags?

          What does show for mode of the virtual nic you have connected to pfsense?

          PS C:\WINDOWS\system32> Get-VMnetworkAdapterVLAN
          
          VMName  VMNetworkAdapterName Mode     VlanList
          ------  -------------------- ----     --------
          pfsense Network Adapter      Untagged
          
          
          PS C:\WINDOWS\system32>
          

          https://docs.microsoft.com/en-us/powershell/module/hyper-v/set-vmnetworkadaptervlan?view=win10-ps

          Did you then validate that your traffic is showing up to pfsense TAGGED? I ran into this on another thread

          PS C:\WINDOWS\system32> Set-VMnetworkAdapterVLAN -VMName pfsense -Trunk -AllowedVlanIDList 20-40 -NativeVlanID 10
          PS C:\WINDOWS\system32> Get-VMnetworkAdapterVLAN
          
          VMName  VMNetworkAdapterName Mode  VlanList
          ------  -------------------- ----  --------
          pfsense Network Adapter      Trunk 10,20-40
          
          
          PS C:\WINDOWS\system32>
          

          I have not had time to actually test this... But it to have a chance to work the networking of hyperv has to be setup correctly to pass the tags to the virtual nic on your pfsense vm.

          Simple enough to validate the vlan tags show up on your pfsense vm virtual nic with tcpdump on pfsense using -e so you can see the vlan tagging that is there or not there.

          An intelligent man is sometimes forced to be drunk to spend time with his fools
          If you get confused: Listen to the Music Play
          Please don't Chat/PM me for help, unless mod related
          SG-4860 24.11 | Lab VMs 2.8, 24.11

          1 Reply Last reply Reply Quote 0
          • johnpozJ
            johnpoz LAYER 8 Global Moderator
            last edited by johnpoz

            So here you go... Not sure about HyperV 2012... But just fired up hyperV on my windows 10 box..

            And bing bang boom setup vlans on pfsense in a few minutes. Set my interface via powershell to be trunk and setup a native vlan 9 in my case that would be untagged, and then tagged vlan 3 for my wan.

            Setup my switch to have vlan 9 and 3 tagged

            Setup pfsense with vlan for wan as 3 and lan as native untagged.
            0_1548601176694_bootpfsense.png

            And few min later after boot - bam up and running with vlans
            0_1548601205481_pfsensevlanhyperv.png

            So I have no idea what they told you were - but sure looks easy enough to setup to me.

            0_1548601285856_hypersetup.png

            Here is me accessing gui and showing vlan setup there
            0_1548601324021_pfsensevlans.png

            I do have 2012r2 running but does not have hyper-v enabled. Guess I could fire it up to test... But pretty sure should be the same setup..

            So I just fired up 2012r2 hyper-V.. Yeah its going to work exactly the same way... Created a new switch and out of the box it in untagged mode. So if your going to want to present tagged vlans to pfsense vm... You would have to set it up via the Set-VMnetworkAdapterVLAN powershell cmdlet...

            PS C:\Users\Administrator> Get-VMnetworkAdapterVLAN
            
            VMName VMNetworkAdapterName                                                  Mode     VlanList
            ------ --------------------                                                  ----     --------
                   newswitch                                                             Untagged
                   Intel(R) PRO/1000 PT Dual Port Network Connection #2 - Virtual Switch Untagged
            
            

            An intelligent man is sometimes forced to be drunk to spend time with his fools
            If you get confused: Listen to the Music Play
            Please don't Chat/PM me for help, unless mod related
            SG-4860 24.11 | Lab VMs 2.8, 24.11

            1 Reply Last reply Reply Quote 0
            • perikoP
              periko
              last edited by

              I had setup a 2012 test environment, I will follow the instructions and return here, thanks.

              Necesitan Soporte de Pfsense en México?/Need Pfsense Support in Mexico?
              www.bajaopensolutions.com
              https://www.facebook.com/BajaOpenSolutions
              Quieres aprender PfSense, visita mi canal de youtube:
              https://www.youtube.com/c/PedroMorenoBOS

              1 Reply Last reply Reply Quote 0
              • M
                Mats
                last edited by Mats

                We have seen issues with Vlans on 2012 (https://forum.netgate.com/topic/137384/hyper-v-2016-virtual-pfsense-windows-adds-dhcp-dns-vlans) so if you can do 2016 it might be worth it.

                depending on your needs Hyper-v server is a free download. It's really server core with the hyper-v role

                1 Reply Last reply Reply Quote 0
                • perikoP
                  periko
                  last edited by

                  I had tested, after some click, try, click try I can see some light.
                  The only issue right now, is this.
                  Once u setup with Power Shell the vlans, it applies to all pfsense interfaces.
                  Them the wan is affected and lost communication, because both interfaces in my example are in the same vlans.
                  I'm trying to see how to apply the settings to the LAN looks a little confuse but, the driver vlan capable, my question is been answer, thanks.

                  Necesitan Soporte de Pfsense en México?/Need Pfsense Support in Mexico?
                  www.bajaopensolutions.com
                  https://www.facebook.com/BajaOpenSolutions
                  Quieres aprender PfSense, visita mi canal de youtube:
                  https://www.youtube.com/c/PedroMorenoBOS

                  1 Reply Last reply Reply Quote 0
                  • johnpozJ
                    johnpoz LAYER 8 Global Moderator
                    last edited by

                    Well your apply to the vswitch you you have your pfsense vnic connected too.. Create create different vswitch to connect different vnics in your VM too, etc.

                    Can not be of more help without more info - but as you say been answered... Could you point out this microsoft forum where they said pfsense does not support vlans under hyper-v?

                    I don't even use hyper-v, I am a esxi guy... And took me all of 2 minutes to figure out how to do vlans on the thing ;)

                    An intelligent man is sometimes forced to be drunk to spend time with his fools
                    If you get confused: Listen to the Music Play
                    Please don't Chat/PM me for help, unless mod related
                    SG-4860 24.11 | Lab VMs 2.8, 24.11

                    1 Reply Last reply Reply Quote 0
                    • M
                      Mats
                      last edited by

                      Just for clarity

                      I have now been running my Pfsense VM on hyper-V 2016 with VLans for more than one week with zero issues.

                      Therefore I claim that it is proven that PFsense do support VLans with hyper-v. However MS do have an issue in versions lower than 2016

                      1 Reply Last reply Reply Quote 0
                      • johnpozJ
                        johnpoz LAYER 8 Global Moderator
                        last edited by johnpoz

                        From my testing with windows 10 and 2k12r2 I did not see any issues.

                        Other than misleading information being out there..

                        An intelligent man is sometimes forced to be drunk to spend time with his fools
                        If you get confused: Listen to the Music Play
                        Please don't Chat/PM me for help, unless mod related
                        SG-4860 24.11 | Lab VMs 2.8, 24.11

                        M 1 Reply Last reply Reply Quote 0
                        • M
                          Mats @johnpoz
                          last edited by Mats

                          @johnpoz said in (solve)HyperV 2012 vlans support(hn0):

                          From my testing with windows 10 and 2k12r2 I did not see any issues.

                          Other than misleading information being out there..

                          At least two of us have seen issues on 2012(r2). It's in the thread I linked earlier - the fix was to update to 2016.

                          It can work for one or a few days before the issues appear

                          1 Reply Last reply Reply Quote 0
                          • johnpozJ
                            johnpoz LAYER 8 Global Moderator
                            last edited by

                            And that is NOT how I am doing vlans - I am doing it the correct way ;) Per my links and the simple powershell cmds.

                            An intelligent man is sometimes forced to be drunk to spend time with his fools
                            If you get confused: Listen to the Music Play
                            Please don't Chat/PM me for help, unless mod related
                            SG-4860 24.11 | Lab VMs 2.8, 24.11

                            M 1 Reply Last reply Reply Quote 0
                            • M
                              Mats @johnpoz
                              last edited by Mats

                              @johnpoz

                              So did I but you are missing the point. A config that works for four hours should work for four days too.

                              The issue I have seen is that the Vlan trunk stops working after a few days. Not even arp will see the nic of the VM.

                              The "workaround" I found was to add or remove a nic to the VM (just a non connected nic) and it will work for a couple of days again

                              With 2016 the same config (actually it's the same VM) works if you can read this ;)

                              1 Reply Last reply Reply Quote 0
                              • johnpozJ johnpoz referenced this topic on
                              • First post
                                Last post
                              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.