项目二 任务三 训练2 交换机的VTP技术
创始人
2025-06-01 20:32:40

1、三层交换机配置

Switch>

Switch>en

Switch#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#vtp domain wgj

Changing VTP domain name from NULL to wgj

Switch(config)#vtp mode server

Device mode already VTP SERVER.


Switch(config)#vlan 50

Switch(config-vlan)#vlan 60

Switch(config-vlan)#exit

Switch(config)#interface vlan 50

Switch(config-if)#

%LINK-5-CHANGED: Interface Vlan50, changed state to up

Switch(config-if)#ip address 192.168.50.254 255.255.255.0

Switch(config-if)#interface vlan 60

Switch(config-if)#

%LINK-5-CHANGED: Interface Vlan60, changed state to up

Switch(config-if)#ip address 192.168.60.254 255.255.255.0

Switch(config-if)#no shutdown

Switch(config-if)#


 使用ping命令检测,网关不通,什么原因?

 

 需设置二层交换机的trunk和vlan通过

 2、二层交换机50-2配置

Switch>en

Switch#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#interface gigabitEthernet 0/1

Switch(config-if)#switchport mode trunk

Switch(config-if)#

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up


Switch(config-if)#exit

Switch(config)#vtp domain wgj

Domain name already set to wgj.

Switch(config)#vtp mode client

Setting device to VTP CLIENT mode.

Switch(config)#exit

Switch#

%SYS-5-CONFIG_I: Configured from console by console

Switch#show vlan

VLAN Name Status Ports

---- -------------------------------- --------- -------------------------------

1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4

Fa0/5, Fa0/6, Fa0/7, Fa0/8

Fa0/9, Fa0/10, Fa0/11, Fa0/12

Fa0/13, Fa0/14, Fa0/15, Fa0/16

Fa0/17, Fa0/18, Fa0/19, Fa0/20

Fa0/21, Fa0/22, Fa0/23, Fa0/24

Gig0/2

50 VLAN0050 active

60 VLAN0060 active

1002 fddi-default act/unsup

1003 token-ring-default act/unsup

1004 fddinet-default act/unsup

1005 trnet-default act/unsup

Switch#

使用ping命令测试,仍然不通,需要配置三层交换机vlan 通过,二层交换机vlan通过,pc网关设置

4、三层交换机配置

Switch(config)#interface range gigabitEthernet 0/1-2

Switch(config-if-range)#switchport trunk allowed vlan all

5、二层交换机配置

Switch(config)#interface fastEthernet 0/1

Switch(config-if)#switchport access vlan 50

Switch(config)#interface fastEthernet 0/2

Switch(config-if)#switchport access vlan 60

Switch(config-if)#end

Switch#

%SYS-5-CONFIG_I: Configured from console by console

6、PC机IP地址设置

 

 7、同样的方法设置其余3台PC和50-3二层交换机

Switch>

Switch>en

Switch#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#vtp domain wgj

Changing VTP domain name from NULL to wgj

Switch(config)#vtp mode client

Setting device to VTP CLIENT mode.


 

Switch(config-if)#switchport mode trunk

Switch(config-if)#

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/2, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/2, changed state to up

Switch(config)#interface gigabitEthernet 0/2

Switch(config-if)#switchport trunk allowed vlan all

Switch(config-if)#exit

Switch(config)#interface fastEthernet 0/1

Switch(config-if)#switchport access vlan 50

Switch(config-if)#interface fastEthernet 0/2

Switch(config-if)#switchport access vlan 60

Switch(config-if)#

使用ping命令检测,发现相同网段的连通,不同网段的不通,需开启三层交换机的路由。

 

 8、开启三层交换机路由

Switch(config)#ip routing

 

全网连通,完成。

相关内容

热门资讯

一汽豪掷37亿拿下零跑5%股权... 成立十周年之际,零跑宣告了和一汽的股权合作。12月29日,零跑汽车(下称“零跑”)于港交所公告,前一...
2026节点增长大会圆满收官,... 岁尾年初,AI早已跨越“概念验证”的青涩,全面挺进“产业重塑”的深水区。从生命科技的细胞工厂到穿梭城...
挑战年销量400万,零跑意欲撕... 在零跑汽车成立十周年之际,零跑迎来了又一位新的大股东——中国一汽。随着一汽的入股,这家新势力车企将携...
天箭科技可能“披星戴帽”,调减... 微成都报道 12月29日盘后,天箭科技(002977)发布重大风险提示公告。受军品价格调整影响,公司...
合见工软启动上市辅导,估值13... 红星资本局12月29日消息,日前,证监会官网显示,国产EDA头部企业上海合见工业软件集团股份有限公司...