




已阅读5页,还剩22页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
交换机VLAN、 TRUNK 、VTP 配置1 配置 CISCO 二层交换机的IP 地址(catalyst 2950 为例)SW1(config)#int vlan 1 /进入管理接口interface vlan 1SW1(config-if)#ip address /配置IP 地址SW1(config-if)#no shutdownSW1(config-if)#exitSW1(config)#ip default-gateway /配置网关,可通过show run 查查看所配置的 IP 地址:SW1#show int vlan 1Vlan1 is up, line protocol is upHardware is CPU Interface, address is 0008.20ff.6400 (bia 0008.20ff.6400)Internet address is /242配置交换机的端口速度和双工(Speed and Duplex)SW1(config)#interface fa0/1SW1(config-if)#speed 10 | 100 | auto /10M/100M/自适应SW1(config-if)#duplex auto | full | half /自适应/全双工/半双工一般情况下,交换机两端的端口速度和双工要匹配,这样通信质量才能得到保证,在相同厂家的产品(比如说Cisco 的交换机互连)中端口协商不用配置一般不会有什么问题,可以通过show interface 查看端口的速度和双工。通常在不同厂家的产品中(比如说Cisco 和华为互连)如果通过查看发现端口速度和双工不匹配,可以通过手工配置来解决。如图:通过 show interface 查看端口的速度和双工:SW1#show interfaces fastEthernet 0/24FastEthernet0/24 is up, line protocol is up (connected)Hardware is Fast Ethernet, address is 0008.20ff.6418 (bia 0008.20ff.6418)MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,reliability 255/255, txload 1/255, rxload 1/255Encapsulation ARPA, loopback not setKeepalive set (10 sec)Full-duplex, 100Mb/s, media type is 100BaseTXinput flow-control is unsupported output flow-control is unsupportedARP type: ARPA, ARP Timeout 04:00:00Last input 00:00:03, output 00:00:00, output hang never注:CISCO 交换机端口默认值:Auto-duplex, Auto-speed, media type is 100BaseTXCisco 设备配置端口速度(speed)和双工(duplex)命令:SW1(config)#interface fastEthernet 0/24SW1(config-if)#speed ?10 Force 10 Mbps operation -注:强制速度为10M100 Force 100 Mbps operation-注:强制速度为100Mauto Enable AUTO speed configuration -注:速度自动协议(默认值)SW1(config-if)#duplex ?auto Enable AUTO duplex configuration -注:自动协商双工full Force full duplex operation -注:强制为全双工half Force half-duplex operation -注:强制为半双工3设置永久MAC 地址不过期SW1(config)#mac-address-table static mac_addr vlan vlan_id interface int1 int2 . int15SW1(config)#mac-address-table static 1111.1111.a111 vlan 1 interface f0/1配置后show mac-address-table 可以看到静态添加的MAC 地址1111.1111.a111SW1#show mac-address-tableVlan Mac Address Type Ports- - - -All 000f.72db.4ec0 STATIC CPU1 1111.1111.a111 STATIC Fa0/14管理MAC 地址表SW1#show mac-address-tableMac Address Table-Vlan Mac Address Type Ports- - - -All 000f.72db.4ec0 STATIC CPU1 0000.0c3f.0b05 DYNAMIC Fa0/121 0030.94e6.391d DYNAMIC Fa0/111 00e0.b05a.5bfe DYNAMIC Fa0/101 1111.1111.a111 STATIC Fa0/15.设置交换机端口的访问模式(三种) access /dynamic / trunkSW1(config-if)#switchport mode ?access Set trunking mode to ACCESS unconditionallydynamic Set trunking mode to dynamically negotiate access or trunk modetrunk Set trunking mode to TRUNK unconditionallySW1(config)#int fastEthernet 0/1SW1(config-if)#switchport mode access /设置FA0/1 为ACCESS 模式SW1(config-if)#switchport mode trunk /设置FA0/1 为TRUNK 模式SW1(config-if)#switchport mode dynamic auto /设置FA0/1 为自动直协商模式(默认)交换机TRUNK 端口配置:1)一般交换机与交换机相连接的端口要设置为trunk 模式2 )如果是梳心交换机与非网管的交换机相连,梳心交换机端口设置为access 模式如下图:配置 SW1:SW1(config)#int f0/24SW1(config-if)#no shutdownSW1(config-if)#switchport mode trunk /设置FA0/24 为TRUNK 模式配置 SW2:SW2(config)#int f0/24SW2(config-if)#no shutdownSW2(config-if)#switchport mode trunk /设置FA0/24 为TRUNK 模式验证 TRUNK 命令:Show interface trunkShow interface f0/24 switchportSW1#sho run int f0/24interface FastEthernet0/24switchport mode trunkSW1#show int trunkPort Mode Encapsulation Status Native vlanFa0/24 on 802.1q trunking 1SW1#show int f0/24 switchportName: Fa0/24Switchport: EnabledAdministrative Mode: trunkOperational Mode: trunkAdministrative Trunking Encapsulation: dot1qOperational Trunking Encapsulation: dot1qNegotiation of Trunking: OnAccess Mode VLAN: 1 (default)Trunking Native Mode VLAN: 1 (default)Voice VLAN: noneAdministrative private-vlan host-association: noneAdministrative private-vlan mapping: noneAdministrative private-vlan trunk native VLAN: noneAdministrative private-vlan trunk encapsulation: dot1qAdministrative private-vlan trunk normal VLANs: noneAdministrative private-vlan trunk private VLANs: noneOperational private-vlan: noneTrunking VLANs Enabled: ALLPruning VLANs Enabled: 2-1001Capture Mode DisabledCapture VLANs Allowed: ALLProtected: falseAppliance trust: noneSW1#SW2:SW2#sho run int f0/24interface FastEthernet0/24switchport mode trunkendSW2#show int trunkPort Mode Encapsulation Status Native vlanFa0/24 on 802.1q trunking 16.配置VLAN1).创建VLANSW1(config)#vlan 2 /创建VLAN2SW1(config)#name VLAN2 /命名为VLAN2,默认为vlan002,命名是可选命令2).将端口加入VLANSW1(config-if)#switchport mode access /设配端口为access 模式SW1(config-if)#switchport access vlan 2 /把端口加到vlan23).检查的命令Switch#show vlan例子:创建 VLAN2 命令为widom ,创建VLAN3 命令为market把端口F0/4 加入VLAN2SW1#config tSW1(config)#vlan 2SW1(config-vlan)#name wisdomSW1(config-vlan)#exitSW1(config)#vlan 3SW1(config-vlan)#name marketSW1(config-vlan)#exitSW1(config)#int fas0/4SW1(config-if)#switchport mode accessSW1(config-if)#switchport access vlan 2可以同时把多个端口加入到相应VLANSW1(config)#interface range fastEthernet 0/10 15 /可以同时把多个端口加入到一个VLAN 里SW1(config-if-range)#switchport mode accessSW1(config-if-range)#switchport access vlan 3 /把端口10-15 都加入到VLAN3 里SW1#show vlan /检查VLAN 信息VLAN Name Status Ports- - - -1 default active Fa0/1, Fa0/5, Fa0/6, Fa0/7Fa0/8, Fa0/9, Fa0/16, Fa0/17Fa0/18, Fa0/19, Fa0/20, Fa0/21Fa0/22, Fa0/23, Fa0/242 wisdom active Fa0/43 market active Fa0/10, Fa0/11, Fa0/12Fa0/13, Fa0/14, Fa0/15SW1#7.配置VTP-VTP 技术使得在大型的网络里布置多个VLAN 变得简单.VTP 的配置步骤:1、配置Trunk (交换机和交换机相连的端口要设置为TRUNK)2、配置VTP DOMAIN3、配置VTP MODE4、配置VLAN5、将端口加入VLAN6、检查Switch#show interface xx/xx switchport /查看相应该接口的trunk 状态Switch#show vtp status /查看vtp 状态Switch#show vlan /查看VLAN配置 SW1:SW1#configure terminalSW1(config)#interface fastEthernet 0/24SW1(config-if)#switchport mode trunkSW1(config-if)#no shutdownSW1(config-if)#exitSW1(config)#vtp domain wisdomDomain name already set to wisdom.SW1(config)#vtp mode serverDevice mode already VTP SERVER.SW1(config)#vtp password ciscoSetting device VLAN database password to ciscoSW1(config)#vtp pruning /配置VTP 的修剪,只要在SERVER 端配置就行.Pruning switched onSW1#sho vtp statusVTP Version : 2Configuration Revision : 1Maximum VLANs supported locally : 64Number of existing VLANs : 5VTP Operating Mode : ServerVTP Domain Name : wisdomVTP Pruning Mode : EnabledVTP V2 Mode : DisabledVTP Traps Generation : DisabledMD5 digest : 0xE8 0x5A 0x7D 0xB1 0x0E 0xBC 0xEB 0x1FConfiguration last modified by at 3-1-93 02:56:31Local updater ID is on interface Vl1 (lowest numbered VLAN interface found)创建 VLAN2 VLAN3 VLAN4 VLAN5SW1(config)#vlan 2SW1(config-vlan)#vlan 3SW1(config-vlan)#vlan 4SW1(config-vlan)#vlan 5SW1(config-vlan)#在 SW1 上创建VLAN 后查看修订版本:SW1#show vtp statusVTP Version : 2Configuration Revision : 5Maximum VLANs supported locally : 128Number of existing VLANs : 9VTP Operating Mode : ServerVTP Domain Name : wisdomVTP Pruning Mode : EnabledVTP V2 Mode : DisabledVTP Traps Generation : DisabledMD5 digest : 0x9C 0x64 0xD6 0x44 0x5E 0x54 0x9E 0xFCConfiguration last modified by at 3-1-93 02:59:04Local updater ID is on interface Vl1 (lowest numbered VLAN interface found)在交换机 SW1 上检查已创建的VLANSW1#sho vlanVLAN Name Status Ports- - - -1 default active Fa0/1, Fa0/5, Fa0/6, Fa0/7Fa0/8, Fa0/9, Fa0/16, Fa0/17Fa0/18, Fa0/19, Fa0/20, Fa0/21Fa0/22, Fa0/23, Fa0/242 VLAN0002 active3 VLAN0003 active4 VLAN0004 active5 VLAN0005 active检查 trunk 端口:SW1#show interfaces fastEthernet 0/24 switchportName: Fa0/24Switchport: EnabledAdministrative Mode: trunkOperational Mode: trunkAdministrative Trunking Encapsulation: dot1qOperational Trunking Encapsulation: dot1qNegotiation of Trunking: OnAccess Mode VLAN: 1 (default)Trunking Native Mode VLAN: 1 (default)Voice VLAN: noneAdministrative private-vlan host-association: noneAdministrative private-vlan mapping: noneAdministrative private-vlan trunk native VLAN: noneAdministrative private-vlan trunk encapsulation: dot1qAdministrative private-vlan trunk normal VLANs: noneAdministrative private-vlan trunk private VLANs: noneOperational private-vlan: noneTrunking VLANs Enabled: ALLPruning VLANs Enabled: 2-1001Capture Mode DisabledCapture VLANs Allowed: ALLProtected: falseAppliance trust: none配置 SW2:Switch#Switch#config tEnter configuration commands, one per line. End with CNTL/Z.SW2(config)#hostname SW2SW2(config)#int fastEthernet 0/24SW2(config-if)#switchport mode trunkSW2(config-if)#exitSW2(config)#vtp domain wisdomChanging VTP domain name from test to wisdomSW2(config)#vtp mode clientSetting device to VTP CLIENT mode.SW2(config)#vtp password ciscoSetting device VLAN database password to ciscoSW2(config)#查看 F0/24 的trunk 状态:SW2#show interfaces fastEthernet 0/24 switchportName: Fa0/24Switchport: EnabledAdministrative Mode: trunkOperational Mode: trunkAdministrative Trunking Encapsulation: dot1qOperational Trunking Encapsulation: dot1qNegotiation of Trunking: OnAccess Mode VLAN: 1 (default)Trunking Native Mode VLAN: 1 (default)Voice VLAN: noneAdministrative private-vlan host-association: noneAdministrative private-vlan mapping: noneAdministrative private-vlan trunk native VLAN: noneAdministrative private-vlan trunk encapsulation: dot1qAdministrative private-vlan trunk normal VLANs: noneAdministrative private-vlan trunk private VLANs: noneOperational private-vlan: noneTrunking VLANs Enabled: ALLPruning VLANs Enabled: 2-1001Capture Mode DisabledCapture VLANs Allowed: ALLProtected: falseAppliance trust: none查看 VTP 状态:SW2#show vtp statusVTP Version : 2Configuration Revision : 5Maximum VLANs supported locally : 128Number of existing VLANs : 9VTP Operating Mode : ClientVTP Domain Name : wisdomVTP Pruning Mode : EnabledVTP V2 Mode : DisabledVTP Traps Generation : DisabledMD5 digest : 0x9C 0x64 0xD6 0x44 0x5E 0x54 0x9E 0xFCConfiguration last modified by at 3-1-93 02:59:04-此处可以看到SW2 的VLAN 信息是从SW1- 同步过来的SW2#show vlanVLAN Name Status Ports- - - -1 default active Fa0/2, Fa0/3, Fa0/4, Fa0/5Fa0/6, Fa0/7, Fa0/8, Fa0/9Fa0/10, Fa0/11, Fa0/12, Fa0/13Fa0/14, Fa0/15, Fa0/16, Fa0/17Fa0/18, Fa0/19, Fa0/20, Fa0/21Fa0/22, Fa0/23, Fa0/242 VLAN0002 active3 VLAN0003 active4 VLAN0004 active5 VLAN0005 active实验结果:SW2 不用配置VLAN,已同步了SW1 的VLAN 信息.实验成功SW2 同步VTP SERVER 的VLAN 后,接下来的操作就是安要求把相应的端口加入到相应的VLAN综合实验R1通过接口e0/0与sw1的fa0/1相连,地址: R3:通过接口e0/1与sw2的fa0/3相连,地址:R2通过接口e0/0与sw1的fa0/2相连,地址: R4:通过接口e0/1与sw2的fa0/4相连,地址:Sw1与sw2通过fa0/14用trunk相连Sw1给接口fa0/1,fa0/2设置vlan2实验目的:R1与r3互相ping通R2与r4互相ping通R1与r2不通(跨vlan不通)r1#sh runBuilding configuration.Current configuration : 985 bytes!version 12.4service timestamps debug datetime msecservice timestamps log datetime msecno service password-encryption!hostname r1!boot-start-markerboot-end-marker!no aaa new-modelmemory-size iomem 5!ip cefno ip domain lookup! ! !interface Ethernet0/0 ip address full-duplex!interface Ethernet0/1 no ip address shutdown half-duplex!interface Ethernet0/2 no ip address shutdown half-duplex!interface Ethernet0/3 no ip address shutdown half-duplex!interface Serial1/0 no ip address shutdown serial restart-delay 0!interface Serial1/1 no ip address shutdown serial restart-delay 0!interface Serial1/2 no ip address shutdown serial restart-delay 0!interface Serial1/3 no ip address shutdown serial restart-delay 0!no ip http serverno ip http secure-server!control-plane! !line con 0 exec-timeout 0 0line aux 0line vty 0 4!Endr2#sh runBuilding configuration.Current configuration : 982 bytes!version 12.4service timestamps debug datetime msecservice timestamps log datetime msecno service password-encryption!hostname r2!boot-start-markerboot-end-marker!no aaa new-modelmemory-size iomem 5!ip cefno ip domain lookup! ! !interface Ethernet0/0 ip address full-duplex!interface Ethernet0/1 no ip address shutdown half-duplex!interface Ethernet0/2 no ip address shutdown half-duplex!interface Ethernet0/3 no ip address shutdown half-duplex!interface Serial1/0 no ip address shutdown serial restart-delay 0!interface Serial1/1 no ip address shutdown serial restart-delay 0!interface Serial1/2 no ip address shutdown serial restart-delay 0!interface Serial1/3 no ip address shutdown serial restart-delay 0!ip http serverno ip http secure-server!control-plane! !line con 0 exec-timeout 0 0line aux 0line vty 0 4!Endr3#sh runBuilding configuration.Current configuration : 982 bytes!version 12.4service timestamps debug datetime msecservice timestamps log datetime msecno service password-encryption!hostname r3!boot-start-markerboot-end-marker!no aaa new-modelmemory-size iomem 5!ip cefno ip domain lookup! ! !interface Ethernet0/0 no ip address shutdown half-duplex!interface Ethernet0/1 ip address full-duplex!interface Ethernet0/2 no ip address shutdown half-duplex!interface Ethernet0/3 no ip address shutdown half-duplex!interface Serial1/0 no ip address shutdown serial restart-delay 0!interface Serial1/1 no ip address shutdown serial restart-delay 0!interface Serial1/2 no ip address shutdown serial restart-delay 0!interface Serial1/3 no ip address shutdown serial restart-delay 0!ip http serverno ip http secure-server!control-plane! !line con 0 exec-timeout 0 0line aux 0line vty 0 4!End4#sh runBuilding configuration.Current configuration : 982 bytes!version 12.4service timestamps debug datetime msecservice timestamps log datetime msecno service password-encryption!hostname r4!boot-start-markerboot-end-marker!no aaa new-modelmemory-size iomem 5!ip cefno ip domain lookup! ! !interface Ethernet0/0 no ip address shutdown half-duplex!interface Ethernet0/1 ip address full-duplex!interface Ethernet0/2 no ip address shutdown half-duplex!interface Ethernet0/3 no ip address shutdown half-duplex!interface Serial1/0 no ip address shutdown serial restart-delay 0!interface Serial1/1 no ip address shutdown serial restart-delay 0!interface Serial1/2 no ip address shutdown serial restart-delay 0!interface Serial1/3 no ip address shutdown serial restart-delay 0!ip http serverno ip http secure-server!control-plane! !line con 0 exec-timeout 0 0line aux 0line vty 0 4!Endsw1#sh ruBuilding configuration.Current configuration : 1180 bytes!version 12.4service timestamps debug datetime msecservice timestamps log datetime msecno service password-encryption!hostname sw1!boot-start-markerboot-end-marker!no aaa new-modelmemory-size iomem 5!ip cefno ip domain lookup! ! !interface FastEthernet0/0!interface FastEthernet0/1 switchport access vlan 2 duplex full speed 100!inter
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 古代导游考试题及答案解析
- 高速安全培训考试题及答案
- 高考英语必考试题及答案
- 职教课堂互动教学模式优化与实践路径
- 2025产品代理合同范本下载
- 方剂半期考试题及答案
- AI技术支持下的数学课堂互动模式及其优化
- 森林公园游客行为与偏好分析
- 打造数字化供应链管理平台提升物流效率
- 智能家居及智能终端生产线项目风险评估报告
- 2025年电力机车钳工(高级)职业技能鉴定理论考试题库(含答案)
- 智联招聘银行试题及答案
- 安置点管理制度
- 麻醉科职责及管理制度
- 教科版五年级上册科学期中测试卷附答案(夺分金卷)
- 药房管理规章制度目录
- 中职第1课 社会主义在中国的确立和探索试题
- 2025年辽宁省交投集团招聘笔试参考题库含答案解析
- 香港 信托合同范本
- 少先队活动课《民族团结一家亲-同心共筑中国梦》课件
- 阀门培训课件
评论
0/150
提交评论