{"id":2398,"date":"2023-07-29T15:52:45","date_gmt":"2023-07-29T05:52:45","guid":{"rendered":"https:\/\/blog.hegars.com\/?p=2398"},"modified":"2024-09-14T20:23:11","modified_gmt":"2024-09-14T10:23:11","slug":"vlan","status":"publish","type":"post","link":"https:\/\/blog.hegars.com\/?p=2398","title":{"rendered":"VLAN"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Debian Enable VLANS<\/h2>\n\n\n\n<p>lsmod | grep 8021q<br>dpkg-query -l | grep vlan<\/p>\n\n\n\n<p><br>apt-get install vlan<br>modprobe 8021q &amp;&amp; echo &#8220;8021q&#8221; >> \/etc\/modules<br><\/p>\n\n\n\n<p>ls \/sys\/class\/net<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">VLAN types<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">802.1q &#8211; C-VID &#8211; Customer VLAN<\/h3>\n\n\n\n<p>Ethertype: 0x8100 <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">802.1ad &#8211; S-VID &#8211; QinQ Service VLAN<\/h3>\n\n\n\n<p>Ethertype: 0x88a8 (0x9100 non-standard)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Manually Stacking VLANs<\/h2>\n\n\n\n<p>ip link add link enp1s0 enp1s0.203 type vlan proto 802.1ad id 203<br>ip link add link enp1s0.203 enp1s0.303 type vlan proto 802.1q id 303<br>ip link add link enp1s0.203 enp1s0.303 type vlan proto 80<br>ip link set enp1s0.293 up<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Debian Interfaces file<\/h2>\n\n\n\n<p>allow-hotplug enp1s0<\/p>\n\n\n\n<p>iface enp1s0 inet dhcp<br>post-up ip link add link enp1s0 enp1s0.203 type vlan proto 802.1ad id 203<\/p>\n\n\n\n<p>auto enp1s0.203<br>iface enp1s0.203 inet dhcp<br>post-up ip link add link enp1s0.203 enp1s0.303 type vlan proto 802.1q id 303<\/p>\n\n\n\n<p>auto enp1s0.203.303<br>iface enp1s0.203.303 inet dhcp<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Real World example<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n# This file describes the network interfaces available on your system\n# and how to activate them. For more information, see interfaces(5).\n\nsource \/etc\/network\/interfaces.d\/*\n\n# The loopback network interface\nauto lo\niface lo inet loopback\n\n#10Bge interface\nauto enp6s0\niface enp6s0 inet manual\n        post-up ip link add link enp6s0 enp6s0.27 type vlan proto 802.1ad id 27\n\n#service vlan 27 to sunnet\nauto enp6s0.27\niface enp6s0.27 inet manual\n        post-up ip link add link enps6s0.27 enp6s0.27.100 type vlan proto 802.1q id 100\n\n#customer vlan on service vlan \nauto enp6s0.27.100\niface enp6s0.27.100 inet manual\n\n\n#1gbe interface\nauto enp8s0\niface enp8s0 inet manual\n\n#Interface setup from eth0 \nauto bridge0\niface bridge0 inet dhcp\n\n#Initial Bridge setup and add ports\n        bridge_ports enp6s0\n        up \/usr\/sbin\/brctl addbr bridge0\n#       up \/usr\/sbin\/brctl setageing bridge0 0\n#       up \/usr\/sbin\/brctl stp bridge0 off\n#\nauto bridge1\niface bridge1 inet static\n        address 10.38.27.128\n        netmask 255.255.255.0\n        bridge_ports enp6s0.27\n        up \/usr\/sbin\/brctl addbr bridge1\n\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>Debian Enable VLANS lsmod | grep 8021qdpkg-query -l | grep vlan apt-get install vlanmodprobe 8021q &amp;&amp; echo &#8220;8021q&#8221; >> \/etc\/modules ls \/sys\/class\/net VLAN types 802.1q &#8211; C-VID &#8211; Customer VLAN Ethertype: 0x8100 802.1ad &#8211; S-VID &#8211; QinQ Service VLAN Ethertype: 0x88a8 (0x9100 non-standard) Manually Stacking VLANs ip link add link enp1s0 enp1s0.203 type vlan proto [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-container-style":"default","site-container-layout":"default","site-sidebar-layout":"default","disable-article-header":"default","disable-site-header":"default","disable-site-footer":"default","disable-content-area-spacing":"default","footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.hegars.com\/index.php?rest_route=\/wp\/v2\/posts\/2398"}],"collection":[{"href":"https:\/\/blog.hegars.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.hegars.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.hegars.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.hegars.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2398"}],"version-history":[{"count":11,"href":"https:\/\/blog.hegars.com\/index.php?rest_route=\/wp\/v2\/posts\/2398\/revisions"}],"predecessor-version":[{"id":2571,"href":"https:\/\/blog.hegars.com\/index.php?rest_route=\/wp\/v2\/posts\/2398\/revisions\/2571"}],"wp:attachment":[{"href":"https:\/\/blog.hegars.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2398"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.hegars.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2398"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.hegars.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2398"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}