VTP交换机

学习目标:

明天复习路由器


学习内容:

1.交换机VTP


学习时间:

  • 周一至周五晚上 7 点—晚上9点

学习产出:

拓扑图:
在这里插入图片描述

SWA:
Switch>en
Switch#conf t
Switch(config)#hostname SWA
SWA(config)#vtp domain mydomain ( 配置VTP的域名为mydomain)
Changing VTP domain name from NULL to mydomain.
SWA(config)#vtp mode server ( 配置VTP的模式为服务器模式)
Device mode already VTP SERVER.
SWA(config)#vtp password cisco ( 配置VTP的密码为cisco)
Setting device VLAN database password to cisco
SWA(config)#exi
SWA#show vtp status (查看VTP的状态)
VTP Version : 2
Configuration Revision : 0
Maximum VLANs supported locally : 1005
Number of existing VLANs : 5
VTP Operating Mode : Server ( VTP的模式)
VTP Domain Name : mydomain ( VTP的域名)
VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0xB1 0xD4 0xCF 0x61 0xA9 0xCF 0xA3 0x9C
Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00
Local updater ID is 0.0.0.0 (no valid interface found)
SWA#conf t
Enter configuration commands, one per line. End with CNTL/Z.
SWA(config)#vlan 10 (创建vlan10)
SWA(config-vlan)#vlan 20 (创建vlan20)
SWA(config-vlan)#exi
SWA(config)#int vlan 10
SWA(config-if)#
%LINK-5-CHANGED: Interface Vlan10, changed state to up

SWA(config-if)#ip add 192.168.10.254 255.255.255.0 (给vlan10配置网关,让他们全部通信)
SWA(config-if)#no shut
SWA(config-if)#int vlan 20
SWA(config-if)#
%LINK-5-CHANGED: Interface Vlan20, changed state to up

SWA(config-if)#ip add 192.168.20.254 255.255.255.0 (给vlan20配置网关,让他们全部通信)
SWA(config-if)#no shut
SWA(config-if)#exi
SWA(config)#ip routing (开启三层交换机的路由功能)
SWA(config)#int g0/1
SWA(config-if)#sw tr en do (三层需要封装)
SWA(config-if)#sw mo tr (开启trunk模式)

SWA(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

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to up

SWA(config-if)#
SWA(config-if)#int g0/2
SWA(config-if)#sw tr en do
SWA(config-if)#sw mo tr

%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

SWA(config-if)#end
%SYS-5-CONFIG_I: Configured from console by console
write (保存)
Building configuration…
[OK]
SWA#show vlan (查看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
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

VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2


1 enet 100001 1500 - - - - - 0 0
10 enet 100010 1500 - - - - - 0 0
20 enet 100020 1500 - - - - - 0 0
1002 fddi 101002 1500 - - - - - 0 0
1003 tr 101003 1500 - - - - - 0 0
1004 fdnet 101004 1500 - - - ieee - 0 0
1005 trnet 101005 1500 - - - ibm - 0 0
SWB:
Switch>en
Switch#conf t
Switch(config)#hostname SWB
SWB(config)#vtp domain mydomain (VTP的域名与核心交换机一致)
Changing VTP domain name from NULL to mydomain
SWB(config)#vtp password cisco (设置VTP的密码cisco)
Setting device VLAN database password to cisco
SWB(config)#vtp mode client (设置VTP的模式为客户端模式)
Setting device to VTP CLIENT mode.
SWB(config)#int g0/1
SWB(config-if)#sw mo tr (二层不需要封装)
SWB(config-if)#exi
SWB(config)#int f0/1
SWB(config-if)#sw acc vl 10
SWB(config-if)#int f0/2
SWB(config-if)#sw acc vl 20
SWB(config-if)#end
SWB#
%SYS-5-CONFIG_I: Configured from console by console
write
Building configuration…
[OK]
SWB#
SWC:
Switch>en
Switch#conf t
Switch(config)#hostname SWC
SWC(config)#int g0/2
SWC(config-if)#sw mo tr
SWC(config-if)#exi
SWC(config)#int f0/1
SWC(config-if)#sw acc vl 10
% Access VLAN does not exist. Creating vlan 10
SWC(config-if)#sw acc vl 10
SWC(config-if)#int f0/2
SWC(config-if)#sw acc vl 20
% Access VLAN does not exist. Creating vlan 20
SWC(config-if)#sw acc vl 20
SWC(config-if)#end
SWC#
%SYS-5-CONFIG_I: Configured from console by console
write
Building configuration…
[OK]
PC机:
在这里插入图片描述
检测:
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值