{"id":5529,"date":"2023-03-07T04:47:37","date_gmt":"2023-03-07T04:47:37","guid":{"rendered":"https:\/\/tst-amo.net.ua\/blog\/?p=5529"},"modified":"2023-03-07T08:42:41","modified_gmt":"2023-03-07T08:42:41","slug":"vlan-router-l2-switch","status":"publish","type":"post","link":"https:\/\/tst-amo.net.ua\/blog\/?p=5529","title":{"rendered":"VLAN router + L2 switch"},"content":{"rendered":"<h3><img decoding=\"async\" src=\"https:\/\/wiki.mikrotik.com\/images\/thumb\/c\/c7\/Basic_vlan_switching.png\/700px-Basic_vlan_switching.png\" alt=\"Alt text\" \/><\/h3>\n<h3><span id=\"Other_devices_with_built-in_switch_chip\" class=\"mw-headline\">Devices with built-in switch chip<\/span><\/h3>\n<div id=\"shbox\">\n<p><b>Warning:<\/b>\u00a0Not all devices with a switch chip are capable of VLAN switching on a hardware level, check the supported features for each switch chip, the compatibility table can be found\u00a0<a title=\"Manual:Switch Chip Features\" href=\"https:\/\/wiki.mikrotik.com\/wiki\/Manual:Switch_Chip_Features#Introduction\">Here<\/a>. If a device has\u00a0<code>VLAN table<\/code>\u00a0support, then it is capable of VLAN switching using the built-in switch chip. You can check the device&#8217;s switch chip either in the provided link or by using\u00a0<code>\/interface ethernet switch print<\/code><\/p>\n<\/div>\n<pre>\/interface bridge\r\nadd name=bridge1\r\n\/interface bridge port\r\nadd bridge=bridge1 interface=ether1 hw=yes\r\nadd bridge=bridge1 interface=ether2 hw=yes\r\nadd bridge=bridge1 interface=ether3 hw=yes\r\n\/interface ethernet switch vlan\r\nadd ports=ether1,ether2 switch=switch1 vlan-id=20\r\nadd ports=ether1,ether3 switch=switch1 vlan-id=30\r\nadd ports=ether1,switch1-cpu switch=switch1 vlan-id=99\r\n\/interface vlan\r\nadd interface=bridge1 vlan-id=99 name=MGMT\r\n\/ip address\r\nadd address=192.168.99.1\/24 interface=MGMT\r\n\/interface ethernet switch port\r\nset ether1 vlan-mode=secure vlan-header=add-if-missing\r\nset ether2 vlan-mode=secure vlan-header=always-strip default-vlan-id=20\r\nset ether3 vlan-mode=secure vlan-header=always-strip default-vlan-id=30\r\nset switch1-cpu vlan-header=leave-as-is vlan-mode=secure<\/pre>\n<h3><span id=\"Other_devices_without_a_built-in_switch_chip\" class=\"mw-headline\">devices without a built-in switch chip<\/span><\/h3>\n<p>It is possible to do VLAN filtering using the CPU, there are multiple ways to do it, but it is highly recommended by using bridge VLAN filtering.<\/p>\n<pre>\/interface bridge\r\nadd name=bridge1\r\n\/interface bridge port\r\nadd bridge=bridge1 interface=ether1 hw=no\r\nadd bridge=bridge1 interface=ether2 hw=no pvid=20\r\nadd bridge=bridge1 interface=ether3 hw=no pvid=30\r\n\/interface bridge vlan\r\nadd bridge=bridge1 tagged=ether1 untagged=ether2 vlan-ids=20\r\nadd bridge=bridge1 tagged=ether1 untagged=ether3 vlan-ids=30\r\nadd bridge=bridge1 tagged=ether1,bridge1 vlan-ids=99\r\n\/interface vlan\r\nadd interface=bridge1 vlan-id=99 name=MGMT\r\n\/ip address\r\nadd address=192.168.99.1\/24 interface=MGMT\r\n\/interface bridge\r\nset bridge1 vlan-filtering=yes<\/pre>\n<div class=\"pdfprnt-buttons pdfprnt-buttons-post pdfprnt-bottom-right\"><a href=\"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=wpv2posts5529&print=pdf\" class=\"pdfprnt-button pdfprnt-button-pdf\" target=\"_blank\"><img decoding=\"async\" src=\"https:\/\/tst-amo.net.ua\/blog\/wp-content\/plugins\/pdf-print\/images\/pdf.png\" alt=\"image_pdf\" title=\"View PDF\" \/><\/a><a href=\"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=wpv2posts5529&print=print\" class=\"pdfprnt-button pdfprnt-button-print\" target=\"_blank\"><img decoding=\"async\" src=\"https:\/\/tst-amo.net.ua\/blog\/wp-content\/plugins\/pdf-print\/images\/print.png\" alt=\"image_print\" title=\"Print Content\" \/><\/a><\/div>","protected":false},"excerpt":{"rendered":"<p>Devices with built-in switch chip Warning:\u00a0Not all devices with a switch chip are capable of VLAN switching on a hardware level, check the supported features for each switch chip, the compatibility table can be found\u00a0Here. If a device has\u00a0VLAN table\u00a0support, then it is capable of VLAN switching using the built-in switch chip. You can check &#8230;<\/p>\n<p><a href=\"https:\/\/tst-amo.net.ua\/blog\/?p=5529\" class=\"more-link\">Continue reading &lsquo;VLAN router + L2 switch&rsquo; &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23,316,38],"tags":[],"class_list":["post-5529","post","type-post","status-publish","format-standard","hentry","category-l2","category-mikrotik","category-vlan"],"_links":{"self":[{"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5529"}],"collection":[{"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5529"}],"version-history":[{"count":3,"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5529\/revisions"}],"predecessor-version":[{"id":5533,"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5529\/revisions\/5533"}],"wp:attachment":[{"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5529"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5529"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5529"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}