VLAN Trunk-----Trunk的配置

一.实验环境

  1. GNS3模拟器
  2. 4台VPC
  3. 两台c3725的路由器
  4. Windows10企业版(本机)

二.实验原理

  1. 利用Trunkzuo在两台交换机之间做一个中继链路
  2. 利用IEEE802.1q在中继中,做封装

三.网络拓扑图

四.实验步骤

1配置实验环境

 

2.分别配置PC4,PC5,PC6,PC7的IP地址

pc4>ip 192.168.10.10 255.255.255.0
pc5>ip 192.168.10.20 255.255.255.0
pc6>ip 192.168.10.30 255.255.255.0
pc7>ip 192.168.10.40 255.255.255.0

3.分别配置sw1,sw2

sw1的配置:

 关闭路由功能

sw1#conf t
sw1(config)#no ip routing

添加vlan10,vlan20,并查看vlan信息

sw1#conf t
sw1(config)#vlan 10,20
sw1(config)#do show vlan-sw b

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa1/0, Fa1/1, Fa1/2, Fa1/3
                                                Fa1/4, Fa1/5, Fa1/6, Fa1/7
                                                Fa1/8, Fa1/9, Fa1/10, Fa1/11
                                                Fa1/12, Fa1/13, Fa1/14, Fa1/15
10   VLAN0010                         active    
20   VLAN0020                         active    
1002 fddi-default                     act/unsup 
1003 token-ring-default               act/unsup 
1004 fddinet-default                  act/unsup 
1005 trnet-default                    act/unsup

分别把f1/0和f1/1端口分配给vlan10,vlan20,并查看vlan信息

sw1(config)#int f1/0
sw1(config-if)#sw mo acc
sw1(config-if)#sw acc vlan 10
sw1(config-if)#exit
sw1(config)#int f1/1
sw1(config-if)#sw mo acc
sw1(config-if)#sw acc vlan 20
sw1(config-if)#exit
sw1(config)#do show vlan-sw b

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa1/2, Fa1/3, Fa1/4, Fa1/5
                                                Fa1/6, Fa1/7, Fa1/8, Fa1/9
                                                Fa1/10, Fa1/11, Fa1/12, Fa1/13
                                                Fa1/14, Fa1/15
10   VLAN0010                         active    Fa1/0
20   VLAN0020                         active    Fa1/1
1002 fddi-default                     act/unsup 
1003 token-ring-default               act/unsup 
1004 fddinet-default                  act/unsup 
1005 trnet-default                    act/unsup 
sw1(config)#int f1/2

在f1/2端口设置trunk,并查看f1/2端口的信息,可以看接口改为了trunk

sw1(config)#int f1/2
sw1(config-if)#sw mo tr
sw1(config-if)#sw tr en do
sw1(config-if)#exit
sw1(config)#do show int f1/2 switchport
Name: Fa1/2
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: Disabled
Access Mode VLAN: 0 ((Inactive))
Trunking Native Mode VLAN: 1 (default)
Trunking VLANs Enabled: ALL
Trunking VLANs Active: 1,10,20
Protected: false
Priority for untagged frames: 0
Override vlan tag priority: FALSE
Voice VLAN: none 
Appliance trust: none

 

sw2的配置:

 关闭路由功能

sw2#conf t  
sw2(config)#no ip routing 
sw2(config)#exit
 

添加vlan10,20

sw2#conf t
sw2(config)#vlan 10,20
sw2(config-vlan)#exit

把sw2的f1/3,f1/4接口分别分配给vlan10,vlan20,并查看信息

sw2(config)#int f1/3
sw2(config-if)#sw mo acc
sw2(config-if)#sw acc vlan 10
sw2(config-if)#int f1/4
sw2(config-if)#sw mo acc
sw2(config-if)#sw acc vlan 20
sw2(config-if)#do show vlan-sw b

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa1/0, Fa1/1, Fa1/5, Fa1/6
                                                Fa1/7, Fa1/8, Fa1/9, Fa1/10
                                                Fa1/11, Fa1/12, Fa1/13, Fa1/14
                                                Fa1/15
10   VLAN0010                         active    Fa1/3
20   VLAN0020                         active    Fa1/4
1002 fddi-default                     act/unsup 
1003 token-ring-default               act/unsup 
1004 fddinet-default                  act/unsup 
1005 trnet-default                    act/unsup 

在f1/2端口设置trunk,并查看信息

sw2(config-if)#int f1/2
sw2(config-if)#sw mo tr
sw2(config-if)#sw tr en do
sw2(config-if)#do show int f1/2 switchport
Name: Fa1/2
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: Disabled
Access Mode VLAN: 0 ((Inactive))
Trunking Native Mode VLAN: 1 (default)
Trunking VLANs Enabled: ALL
Trunking VLANs Active: 1,10,20
Protected: false
Priority for untagged frames: 0
Override vlan tag priority: FALSE
Voice VLAN: none 
Appliance trust: none

五.实验结果

.使用pc4pingpc5,并用抓包工具,查看具体信息

还是用PC4 ping PC5 但是换一条线路抓包

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值