VLAN配置实例.doc_第1页
VLAN配置实例.doc_第2页
VLAN配置实例.doc_第3页
VLAN配置实例.doc_第4页
VLAN配置实例.doc_第5页
已阅读5页,还剩4页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

VLAN配置实例网络拓扑如下图所示:这个网络有两台2950 交换机,连接到路由器LAB_B的叫2950B,连接到路由器LAB_C的叫2950C。为了管理VLAN,VLAN1使用172.16.10.0/24网络地址;路由器LAB_B的fa0/0接口用来配置VLAN间的路由,每个交换机必须有一个172.16.10.0网络中的Ip地址,子网间可以相互通信。计划创建两个子网:VLAN 2 拥有子网络地址172.16.20.0/24,VLAN 3拥有网络地址172.16.30.0/24。将fa0/2分配给VLAN2,将fa0/3分配给VLAN3。第一步:进行交换机的基本配置,包括名字、地址等2950C交换机的配置:Switch(config)#hostname 2950C2950C(config)#enable secret todd2950C(config)#line con 02950C(config-line)#login2950C(config-line)#password console2950C(config-line)#line vty 0 152950C(config-line)#login2950C(config-line)#password telnet2950C(config-if)#interface f0/42950C(config-if)#description Connection to 2950B2950C(config-if)#int f0/52950C(config-if)#description 2nd connection to 2950B2950C(config-if)#int vlan12950C(config-if)#ip address 172.16.10.2 255.255.255.0 /配置管理地址2950C(config-if)#no shut2950C(config-if)#exit2950C(config)#ip default-gateway 172.16.10.12950C(config)#Z 2950C#copy run startDestination filename startup-config? Press EnterBuilding configuration.OK2950C#2950B交换机的配置:Switch(config)#hostname 2950B2950B(config)#enable secret todd2950B(config)#line con 02950B(config-line)#login2950B(config-line)#password console2950B(config-line)#line vty 0 152950B(config-line)#login2950B(config-line)#password telnet2950B(config)#int f0/12950B(config-if)#description Connection to router2950B(config)#int f0/42950B(config-if)#desc connection to 2950C2950B(config-if)#int f0/52950B(config-if)#desc 2nd connection to 2950C2950B(config-if)#int vlan 12950B(config-if)#ip address 172.16.10.3 255.255.255.02950B(config-if)#no shut2950B(config-if)#exit2950B(config)#ip default-gateway 172.16.10.12950B(config)#exit2950B#copy run startDestination filename startup-config? Press EnterBuilding configuration.OK2950B#2950B#ping 172.16.10.2 /检查和2950C的连通情况.!到目前为止,两台交换机已经完成基本的信息配置,并且能够ping通。第二步:将在互连的交换机上设置中继/主干2950B(config)#int f0/12950B(config-if)#switchport mode trunk2950B(config-if)#int f0/42950B(config-if)#switchport mode trunk2950B(config-if)#int fa0/52950B(config-if)#switchport mode trunk2950C(config)#int fa0/42950C(config-if)#switchport mode trunk2950C(config-if)#int fa0/52950C(config-if)#switchport mode trunk使用show interface trunk命令查看配置是否正确:2950B#sh int trunk第三步:设置VTP,创建VLAN2950C(config)#vtp mode serverDevice mode already VTP SERVER.2950C(config)#vtp domain RouterSim2950C(config)#z2950C#vlan database2950C(vlan)#vlan 2 name SalesVLAN 2 added:Name: Sales2950C(vlan)#vlan 3 name MarketingVLAN 3 added:Name: Marketing2950C(vlan)#applyAPPLY completed.2950C(vlan)#注意:在创建VLAN之前,务必先配置VTP信息。可以使用命令检查刚才所作的配置是否正确: show vlan brief2950C#sh vlan brief接下来,就要为VLAN分配成员了,将接口fa0/2 分配给VLAN 2,将接口 fa0/3 分配给VLAN 3。注意:所有的端口缺省地属于 VLAN 1 ,除非另外指定。2950C#config t2950C(config)#int fa0/22950C(config-if)#switchport access vlan 22950C(config-if)#int fa0/32950C(config-if)#switchport access vlan 3使用命令检查配置是否正确:show vlan brief至此,2950C的VTP信息、VLAN、成员信息配置完成了,接下来配置2950B。把2950B设置为一个VTP client,可从2950C上获取VLAN数据库的信息。2950B(config)#vtp domain RouterSimDevice mode set to VTP CLIENT.2950B(config)#vtp mode client2950B(config)#z注意:1。首先要设置vtp域名,在将缺省的模式变为client模式之前;2。同步vtp域名后,client交换机从server处获取VLAN信息,可用show vlan brif验证:现在只需要把交换机的端口分配给VLAN:2950B(config)#int fa0/22950B(config-if)#switchport access vlan 22950B(config-if)#int fa0/32950B(config-if)#switchport access vlan 3第四步:VLAN间路由所有的配置几乎都完成了,现在VLAN内部可以通信,但是VLAN间还不能通信,为了让VLAN间通信,必须让Lab_B 来参与:Router(config)#hostname TrunkrouterTrunkrouter(config)#int f0/0Trunkrouter(config-if)#no ip addressTrunkrouter(config-if)#no shutdownTrunkrouter(config-if)#int f0/0.1Trunkrouter(config-subif)#ip address 172.16.10.1 255.255.255.0Configuring IP routing on a LAN subinterface is only allowed if that subinterface is already configured as part of an IEEE 802.10, IEEE 802.1Q, or ISL VLAN.Trunkrouter(config-subif)#encapsulation dot1q 1Trunkrouter(config-subif)#ip address 172.16.10.1 255.255.255.0Trunkrouter(config-subif)#int f0/0.2Trunkrouter(config-subif)#encap dot1q 2Trunkrouter(config-subif)#ip address 172.16.20.1 255.255.255.0Trunkrouter(config-subif)#int f0/0.3Trunkrouter(config-subif)#encap dot1q 3Trunkrouter(config-subif)#ip address 172.16.30.1 255.255.255.0Trunkrouter(config-subif)#exit注意到,创建了三个子接口来容纳三个VLAN,可以使用show run来检查刚才做的配置:Trunkrouter#show run!interface FastEthernet0/0no ip addressno ip directed-broadcast!interface FastEthernet0/0.1encapsulation dot1Q 1ip address 172.16.10.1 255.255.255.0no ip directed-broadcast!interface F

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论