{"id":22,"date":"2021-04-20T12:17:43","date_gmt":"2021-04-20T11:17:43","guid":{"rendered":"https:\/\/www.simplyhosting.com\/support\/?post_type=ht_kb&#038;p=22"},"modified":"2022-02-16T10:31:21","modified_gmt":"2022-02-16T10:31:21","slug":"vlan-interfaces-on-debian","status":"publish","type":"ht_kb","link":"https:\/\/www.simplyhosting.com\/support\/articles\/vlan-interfaces-on-debian\/","title":{"rendered":"VLAN Interfaces on Debian"},"content":{"rendered":"\n<p>This step by step guide is for configuring VLAN interfaces on Debian based operating systems.<br><br>For the following guide we will use the following data and assume that you are running all commands as the root user:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th>Type<\/th><th>Value<\/th><\/tr><tr><td>VLAN Tag<\/td><td>1000<\/td><\/tr><tr><td>IP Address<\/td><td>192.0.2.1<\/td><\/tr><tr><td>Netmask<\/td><td>255.255.255.0<\/td><\/tr><tr><td>Device<\/td><td>em1<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"VLANInterfacesonDebian-Step-by-stepguide\">Step-by-step guide<\/h2>\n\n\n\n<p>How to do it:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Determine whether the 802.1q VLAN module is loaded:<\/li><\/ol>\n\n\n\n<pre class=\"wp-block-preformatted\">lsmod | grep 8021q<\/pre>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\"><li>If it is loaded, go straight to step 5, otherwise make sure the VLAN package is installed:<\/li><\/ol>\n\n\n\n<pre class=\"wp-block-preformatted\">dpkg-query -l | grep vlan<\/pre>\n\n\n\n<ol class=\"wp-block-list\" start=\"3\"><li>If it is installed go to step 4, otherwise install it with:<\/li><\/ol>\n\n\n\n<pre class=\"wp-block-preformatted\">apt-get install vlan<\/pre>\n\n\n\n<ol class=\"wp-block-list\" start=\"4\"><li>With the package installed you can now load the module:<\/li><\/ol>\n\n\n\n<pre class=\"wp-block-preformatted\">modprobe 8021q &amp;&amp; echo \"8021q\" &gt;&gt; \/etc\/modules<\/pre>\n\n\n\n<ol class=\"wp-block-list\" start=\"5\"><li>With the 802.1q module loaded into the kernel we need to determine what the interfaces are called:<\/li><\/ol>\n\n\n\n<pre class=\"wp-block-preformatted\">ls \/sys\/class\/net<\/pre>\n\n\n\n<ol class=\"wp-block-list\" start=\"6\"><li>Open the existing interfaces file in your favourite editor in order to add the new VLAN interface to it.&nbsp;<\/li><\/ol>\n\n\n\n<pre class=\"wp-block-preformatted\">nano \/etc\/network\/interfaces<\/pre>\n\n\n\n<ol class=\"wp-block-list\" start=\"7\"><li>At the end of this file, we append the configuration for the VLAN &#8211; please replace the data here with the correct interface name, VLAN tag and your preferred IP addressing schema (This should be RFC1918 private address space to avoid issues).<\/li><\/ol>\n\n\n\n<div class=\"wp-block-nco-info-block\"><p class=\"nco-info-block-content\"><strong>Info:<\/strong> This guide is intended for single interface configurations only, VLAN interfaces on bonded interfaces follow a similar configuration, however the primary interface at this point will be called something like &#8220;bond0&#8221; as referenced in the bonding guide.<\/p><\/div>\n\n\n\n<pre class=\"wp-block-preformatted\">auto em1.1000 \n     iface em1.1000 inet static \n     address 192.0.2.1 \n     netmask 255.255.255.0<\/pre>\n\n\n\n<ol class=\"wp-block-list\" start=\"8\"><li>Bring up the VLAN interface by either restarting the networking stack or issuing the up command manually<\/li><\/ol>\n\n\n\n<pre class=\"wp-block-preformatted\">Debian 6\/Ubuntu 12: \"\/etc\/init.d\/networking stop; \/etc\/init.d\/networking start\" \nDebian 7\/Ubuntu 14: \"\/etc\/init.d\/networking stop; \/etc\/init.d\/networking start\" \nDebian 8\/Ubuntu 16: \"systemctl restart networking\"<\/pre>\n\n\n\n<ol class=\"wp-block-list\" start=\"7\"><li>The device should now be up and visible under the &#8220;ifconfig&#8221; or &#8220;ip address show&#8221; commands. You may test it by issuing a ping command to another machine that is already configured<\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"get-in-touch\"><strong>Get in touch<\/strong><\/h2>\n\n\n\n<p>If you need advice on VLAN Interfaces for Debian, we\u2019re here to help.<\/p>\n\n\n\n<p><strong>Call us on 0333 247 0222: <\/strong>Monday &#8211; Friday, 9am \u2013 5.30pm.<\/p>\n\n\n\n<p id=\"chat-to-us-on-livechat-monday-friday-9am-5-30pm\"><strong>Chat <strong>with<\/strong> us on LiveChat:<\/strong> Monday &#8211; Friday, 9am &#8211; 5.30pm.<\/p>\n\n\n\n<p id=\"write-to-us-send-us-a-support-ticket-from-your-simply-portal-and-we-ll-get-back-to-you-as-soon-as-we-can-https-portal-simplyhosting-com-site-login\"><strong>Write to us:<\/strong> Send us a support ticket from your <a href=\"https:\/\/portal.simplyhosting.com\/site\/login\/\">Simply portal<\/a> and we\u2019ll get back to you as soon as we can. <\/p>\n\n\n\n<p>If you don\u2019t have an account with Simply Hosting yet, you can also send our <a href=\"https:\/\/www.simplyhosting.com\/info\/contact-us\">Sales team<\/a> an enquiry and we&#8217;ll get back to you between <strong>9am<\/strong> and <strong>5.30pm<\/strong>, <strong>Monday<\/strong> to <strong>Friday<\/strong>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This step by step guide is for configuring VLAN interfaces on Debian based operating systems. For the following guide we will use the following data and assume that you are running all commands as the root user: Type Value VLAN Tag 1000 IP Address 192.0.2.1 Netmask 255.255.255.0 Device em1 Step-by-step guide How to do it: [&hellip;]<\/p>\n","protected":false},"author":2,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[13,24],"ht-kb-tag":[34,33],"class_list":["post-22","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-infrastructure","ht_kb_category-control-panel-os","ht_kb_tag-debian","ht_kb_tag-vlan"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>VLAN Interfaces on Debian - Support Centre - Simply Hosting &amp; Servers<\/title>\n<meta name=\"description\" content=\"This step by step guide is for configuring VLAN interfaces on Debian based operating systems.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.simplyhosting.com\/support\/articles\/vlan-interfaces-on-debian\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"VLAN Interfaces on Debian - Support Centre - Simply Hosting &amp; Servers\" \/>\n<meta property=\"og:description\" content=\"This step by step guide is for configuring VLAN interfaces on Debian based operating systems.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.simplyhosting.com\/support\/articles\/vlan-interfaces-on-debian\/\" \/>\n<meta property=\"og:site_name\" content=\"Support Centre - Simply Hosting &amp; Servers\" \/>\n<meta property=\"article:modified_time\" content=\"2022-02-16T10:31:21+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.simplyhosting.com\/support\/articles\/vlan-interfaces-on-debian\/\",\"url\":\"https:\/\/www.simplyhosting.com\/support\/articles\/vlan-interfaces-on-debian\/\",\"name\":\"VLAN Interfaces on Debian - Support Centre - Simply Hosting &amp; Servers\",\"isPartOf\":{\"@id\":\"https:\/\/www.simplyhosting.com\/support\/#website\"},\"datePublished\":\"2021-04-20T11:17:43+00:00\",\"dateModified\":\"2022-02-16T10:31:21+00:00\",\"description\":\"This step by step guide is for configuring VLAN interfaces on Debian based operating systems.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.simplyhosting.com\/support\/articles\/vlan-interfaces-on-debian\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.simplyhosting.com\/support\/articles\/vlan-interfaces-on-debian\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.simplyhosting.com\/support\/articles\/vlan-interfaces-on-debian\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.simplyhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"VLAN Interfaces on Debian\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.simplyhosting.com\/support\/#website\",\"url\":\"https:\/\/www.simplyhosting.com\/support\/\",\"name\":\"Support Centre - Simply Hosting &amp; Servers\",\"description\":\"Simply Hosting &amp; Servers Support Centre\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.simplyhosting.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"VLAN Interfaces on Debian - Support Centre - Simply Hosting &amp; Servers","description":"This step by step guide is for configuring VLAN interfaces on Debian based operating systems.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.simplyhosting.com\/support\/articles\/vlan-interfaces-on-debian\/","og_locale":"en_GB","og_type":"article","og_title":"VLAN Interfaces on Debian - Support Centre - Simply Hosting &amp; Servers","og_description":"This step by step guide is for configuring VLAN interfaces on Debian based operating systems.","og_url":"https:\/\/www.simplyhosting.com\/support\/articles\/vlan-interfaces-on-debian\/","og_site_name":"Support Centre - Simply Hosting &amp; Servers","article_modified_time":"2022-02-16T10:31:21+00:00","twitter_card":"summary_large_image","twitter_misc":{"Estimated reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.simplyhosting.com\/support\/articles\/vlan-interfaces-on-debian\/","url":"https:\/\/www.simplyhosting.com\/support\/articles\/vlan-interfaces-on-debian\/","name":"VLAN Interfaces on Debian - Support Centre - Simply Hosting &amp; Servers","isPartOf":{"@id":"https:\/\/www.simplyhosting.com\/support\/#website"},"datePublished":"2021-04-20T11:17:43+00:00","dateModified":"2022-02-16T10:31:21+00:00","description":"This step by step guide is for configuring VLAN interfaces on Debian based operating systems.","breadcrumb":{"@id":"https:\/\/www.simplyhosting.com\/support\/articles\/vlan-interfaces-on-debian\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.simplyhosting.com\/support\/articles\/vlan-interfaces-on-debian\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.simplyhosting.com\/support\/articles\/vlan-interfaces-on-debian\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.simplyhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"VLAN Interfaces on Debian"}]},{"@type":"WebSite","@id":"https:\/\/www.simplyhosting.com\/support\/#website","url":"https:\/\/www.simplyhosting.com\/support\/","name":"Support Centre - Simply Hosting &amp; Servers","description":"Simply Hosting &amp; Servers Support Centre","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.simplyhosting.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"}]}},"_links":{"self":[{"href":"https:\/\/www.simplyhosting.com\/support\/wp-json\/wp\/v2\/ht-kb\/22","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.simplyhosting.com\/support\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.simplyhosting.com\/support\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.simplyhosting.com\/support\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.simplyhosting.com\/support\/wp-json\/wp\/v2\/comments?post=22"}],"version-history":[{"count":5,"href":"https:\/\/www.simplyhosting.com\/support\/wp-json\/wp\/v2\/ht-kb\/22\/revisions"}],"predecessor-version":[{"id":367,"href":"https:\/\/www.simplyhosting.com\/support\/wp-json\/wp\/v2\/ht-kb\/22\/revisions\/367"}],"wp:attachment":[{"href":"https:\/\/www.simplyhosting.com\/support\/wp-json\/wp\/v2\/media?parent=22"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.simplyhosting.com\/support\/wp-json\/wp\/v2\/ht-kb-category?post=22"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.simplyhosting.com\/support\/wp-json\/wp\/v2\/ht-kb-tag?post=22"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}