Cisco实验-VTP基本使用

VTP基本使用

VTP(Vlan Trunk Protocol)即VLAN中继协议。VTP通过网络(ISL帧或者cisco私有的DTP帧)保证VLAN配置的统一性。VTP在系统级管理增加、删除,跳转VLAN,自动地将信息向网络中其他的交换机广播。此外,VTP减小了那些可能导致安全问题的配置。便于管理,只要在vtp server做相应的设置,vtp client会自动学习vtp server上的vlan信息。

3.1 实例拓扑图

在这里插入图片描述

3.2 配置VTP

核心交换机Cisco 3650配置为vtp Server,vtp domain为senya。

Switch#vlan database
% Warning: It is recommended to configure VLAN from config mode,
  as VLAN database mode is being deprecated. Please consult user
  documentation for configuring VTP/VLAN in config mode.

Switch(vlan)#vtp domain senya
Changing VTP domain name from NULL to senya
Switch(vlan)#vtp server
Device mode already VTP SERVER.

图3-2-1

Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#int fa 0/1
Switch(config-if)#switchport mode trunk
Command rejected: An interface whose trunk encapsulation is "Auto" can not be configured to "trunk" mode.

图3-2-2-1
报错了,我的天,含义是,命令被拒绝:接口的中继封装是“自动”不能被配置为“主干”模式
那就先封装一下吧

Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#switchport mode trunk

图3-2-2-2

Switch(config)#int fa 0/2
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#switchport mode trunk

Switch(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to down

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

图3-2-2-3
图3-2-2 配置trunk链路,允许带vlan标记的以太网帧通过该链路

Switch#vlan database
% Warning: It is recommended to configure VLAN from config mode,
  as VLAN database mode is being deprecated. Please consult user
  documentation for configuring VTP/VLAN in config mode.

Switch(vlan)#vtp domain senya
Domain name already set to senya.
Switch(vlan)#vtp client
Setting device to VTP CLIENT mode.

在这里插入图片描述
图3-2-3 配置汇聚层(接入层)交换机

Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#int fa 0/1
Switch(config-if)#switchport mode trunk

在这里插入图片描述
图3-2-4

3.3 创建Vlan及端口划分

Switch>en
Switch#vlan database
% Warning: It is recommended to configure VLAN from config mode,
  as VLAN database mode is being deprecated. Please consult user
  documentation for configuring VTP/VLAN in config mode.

Switch(vlan)#vlan 2
VLAN 2 added:
    Name: VLAN0002
Switch(vlan)#vlan 3
VLAN 3 added:
    Name: VLAN0003

图 3-3-1 在vtp server上创建vlan

Switch#show vlan

图 3-3-2 在vtp client上查看vlan

Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#int fa 0/1
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 2

图 3-3-3 划分端口

3.4 配置pc测试vlan

图3-4-1 为pc配置ip地址
图3-4-2 本网段内互ping(192.168.1.22是本网段另一台主机地址)

Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#int vlan 2
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan2, changed state to up

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

Switch(config-if)#ip address 192.168.1.1 255.255.255.0
Switch(config-if)#no shutdown
Switch(config-if)#int vlan 3
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan3, changed state to up

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

Switch(config-if)#ip address 192.168.2.1 255.255.255.0
Switch(config-if)#no shutdown 

图3-4-3 为vlan配置ip地址
图3-4-4 为pc配置网关
图3-4-5 不同网段pc互相ping
结果不同网段一直不能ping通,到另外VLAN的网关也不同,后来百度找到需要顶层启用路由功能

Switch(config)#ip routing

图3-4-6 启用路由功能
验证:
在这里插入图片描述

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值