{"id":1262,"date":"2024-05-05T19:16:05","date_gmt":"2024-05-06T00:16:05","guid":{"rendered":"https:\/\/techlensfocus.com\/?p=1262"},"modified":"2024-05-05T19:38:24","modified_gmt":"2024-05-06T00:38:24","slug":"cisco-packet-tracer-tutorial-configuring-vlan-trunks","status":"publish","type":"post","link":"https:\/\/techlensfocus.com\/index.php\/2024\/05\/05\/cisco-packet-tracer-tutorial-configuring-vlan-trunks\/","title":{"rendered":"Cisco Packet Tracer Tutorial: Configuring VLAN Trunks"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<div class=\"wp-block-ideabox-toc ib-block-toc\" data-anchors='h2,h3,h4,h5,h6' data-collapsable='true' ><div class=\"ib-toc-container ib-toc-list-style-numbers ib-toc-hierarchical ib-toc-expanded\"><div class=\"ib-toc-header\"><div class=\"ib-toc-header-title\">Table of Contents<\/div><div class=\"ib-toc-header-right\"><span class=\"ib-toc-icon-collapse\"><span class=\"dashicon dashicons dashicons-minus\"><\/span><\/span><span class=\"ib-toc-icon-expand\"><span class=\"dashicon dashicons dashicons-plus\"><\/span><\/span><\/div><\/div><div class=\"ib-toc-separator\" style=\"height:2px\"><\/div><div class=\"ib-toc-body\"><ol class=\"ib-toc-anchors\"><\/ol><\/div><\/div><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>Trunking allows us to carry traffic for multiple VLANs across a single physical link between Cisco switches. This is achieved by encapsulating VLAN information within the Ethernet frame using protocols like 802.1Q.<\/p>\n\n\n\n<p>In this post, we&#8217;ll explore configuring Trunk on Cisco switches using Packet Tracer to enable communication between VLANs. Before we dive in, make sure to check out <a href=\"https:\/\/techlensfocus.com\/index.php\/2024\/04\/22\/cisco-packet-tracer-tutorial-vlan-configuration\/\" target=\"_blank\" rel=\"noopener\" title=\"\">this post<\/a> if you want to learn about VLAN configuration. Additionally, we talk about Manual Trunking and Dynamic Trunking Protocol (DTP).<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Manual Trunking vs. Dynamic Trunking Protocol (DTP)<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<p>Both manual trunking and DTP (Dynamic Trunking Protocol) allow you to configure switch ports for carrying traffic from multiple VLANs, but they achieve this in different ways:<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Manual Trunking<\/h3>\n\n\n\n<p><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Offers more granular control over the trunking configuration.<\/li>\n\n\n\n<li>Requires explicit configuration on both switch ports involved in the trunk.<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Dynamic Trunking Protocol (DTP)<\/h3>\n\n\n\n<p><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Automates trunk negotiation between Cisco devices.<\/li>\n\n\n\n<li>Simplifies configuration but can lead to unexpected behavior if not carefully managed.<\/li>\n<\/ul>\n\n\n\n<p>DTP have many negation mode available:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Desirable (default)<\/strong>: Attempts to establish a trunk but falls back to access mode if negotiation.<\/li>\n\n\n\n<li><strong>On (trunking mode)<\/strong>: Forces the port into trunk mode, potentially causing issues if the other device doesn&#8217;t support DTP.<\/li>\n\n\n\n<li><strong>Auto<\/strong>: Only initiates trunk negotiation, requiring the other device to also be in auto or desirable.<\/li>\n\n\n\n<li><strong>Nonnegotiate<\/strong>: Disables DTP negotiation altogether.<\/li>\n<\/ul>\n\n\n\n<p>There are many cases when we use DTP. For instance, in this case, if we have a <strong>DTP <\/strong>port set to <strong>Dynamic-Auto<\/strong> on <strong>Switch 1<\/strong>, when connect that port to <strong>Switch 2<\/strong> also set as <strong>Dynamic-Auto<\/strong>, <strong>DTP <\/strong>port, we will automatically have <strong>Access link <\/strong>between two switches.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"650\" height=\"193\" src=\"https:\/\/techlensfocus.com\/wp-content\/uploads\/2024\/04\/05.DTP1_-1.png\" alt=\"\" class=\"wp-image-1344\" srcset=\"https:\/\/techlensfocus.com\/wp-content\/uploads\/2024\/04\/05.DTP1_-1.png 650w, https:\/\/techlensfocus.com\/wp-content\/uploads\/2024\/04\/05.DTP1_-1-300x89.png 300w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \/><\/figure><\/div>\n\n\n<p>However, in this case, if we have one end of the switch (<strong>Switch 1<\/strong>) to be set to <strong>Dynamic-Auto<\/strong> and the other end (<strong>Switch 2<\/strong>) is set to <strong>Dynamic-Desirable<\/strong>, we will have an automatic <strong>Trunk link <\/strong>and add all VLANs to it.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"655\" height=\"215\" src=\"https:\/\/techlensfocus.com\/wp-content\/uploads\/2024\/04\/06.DTP2_-1.png\" alt=\"\" class=\"wp-image-1343\" srcset=\"https:\/\/techlensfocus.com\/wp-content\/uploads\/2024\/04\/06.DTP2_-1.png 655w, https:\/\/techlensfocus.com\/wp-content\/uploads\/2024\/04\/06.DTP2_-1-300x98.png 300w\" sizes=\"auto, (max-width: 655px) 100vw, 655px\" \/><\/figure><\/div>\n\n\n<p>And in this case, we have a <strong>trunk port<\/strong> manually configured on <strong>Switch 1<\/strong>, and on <strong>Switch 2<\/strong> is set to <strong>Dynamic-Auto<\/strong>, <strong>DTP<\/strong>, we will automatically have a <strong>Trunk link <\/strong>between two switches.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"650\" height=\"197\" src=\"https:\/\/techlensfocus.com\/wp-content\/uploads\/2024\/04\/07.DTP3_.png\" alt=\"\" class=\"wp-image-1352\" srcset=\"https:\/\/techlensfocus.com\/wp-content\/uploads\/2024\/04\/07.DTP3_.png 650w, https:\/\/techlensfocus.com\/wp-content\/uploads\/2024\/04\/07.DTP3_-300x91.png 300w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \/><\/figure><\/div>\n\n\n<p>Below is the summary of DTP Possibilities:<\/p>\n\n\n\n<figure class=\"wp-block-table aligncenter is-style-regular\"><table><tbody><tr><td><strong>Scenario (Switch 1 \/ Switch 2)<\/strong><\/td><td><strong>Result<\/strong><\/td><td><strong>Security Risk<\/strong><\/td><\/tr><tr><td>Trunk \/ Trunk (DTP on)<\/td><td>Trunk Link Established<\/td><td>High &#8211; Forced trunking, bypasses negotiation<\/td><\/tr><tr><td>Desirable \/ Trunk<\/td><td>Trunk Link Established (if both support DTP)<\/td><td>Moderate &#8211; Unintended trunking on desirable switch<\/td><\/tr><tr><td>Desirable \/ Desirable (Default)<\/td><td>Trunk Link Established (if both support DTP) or Fallback to <strong>Access Mode<\/strong> (if negotiation fails)<\/td><td>Low &#8211; Negotiation prevents accidental trunking<\/td><\/tr><tr><td>Desirable \/ Auto<\/td><td>Trunk Link Established (if both initiate negotiation)<\/td><td>Moderate &#8211; Unintended trunking on desirable switch<\/td><\/tr><tr><td>Auto \/ Auto<\/td><td>Fallback to<strong> Access Mode<\/strong> (unless both initiate negotiation simultaneously)<\/td><td>None &#8211; Requires specific timing for trunk formation<\/td><\/tr><tr><td>Nonegotiate \/ Any Mode<\/td><td>Switch with nonegotiate remains in <strong>Access Mode<\/strong><\/td><td>None &#8211; Prevents accidental trunking<\/td><\/tr><tr><td>Desirable \/ Nonegotiate<\/td><td>Switch with nonegotiate remains in <strong>Access Mode<\/strong>, Desirable switch falls back to <strong>Down<\/strong><\/td><td>Moderate (Desirable switch) &#8211; Potential configuration error or security measure<\/td><\/tr><tr><td>Auto \/ Nonegotiate<\/td><td>Switch with nonegotiate remains in <strong>Access Mode<\/strong>, Auto switch falls back to <strong>Down<\/strong><\/td><td>Low (Auto switch) &#8211; Requires manual intervention<\/td><\/tr><tr><td>Auto \/ Trunk<\/td><td>Trunk Link Established (if Auto switch responds to Trunk initiation)<\/td><td>Moderate (depends on switch configuration) &#8211; Potential for unintended trunking<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Recommendation<\/h3>\n\n\n\n<p><\/p>\n\n\n\n<p>DTP can be useful for quick setups in controlled environments where all devices are Cisco switches. However, you should perform manual trunking for its security and control benefits. Trunk link can give access to all VLANs in the network, so a misconfigured trunk could expose sensitive data if unauthorized access occurs.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Lab 1: Manual Trunking<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Network Topology<\/h3>\n\n\n\n<p><\/p>\n\n\n\n<p>Here is the network topology:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"550\" height=\"496\" src=\"https:\/\/techlensfocus.com\/wp-content\/uploads\/2024\/04\/01.lab_.png\" alt=\"\" class=\"wp-image-1271\" style=\"width:401px;height:auto\" srcset=\"https:\/\/techlensfocus.com\/wp-content\/uploads\/2024\/04\/01.lab_.png 550w, https:\/\/techlensfocus.com\/wp-content\/uploads\/2024\/04\/01.lab_-300x271.png 300w\" sizes=\"auto, (max-width: 550px) 100vw, 550px\" \/><\/figure><\/div>\n\n\n<ul class=\"wp-block-list\">\n<li>On <strong>Switch 1<\/strong>, we&#8217;ll configure <strong>F0\/1<\/strong> on <strong>VLAN 10<\/strong> and <strong>F0\/4<\/strong> on <strong>VLAN 20<\/strong> <\/li>\n\n\n\n<li>On <strong>Switch 2<\/strong>, we&#8217;ll configure <strong>F0\/1<\/strong> on <strong>VLAN 10<\/strong> and <strong>F0\/4<\/strong> on <strong>VLAN 20<\/strong><\/li>\n\n\n\n<li><strong>VLAN 10<\/strong> is named &#8220;<strong>HR<\/strong>&#8221; and <strong>VLAN 20 <\/strong>is named &#8220;<strong>Marketing<\/strong>&#8220;<\/li>\n\n\n\n<li>We configure the Trunk link on <strong>F0\/24<\/strong> on both switches<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Create VLANs on Switch 1 and Switch 2<\/h3>\n\n\n\n<p><\/p>\n\n\n\n<p>First, we check the running configuration on <strong>Switch 1<\/strong> with the command &#8220;<strong>show running-config<\/strong>&#8220;. We should see port <strong>F0\/1 <\/strong>and <strong>F0\/4<\/strong> currently don&#8217;t have any configuration on them. <\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Switch1>enable\nSwitch1#show running-config\nBuilding configuration...\n\nCurrent configuration : 1080 bytes\n!\ninterface FastEthernet0\/1\n!\ninterface FastEthernet0\/4<\/pre>\n\n\n\n<p>Next, we configure the VLANs<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Switch1>enable\nSwitch1#configure terminal\nEnter configuration commands, one per line.  End with CNTL\/Z.\nSwitch1(config)#vlan 10\nSwitch1(config-vlan)#name HR\nSwitch1(config-vlan)#exit\nSwitch1(config)#vlan 20\nSwitch1(config-vlan)#name Marketing\nSwitch1(config-vlan)#exit\nSwitch1(config)#do show vlan brief\n\nVLAN Name                             Status    Ports\n---- -------------------------------- --------- -------------------------------\n1    default                          active    Fa0\/1, Fa0\/2, Fa0\/3, Fa0\/4\n                                                Fa0\/5, Fa0\/6, Fa0\/7, Fa0\/8\n                                                Fa0\/9, Fa0\/10, Fa0\/11, Fa0\/12\n                                                Fa0\/13, Fa0\/14, Fa0\/15, Fa0\/16\n                                                Fa0\/17, Fa0\/18, Fa0\/19, Fa0\/20\n                                                Fa0\/21, Fa0\/22, Fa0\/23, Fa0\/24\n                                                Gig0\/1, Gig0\/2\n10   HR                               active    \n20   Marketing                        active    <\/pre>\n\n\n\n<p>After that, assign ports to <strong>VLAN 10<\/strong> and <strong>VLAN 20<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Switch1>enable\nSwitch1#configure terminal \nEnter configuration commands, one per line.  End with CNTL\/Z.\nSwitch1(config)#int f0\/1\nSwitch1(config-if)#switchport mode access\nSwitch1(config-if)#switchport access vlan 10\nSwitch1(config-if)#exit\nSwitch1(config)#int f0\/4\nSwitch1(config-if)#switchport mode access\nSwitch1(config-if)#switchport access vlan 20\nSwitch1(config-if)#do show vlan brief\n\nVLAN Name                             Status    Ports\n---- -------------------------------- --------- -------------------------------\n1    default                          active    Fa0\/2, Fa0\/3, Fa0\/5, Fa0\/6\n                                                Fa0\/7, Fa0\/8, Fa0\/9, Fa0\/10\n                                                Fa0\/11, Fa0\/12, Fa0\/13, Fa0\/14\n                                                Fa0\/15, Fa0\/16, Fa0\/17, Fa0\/18\n                                                Fa0\/19, Fa0\/20, Fa0\/21, Fa0\/22\n                                                Fa0\/23, Fa0\/24, Gig0\/1, Gig0\/2\n10   HR                               active    Fa0\/1\n20   Marketing                        active    Fa0\/4<\/pre>\n\n\n\n<p>We have finished creating VLANs on <strong>Switch 1<\/strong>, you should repeat the same steps above for <strong>Switch 2<\/strong>. When you done, move on to the next section. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Enabling Trunking<\/h3>\n\n\n\n<p><\/p>\n\n\n\n<p>For testing purpose, before configuring the trunk link, we won&#8217;t be able to ping <strong>PC2 <\/strong>(10.0.0.11, VLAN 10) on <strong>Switch 2<\/strong> from <strong>PC1 <\/strong>(10.0.0.10, VLAN 10) on <strong>Switch 1<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"971\" height=\"256\" src=\"https:\/\/techlensfocus.com\/wp-content\/uploads\/2024\/04\/02.ping-test1.png\" alt=\"\" class=\"wp-image-1291\" srcset=\"https:\/\/techlensfocus.com\/wp-content\/uploads\/2024\/04\/02.ping-test1.png 971w, https:\/\/techlensfocus.com\/wp-content\/uploads\/2024\/04\/02.ping-test1-300x79.png 300w, https:\/\/techlensfocus.com\/wp-content\/uploads\/2024\/04\/02.ping-test1-768x202.png 768w\" sizes=\"auto, (max-width: 971px) 100vw, 971px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Now let&#8217;s build the trunk link. We will configure port <strong>F0\/24<\/strong>. In this case, we choose<strong> Switch 1<\/strong> to configure the trunk link: <\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Switch1#enable\nSwitch1#configure terminal\nEnter configuration commands, one per line.  End with CNTL\/Z.\nSwitch1(config)#int f0\/24\nSwitch1(config-if)#switchport mode trunk\n\nSwitch1(config-if)#\n%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0\/24, changed state to down\n\n%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0\/24, changed state to up\n\nSwitch1(config-if)#switchport trunk allow vlan 10,20\nSwitch1(config-if)#exit<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Enter interface configuration mode: &#8220;<strong>int f0\/24<\/strong>&#8220;<\/li>\n\n\n\n<li>Set interface mode to trunk: &#8220;<strong>switchport mode trunk<\/strong>&#8220;<\/li>\n\n\n\n<li>Allow specific VLANs on the trunk: &#8220;<strong>switchport trunk allow vlan 10,20<\/strong>&#8220;<\/li>\n<\/ul>\n\n\n\n<p>As you can see, after configuring <strong>F0\/24<\/strong> as a trunk port and allowing <strong>VLANs 10<\/strong> and <strong>20 <\/strong>on the trunk, the interface goes through a state change (&#8220;<strong>up<\/strong>&#8221; and &#8220;<strong>down<\/strong>&#8220;) due to the configuration changes being applied. This is indicated by the <strong>%LINEPROTO-5-UPDOWN <\/strong>message.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Verify Trunking<\/h3>\n\n\n\n<p><\/p>\n\n\n\n<p>To look at the status of that trunk link, we use the command &#8220;<strong>show interfaces trunk<\/strong>&#8220;. The output shows that interface <strong>Fa0\/24<\/strong> is configured as a trunk port, allowing <strong>VLANs 10 <\/strong>and <strong>20 <\/strong>to traverse the trunk. It also indicates that both VLANs are currently active and forwarding traffic. The Mode is &#8220;<strong>on<\/strong>&#8221; indicates that the interface is in trunking mode.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Switch1#show interfaces trunk\nPort        Mode         Encapsulation  Status        Native vlan\nFa0\/24      on           802.1q         trunking      1\n\nPort        Vlans allowed on trunk\nFa0\/24      10,20\n\nPort        Vlans allowed and active in management domain\nFa0\/24      10,20\n\nPort        Vlans in spanning tree forwarding state and not pruned\nFa0\/24      10,20<\/pre>\n\n\n\n<p>If you use command &#8220;<strong>show running-config<\/strong>&#8220;, you will see the configuration for port <strong>F0\/24 <\/strong>also<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Switch1#show  running-config \nBuilding configuration...\n\nCurrent configuration : 1242 bytes\n!\ninterface FastEthernet0\/24\n switchport trunk allowed vlan 10,20\n switchport mode trunk<\/pre>\n\n\n\n<p>We have finished configuring trunk port on <strong>Switch 1<\/strong>. Now let&#8217;s take a look at <strong>Switch 2<\/strong> trunk status<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Switch2>enable\nSwitch2#show interfaces trunk\nPort        Mode         Encapsulation  Status        Native vlan\nFa0\/24      auto         n-802.1q       trunking      1\n\nPort        Vlans allowed on trunk\nFa0\/24      1-1005\n\nPort        Vlans allowed and active in management domain\nFa0\/24      1,10,20\n\nPort        Vlans in spanning tree forwarding state and not pruned\nFa0\/24      1,10,20<\/pre>\n\n\n\n<p>You will notice that the <strong>Dynamic Trunking Protocol (DTP)<\/strong> automatically figure out <strong>F0\/24<\/strong> is a trunk port with the Mode is &#8220;<strong>auto<\/strong>&#8220;, meaning the switch will negotiate the trunking mode with its neighboring device. Also, <strong>VLANs 1 <\/strong>through <strong>1005 <\/strong>are allowed on the trunk port. This is the default behavior when using the &#8220;<strong>auto<\/strong>&#8221; mode for trunk negotiation.<\/p>\n\n\n\n<p>Next,  use command &#8220;<strong>show running-config<\/strong>&#8221; to see the configuration for port <strong>F0\/24<\/strong> on <strong>Switch 2<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Switch2#show running-config \nBuilding configuration...\n\nCurrent configuration : 1183 bytes\n!\ninterface FastEthernet0\/24<\/pre>\n\n\n\n<p>You will see that although the trunk link is configured automatically, the configuration for port <strong>F0\/24<\/strong> on <strong>Switch 2<\/strong> is blank. Dynamic Trunking Protocol (DTP) is used to negotiate trunking with the neighboring device.<\/p>\n\n\n\n<p>Let&#8217;s manually configure interface <strong>F0\/24<\/strong> as trunk port on<strong> Switch 2<\/strong>. This is a preferable method since we have full control over its configuration.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Switch2#configure terminal \nEnter configuration commands, one per line.  End with CNTL\/Z.\nSwitch2(config)#int f0\/24\nSwitch2(config-if)#switchport mode trunk\nSwitch2(config-if)#switchport trunk allow vlan 10,20\nSwitch2(config-if)#do show interfaces trunk\nPort        Mode         Encapsulation  Status        Native vlan\nFa0\/24      on           802.1q         trunking      1\n\nPort        Vlans allowed on trunk\nFa0\/24      10,20\n\nPort        Vlans allowed and active in management domain\nFa0\/24      10,20\n\nPort        Vlans in spanning tree forwarding state and not pruned\nFa0\/24      20<\/pre>\n\n\n\n<p>Now you can see only <strong>VLAN 10<\/strong> and <strong>20 <\/strong>is allowed on the trunk link on <strong>Switch 2<\/strong>. Next, let&#8217;s test to see if we can ping <strong>PC2 <\/strong>(10.0.0.11, VLAN 10) on <strong>Switch 2<\/strong> from <strong>PC1 <\/strong>(10.0.0.10, VLAN 10) on <strong>Switch 1<\/strong>. The ping should be successful:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"790\" height=\"213\" src=\"https:\/\/techlensfocus.com\/wp-content\/uploads\/2024\/04\/03.ping-test2.png\" alt=\"\" class=\"wp-image-1318\" style=\"width:857px;height:auto\" srcset=\"https:\/\/techlensfocus.com\/wp-content\/uploads\/2024\/04\/03.ping-test2.png 790w, https:\/\/techlensfocus.com\/wp-content\/uploads\/2024\/04\/03.ping-test2-300x81.png 300w, https:\/\/techlensfocus.com\/wp-content\/uploads\/2024\/04\/03.ping-test2-768x207.png 768w\" sizes=\"auto, (max-width: 790px) 100vw, 790px\" \/><\/figure>\n\n\n\n<p>The ping will also be successful if we ping <strong>PC4 <\/strong>(172.16.0.11, VLAN 20) on <strong>Switch 2<\/strong> from <strong>PC3 <\/strong>(172.16.0.10, VLAN 20) on <strong>Switch 1<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"648\" height=\"215\" src=\"https:\/\/techlensfocus.com\/wp-content\/uploads\/2024\/04\/04.pingtest3.png\" alt=\"\" class=\"wp-image-1324\" style=\"width:856px;height:auto\" srcset=\"https:\/\/techlensfocus.com\/wp-content\/uploads\/2024\/04\/04.pingtest3.png 648w, https:\/\/techlensfocus.com\/wp-content\/uploads\/2024\/04\/04.pingtest3-300x100.png 300w\" sizes=\"auto, (max-width: 648px) 100vw, 648px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Lab 2: Dynamic Trunking Protocol (DTP)<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Network Topology<\/h3>\n\n\n\n<p><\/p>\n\n\n\n<p>Let&#8217;s examine the DTP behavior with this lab 2. We will configure some switches and go through some possibilities.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>F0\/24<\/strong> on <strong>Switch 2<\/strong> will have no configuration on it, meaning that <strong>F0\/24<\/strong> is DTP port by default<\/li>\n\n\n\n<li>We modify <strong>Switch 1<\/strong> to go through different possibilities<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"563\" height=\"167\" src=\"https:\/\/techlensfocus.com\/wp-content\/uploads\/2024\/04\/09.Lab2_.png\" alt=\"\" class=\"wp-image-1367\" srcset=\"https:\/\/techlensfocus.com\/wp-content\/uploads\/2024\/04\/09.Lab2_.png 563w, https:\/\/techlensfocus.com\/wp-content\/uploads\/2024\/04\/09.Lab2_-300x89.png 300w\" sizes=\"auto, (max-width: 563px) 100vw, 563px\" \/><\/figure><\/div>\n\n\n<p>On <strong>Switch 2<\/strong>, use commands &#8220;<strong>show int trunk<\/strong>&#8221; and  &#8220;<strong>show interface f0\/24 switchport<\/strong>&#8220;, we should see no trunk port configure yet.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Switch2>enable\nSwitch2#show int trunk\n\n\nSwitch2#show interface f0\/24 switchport\nName: Fa0\/24\nSwitchport: Enabled\nAdministrative Mode: dynamic auto\nOperational Mode: static access\nAdministrative Trunking Encapsulation: dot1q\nOperational Trunking Encapsulation: native\nNegotiation of Trunking: On\nAccess Mode VLAN: 1 (default)\nTrunking Native Mode VLAN: 1 (default)<\/pre>\n\n\n\n<p>From the output, we see that <strong>F0\/24<\/strong> is under <strong>VLAN 1<\/strong>, meaning that <strong>F0\/24<\/strong> is an access port. If you use &#8220;<strong>show vlan brief<\/strong>&#8220;, you can see <strong>F0\/24<\/strong> belong to <strong>VLAN 1<\/strong> either.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Switch2#show vlan brief\n\nVLAN Name                             Status    Ports\n---- -------------------------------- --------- -------------------------------\n1    default                          active    Fa0\/1, Fa0\/2, Fa0\/3, Fa0\/4\n                                                Fa0\/5, Fa0\/6, Fa0\/7, Fa0\/8\n                                                Fa0\/9, Fa0\/10, Fa0\/11, Fa0\/12\n                                                Fa0\/13, Fa0\/14, Fa0\/15, Fa0\/16\n                                                Fa0\/17, Fa0\/18, Fa0\/19, Fa0\/20\n                                                Fa0\/21, Fa0\/22, Fa0\/23, Fa0\/24\n                                                Gig0\/1, Gig0\/2<\/pre>\n\n\n\n<p>Do the same commands on<strong> Switch 1<\/strong>, you will notice that <strong>F0\/24<\/strong> is also an access port, no configuration on it.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Switch1>enable\nSwitch1#show int trunk\n\n\nSwitch1#show interface f0\/24 switchport\nName: Fa0\/24\nSwitchport: Enabled\nAdministrative Mode: dynamic auto\nOperational Mode: static access\nAdministrative Trunking Encapsulation: dot1q\nOperational Trunking Encapsulation: native\nNegotiation of Trunking: On\nAccess Mode VLAN: 1 (default)\nTrunking Native Mode VLAN: 1 (default)\n\nSwitch1#show vlan brief\n\nVLAN Name                             Status    Ports\n---- -------------------------------- --------- -------------------------------\n1    default                          active    Fa0\/1, Fa0\/2, Fa0\/3, Fa0\/4\n                                                Fa0\/5, Fa0\/6, Fa0\/7, Fa0\/8\n                                                Fa0\/9, Fa0\/10, Fa0\/11, Fa0\/12\n                                                Fa0\/13, Fa0\/14, Fa0\/15, Fa0\/16\n                                                Fa0\/17, Fa0\/18, Fa0\/19, Fa0\/20\n                                                Fa0\/21, Fa0\/22, Fa0\/23, Fa0\/24\n                                                Gig0\/1, Gig0\/2<\/pre>\n\n\n\n<p>So, we can see that both ends at the moment are configured as DTP <strong>Dynamic-Auto<\/strong>, it means we have an <strong>access link<\/strong> between the two switches. In other words, we are connected with<strong> VLAN 1<\/strong> between <strong>Switch 1<\/strong> and <strong>Switch 2<\/strong>. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Change from Dynamic-Auto to Dynamic-Desirable on Switch 1<\/h3>\n\n\n\n<p><\/p>\n\n\n\n<p>On <strong>Switch 1<\/strong>, to change the port to be <strong>Dynamic-Desirable<\/strong>, the command is &#8220;<strong>switchport mode dynamic desirable<\/strong>&#8220;: <\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Switch1>enable\nSwitch1#configure terminal\nEnter configuration commands, one per line.  End with CNTL\/Z.\nSwitch1(config)#int f0\/24\nSwitch1(config-if)#switchport mode dynamic desirable\n\nSwitch1(config-if)#\n%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0\/24, changed state to up\n\n%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0\/24, changed state to down\n\n%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0\/24, changed state to up\n\nSwitch1(config-if)#exit<\/pre>\n\n\n\n<p>Now, we take a look at the port status of <strong>Switch 1<\/strong>. Notice that port <strong>F0\/24<\/strong> has a trunking status configured automatically:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Switch1#show int trunk\nPort        Mode         Encapsulation  Status        Native vlan\nFa0\/24      desirable    n-802.1q       trunking      1\n\nPort        Vlans allowed on trunk\nFa0\/24      1-1005\n\nPort        Vlans allowed and active in management domain\nFa0\/24      1\n\nPort        Vlans in spanning tree forwarding state and not pruned\nFa0\/24      1<\/pre>\n\n\n\n<p>You should see the same result in the<strong> Switch 2<\/strong>, with <strong>F0\/24<\/strong> operate as trunk port:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Switch2#show int trunk\nPort        Mode         Encapsulation  Status        Native vlan\nFa0\/24      auto         n-802.1q       trunking      1\n\nPort        Vlans allowed on trunk\nFa0\/24      1-1005\n\nPort        Vlans allowed and active in management domain\nFa0\/24      1\n\nPort        Vlans in spanning tree forwarding state and not pruned\nFa0\/24      1<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Turning off DTP<\/h3>\n\n\n\n<p><\/p>\n\n\n\n<p>In reality, you should restrict<strong> VLAN 1<\/strong> from traversing the trunk because of security risk. Trunk ports give an end user a lot of access to the network. Also, we don&#8217;t want our ports to be automatically configured  for trunk ports without any administration.<\/p>\n\n\n\n<p>Let&#8217;s turn off DTP on Switch 2:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Switch2#configure terminal\nEnter configuration commands, one per line.  End with CNTL\/Z.\nSwitch2(config)#int range f0\/1 - 24 , g0\/1 - 2\nSwitch2(config-if-range)#switchport mode access\nSwitch2(config-if-range)#%SPANTREE-2-RECV_PVID_ERR: Received 802.1Q BPDU on non trunk FastEthernet0\/24 VLAN1.\n\n%SPANTREE-2-BLOCK_PVID_LOCAL: Blocking FastEthernet0\/24 on VLAN0001. Inconsistent port type.\n\n\nSwitch2(config-if-range)#switchport nonegotiate\nSwitch2(config-if-range)#exit<\/pre>\n\n\n\n<p>Next, we check the port status of <strong>Switch 2<\/strong>, notice that negotiation of Trunking is <strong>Off<\/strong> , and there is no trunk port configured under output of command &#8220;<strong>show int trunk<\/strong>&#8220;:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Switch2#show int trunk\n\n\nSwitch2#show interface f0\/24 switchport\nName: Fa0\/24\nSwitchport: Enabled\nAdministrative Mode: static access\nOperational Mode: static access\nAdministrative Trunking Encapsulation: dot1q\nOperational Trunking Encapsulation: native\nNegotiation of Trunking: Off\nAccess Mode VLAN: 1 (default)\nTrunking Native Mode VLAN: 1 (default)<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<p>To sum up, while DTP offers convenience for quick setups, understanding its limitations and potential security risks is crucial. For secure and controlled multi-VLAN communication, manual trunking is the recommended approach.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to configure trunking on Cisco switch for efficient communication between VLANs. <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[6,7],"tags":[57,58,55],"class_list":["post-1262","post","type-post","status-publish","format-standard","hentry","category-it","category-networking","tag-packet-tracer","tag-trunking","tag-vlan"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/techlensfocus.com\/index.php\/wp-json\/wp\/v2\/posts\/1262","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techlensfocus.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techlensfocus.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techlensfocus.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techlensfocus.com\/index.php\/wp-json\/wp\/v2\/comments?post=1262"}],"version-history":[{"count":124,"href":"https:\/\/techlensfocus.com\/index.php\/wp-json\/wp\/v2\/posts\/1262\/revisions"}],"predecessor-version":[{"id":1399,"href":"https:\/\/techlensfocus.com\/index.php\/wp-json\/wp\/v2\/posts\/1262\/revisions\/1399"}],"wp:attachment":[{"href":"https:\/\/techlensfocus.com\/index.php\/wp-json\/wp\/v2\/media?parent=1262"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techlensfocus.com\/index.php\/wp-json\/wp\/v2\/categories?post=1262"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techlensfocus.com\/index.php\/wp-json\/wp\/v2\/tags?post=1262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}