{"id":467,"date":"2018-04-03T12:49:50","date_gmt":"2018-04-03T12:49:50","guid":{"rendered":"http:\/\/michaelstoica.com\/?p=467"},"modified":"2018-04-03T12:49:50","modified_gmt":"2018-04-03T12:49:50","slug":"how-to-assign-vlan-id-to-virtual-nic-in-hyper-v","status":"publish","type":"post","link":"https:\/\/michaelstoica.com\/site\/how-to-assign-vlan-id-to-virtual-nic-in-hyper-v\/","title":{"rendered":"How to assign VLAN ID to virtual NIC in Hyper-V"},"content":{"rendered":"<p>How can you run multiple virtual machines on different subnets on a Hyper-V server if you don&#8217;t have a System Center Virtual Machine Manager? Let&#8217;s say you\u00a0have different subnets for Management, DMZ, LAN and you need to configure the VMs on the right subnet.<\/p>\n<p>First, your network administrator needs to create the VLANs and\u00a0 configure\u00a0a trunk port on\u00a0the physical switch\u00a0and then you need to connect the physical NICs from the Hyper-V server to the trunk port.<\/p>\n<p>Now you have two options to set the VLAN ID for the virtual machine NIC, one is using Powershell and the other one using the Hyper-V GUI.<\/p>\n<p>The fastest way is to use the Powershell command:\u00a0<em>Set-VMNetworkAdapterVlan -VMName myvm -Access -VLANId 100 .<\/em><\/p>\n<p>Using the GUI you have to go on the VM settings, then select network adapter and enable virtual LAN identification.<a href=\"https:\/\/michaelstoica.com\/site\/wp-content\/uploads\/2018\/04\/vlan.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-470\" src=\"https:\/\/michaelstoica.com\/site\/wp-content\/uploads\/2018\/04\/vlan.png\" alt=\"\" width=\"709\" height=\"456\" srcset=\"https:\/\/michaelstoica.com\/site\/wp-content\/uploads\/2018\/04\/vlan.png 709w, https:\/\/michaelstoica.com\/site\/wp-content\/uploads\/2018\/04\/vlan-300x193.png 300w\" sizes=\"auto, (max-width: 709px) 100vw, 709px\" \/><\/a><\/p>\n<p>Hope that this helps!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How can you run multiple virtual machines on different subnets on a Hyper-V server if you don&#8217;t have a System Center Virtual Machine Manager? Let&#8217;s&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/michaelstoica.com\/site\/how-to-assign-vlan-id-to-virtual-nic-in-hyper-v\/\">Continue reading<span class=\"screen-reader-text\">How to assign VLAN ID to virtual NIC in Hyper-V<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[15,17,10,8,9],"class_list":["post-467","post","type-post","status-publish","format-standard","hentry","category-general","tag-hyper-v","tag-microsoft","tag-powershell","tag-virtualization","tag-windows-server","entry"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p63Lge-7x","_links":{"self":[{"href":"https:\/\/michaelstoica.com\/site\/wp-json\/wp\/v2\/posts\/467","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/michaelstoica.com\/site\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/michaelstoica.com\/site\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/michaelstoica.com\/site\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/michaelstoica.com\/site\/wp-json\/wp\/v2\/comments?post=467"}],"version-history":[{"count":4,"href":"https:\/\/michaelstoica.com\/site\/wp-json\/wp\/v2\/posts\/467\/revisions"}],"predecessor-version":[{"id":472,"href":"https:\/\/michaelstoica.com\/site\/wp-json\/wp\/v2\/posts\/467\/revisions\/472"}],"wp:attachment":[{"href":"https:\/\/michaelstoica.com\/site\/wp-json\/wp\/v2\/media?parent=467"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michaelstoica.com\/site\/wp-json\/wp\/v2\/categories?post=467"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michaelstoica.com\/site\/wp-json\/wp\/v2\/tags?post=467"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}