{"id":199,"date":"2020-09-26T13:24:54","date_gmt":"2020-09-26T13:24:54","guid":{"rendered":"https:\/\/dft.wiki\/?p=199"},"modified":"2021-02-07T20:14:35","modified_gmt":"2021-02-07T20:14:35","slug":"vlan-and-trunk-on-cisco-switches","status":"publish","type":"post","link":"https:\/\/dft.wiki\/?p=199","title":{"rendered":"VLAN and TRUNK on Cisco Switches"},"content":{"rendered":"<p>Given the scenario, where the blocks blue and red are groups of computers in a different physical location (building of floors).<\/p>\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" class=\"wp-image-388\" src=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/image-62.png\" alt=\"\" \/><\/figure>\n<p>The VLAN1 is the default VLAN on all ports and any computer can reach the others with no filter or restriction.<\/p>\n<p>The connection between both switches works as a &#8220;bridge&#8221;.<\/p>\n<p>Dividing the network in VLANs increase security, reduces the number of routers and reduces the broadcast messages in the segments.<\/p>\n<p>The &#8220;bridge&#8221; that interconnects switches becomes a Trunk Link.<\/p>\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" class=\"wp-image-392\" src=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/image-65.png\" alt=\"\" \/><\/figure>\n<p>Configuration:<\/p>\n<div class=\"wp-block-columns\">\n<div class=\"wp-block-column\">\n<p>Switch1<\/p>\n<pre>enable <br \/>configure terminal <br \/>hostname Switch1<br \/>no ip domain lookup<br \/>line con 0<br \/>logging synchronous<br \/><br \/>vlan 10<br \/>name Pink<br \/>vlan 20<br \/>name Green<br \/>vlan 30<br \/>name Orange<br \/><br \/>interface f0\/1<br \/>switchport mode access<br \/>switchport access vlan 10<br \/>interface f0\/2<br \/>switchport mode access<br \/>switchport access vlan 20<br \/>interface f0\/3<br \/>switchport mode access<br \/>switchport access vlan 30<br \/><br \/>interface range f0\/4-24<br \/>shutdown<br \/><br \/>interface g0\/1<br \/>switchport mode trunk<\/pre>\n<\/div>\n<div class=\"wp-block-column\">\n<p>Switch2<\/p>\n<pre>enable <br \/>configure terminal <br \/>hostname Switch2<br \/>no ip domain lookup<br \/>line con 0<br \/>logging synchronous<br \/><br \/>vlan 10<br \/>name Pink<br \/>vlan 20<br \/>name Green<br \/>vlan 30<br \/>name Orange<br \/><br \/>interface f0\/1<br \/>switchport mode access<br \/>switchport access vlan 30<br \/>interface f0\/2<br \/>switchport mode access<br \/>switchport access vlan 10<br \/>interface f0\/3<br \/>switchport mode access<br \/>switchport access vlan 20<br \/><br \/>interface range f0\/4-24<br \/>shutdown<br \/><br \/>interface g0\/1<br \/>switchport mode trunk<\/pre>\n<\/div>\n<\/div>\n<p>Now, even if all the computers get IPs in the same network, they will not be able to communicate with each other if they are not in the same VLAN.<\/p>\n<p>To check the configuration in each Switch issue the commands:<\/p>\n<pre>show vlan brief<br \/>show interface trunk<\/pre>\n<p>Learn more about [<a href=\"https:\/\/www.youtube.com\/watch?v=oo-hejIq3iQ\">VLAN<\/a> &#8211; NexGenT]<\/p>\n<p>Learn more about [<a href=\"https:\/\/www.youtube.com\/watch?v=m2PaaICoGzw\">TRUNK<\/a> &#8211; Network Direction]<\/p>\n<p>The following Post is about centralizing the VLAN configuration in a server-client hierarchy, called VTP [<a href=\"https:\/\/dft.wiki\/?p=201\">Read It<\/a>].<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Given the scenario, where the blocks blue and red are groups of computers in a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-199","post","type-post","status-publish","format-standard","hentry","category-ccna"],"_links":{"self":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts\/199","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=199"}],"version-history":[{"count":5,"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts\/199\/revisions"}],"predecessor-version":[{"id":1028,"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts\/199\/revisions\/1028"}],"wp:attachment":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}