1、有图精版VLAN与单臂路由配置VLAN与单臂路由配置实例分析实现小型企业局域网二层广播域VLAN隔离和三层全网全连通;掌握Vlan、Trunk、单臂路由的配置方法;分析小型企业局域网广播域大小及二层网络通信过程;分析PC1pingPC4的三层通信过程和二层通信过程;分析PC4pingSW4网管地址的三层通信过程和二层通信过程。拓扑图如下:VLAN与单臂路由设置步骤1、基本信息的配置SW3的基本信息配置1 Switch 2 3 Switchenable 4 5 Switch#configureterminal 6 7 Enterconfigurationcommands,oneperline.E
2、ndwithCNTL/Z. 8 9 Switch(config)#hostnameSW3 10 11 SW3(config)#noipdomain-lookup 12 13 SW3(config)#lineconsole0 14 15 SW3(config-line)#loggingsynchronous 16 17 SW3(config-line)#nologin 18 19 SW3(config-line)#privilegelevel15 20 21 SW3(config-line)#linevty04 22 23 SW3(config-line)#nologin 24 25 SW3(c
3、onfig-line)#privilegelevel15 26 27 SW3(config-line)#exi 28 29 SW3(config)#end SW4的基本信息配置30 Switch/普通模式 31 32 Switchenable/进入特权模式 33 34 Switch#configureterminal/进入全局配置模式 35 36 Enterconfigurationcommands,oneperline.EndwithCNTL/Z. 37 38 Switch(config)#hostnameSW4/配置主机命名 39 40 SW4(config)#noipdomain-loo
4、kup/禁域名查找 41 42 SW4(config)#lineconsole0/进入Console口线路模式 43 44 SW4(config-line)#loggingsynchronous/Console信息显示自动换行 45 46 SW4(config-line)#nologin/配置Console口登录不认证 47 48 SW4(config-line)#privilegelevel15/配置Telnet登录为最高特权级别enable不需要密码 49 50 SW4(config-line)#exi 51 52 SW4(config)#linevty04 53 54 SW4(confi
5、g-line)#nologin 55 56 SW4(config-line)#privilegelevel15 57 58 SW4(config-line)#exi 59 60 SW4(config)#end RT5的基本信息配置61 Router 62 63 Routerenable 64 65 Router#configureterminal 66 67 Enterconfigurationcommands,oneperline.EndwithCNTL/Z. 68 69 Router(config)#hostnameRT5 70 71 RT5(config)#noipdomain-look
6、up 72 73 RT5(config)#lineconsole0 74 75 RT5(config-line)#loggingsynchronous 76 77 RT5(config-line)#nologin 78 79 RT5(config-line)#privilegelevel15 80 81 RT5(config-line)#exi 82 83 RT5(config)#linevty04 84 85 RT5(config-line)#nologin 86 87 RT5(config-line)#privilegelevel15 88 89 RT5(config-line)#exi
7、90 91 RT5(config)#end 2、二层网络全局配置SW3的Vlan配置1 SW3#vlandatabase/进入Vlan配置模式 2 3 SW3(vlan)#vlan8/创建Vlan8、10、11 4 5 VLAN8added: 6 7 Name:VLAN0008 8 9 SW3(vlan)#vlan10 10 11 VLAN10added: 12 13 Name:VLAN0010 14 15 SW3(vlan)#vlan11 16 17 VLAN11added: 18 19 Name:VLAN0011 20 21 SW3(vlan)#exi 22 23 SW3#showvlan
8、-switch/查看Vlan配置信息 24 25 VLANNameStatusPorts 26 27 - 28 29 1defaultactiveFa0/0,Fa0/1,Fa0/2,Fa0/3 30 31 Fa0/4,Fa0/5,Fa0/6,Fa0/7 32 33 Fa0/8,Fa0/9,Fa0/10,Fa0/11 34 35 Fa0/12,Fa0/13,Fa0/14,Fa0/15 36 37 8VLAN0008active 38 39 10VLAN0010active 40 41 11VLAN0011active SW4的Vlan配置42 SW4#vlandatabase/进入Vlan配置模
9、式 43 44 SW4(vlan)#vlan8/创建Vlan8、10、11 45 46 VLAN8added: 47 48 Name:VLAN0008 49 50 SW4(vlan)#vlan10 51 52 VLAN10added: 53 54 Name:VLAN0010 55 56 SW4(vlan)#vlan11 57 58 VLAN11added: 59 60 Name:VLAN0011 61 62 SW4(vlan)#exi 63 64 SW4#showvlan-switch/查看Vlan配置信息 65 66 VLANNameStatusPorts 67 68 - 69 70 1de
10、faultactiveFa0/0,Fa0/1,Fa0/2,Fa0/3 71 72 Fa0/4,Fa0/5,Fa0/6,Fa0/7 73 74 Fa0/8,Fa0/9,Fa0/10,Fa0/11 75 76 Fa0/12,Fa0/13,Fa0/14,Fa0/15 77 78 8VLAN0008active 79 80 10VLAN0010active 81 82 11VLAN0011active 3、二层链路调试SW3的Access接口配置1 SW3#configureterminal 2 3 Enterconfigurationcommands,oneperline.EndwithCNTL/Z
11、. 4 5 SW3(config)#interfa0/10/进入接口fa0/10配置 6 7 SW3(config-if)#switchportmodeaccess/配置接口为Access模式 8 9 SW3(config-if)#switchportaccessvlan10/把接口划到Vlan10 10 11 SW3(config-if)#exi 12 13 SW3(config)#interfa0/11/进入接口f0/11配置 14 15 SW3(config-if)#switchportmodeaccess/配置接口为Access模式 16 17 SW3(config-if)#switc
12、hportaccessvlan11/把接口划到Vlan11 18 19 SW3(config-if)#exi SW4的Access接口配置20 SW4# 21 22 SW4#configureterminal 23 24 Enterconfigurationcommands,oneperline.EndwithCNTL/Z. 25 26 SW4(config)#interfa0/10 27 28 SW4(config-if)#switchportmodeaccess 29 30 SW4(config-if)#switchportaccessvlan10 31 32 SW4(config-if)
13、#exi 33 34 SW4(config)#interfa0/11 35 36 SW4(config-if)#switchportmodeaccess 37 38 SW4(config-if)#switchportaccessvlan11 39 40 SW4(config-if)#exi SW3SW4的Trunk链路调测41 SW3(config)#interfa0/3 42 43 SW3(config-if)#switchporttrunkencapsulationdot1q/选择封装协议 44 45 SW3(config-if)#switchportmodetrunk/配置接口模式为Tr
14、unk 46 47 SW3(config-if)#switchporttrunkallowedvlanall/Trunk允许所有Vlan的信息通过 48 49 SW3(config-if)#exi 50 51 SW4(config)#interfa0/3 52 53 SW4(config-if)#switchporttrunkencapsulationdot1q 54 55 SW4(config-if)#switchportmodetrunk 56 57 SW4(config-if)#switchporttrunkallowedvlanall 58 59 SW4(config-if)#exi
15、4、二层设备网管地址配置SW3的网管接口配置1 SW3#configureterminal 2 3 Enterconfigurationcommands,oneperline.EndwithCNTL/Z. 4 5 SW3(config)#intervlan8/为SW3配置网管地址 6 7 SW3(config-if)#ipaddress192.168.8.130255.255.255.128 8 9 SW3(config-if)#noshutdown 10 11 SW3(config-if)#exit 12 13 SW3(config)#ipdefault-gateway192.168.8.1
16、29/为SW3配置网关 14 15 SW3(config)#end 16 17 SW3#showrun SW4的网管接口配置18 SW4(config)#intervlan8/为SW4配置网管地址 19 20 SW4(config-if)#ipaddress192.168.8.131255.255.255.128 21 22 SW4(config-if)#noshutdown 23 24 SW4(config-if)#exi 25 26 SW4(config)#ipdefault-gateway192.168.8.129/为SW4配置网关 27 28 SW4(config)#exi 29 30
17、 SW4#showipinterfacebrief/查看SW4上接口配置信息 31 32 InterfaceIP-AddressOK?MethodStatusProtocol 33 34 FastEthernet0/0unassignedYESunsetupdown 35 36 FastEthernet0/1unassignedYESunsetupdown 37 38 FastEthernet0/2unassignedYESunsetupdown 39 40 FastEthernet0/3unassignedYESunsetupup 41 42 FastEthernet0/4unassigne
18、dYESunsetupdown 43 44 FastEthernet0/5unassignedYESunsetupdown 45 46 FastEthernet0/6unassignedYESunsetupdown 47 48 FastEthernet0/7unassignedYESunsetupdown 49 50 FastEthernet0/8unassignedYESunsetupdown 51 52 FastEthernet0/9unassignedYESunsetupdown 53 54 FastEthernet0/10unassignedYESunsetupup 55 56 SW4
19、#showinterfacesstatus/查看SW4上接口的状态 57 58 PortNameStatusVlanDuplexSpeedType 59 60 Fa0/0notconnect1autoauto10/100BaseTX 61 62 Fa0/1notconnect1autoauto10/100BaseTX 63 64 Fa0/2notconnect1autoauto10/100BaseTX 65 66 Fa0/3connectedtrunka-fulla-10010/100BaseTX 67 68 Fa0/4notconnect1autoauto10/100BaseTX 69 70
20、 Fa0/5notconnect1autoauto10/100BaseTX 71 72 Fa0/6notconnect1autoauto10/100BaseTX 73 74 Fa0/7notconnect1autoauto10/100BaseTX 75 76 Fa0/8notconnect1autoauto10/100BaseTX 77 78 Fa0/9notconnect1autoauto10/100BaseTX 79 80 Fa0/10connected10a-fulla-10010/100BaseTX 81 82 Fa0/11connected11a-fulla-10010/100Bas
21、eTX 83 84 Fa0/12notconnect1autoauto10/100BaseTX 85 86 Fa0/13notconnect1autoauto10/100BaseTX 87 88 Fa0/14notconnect1autoauto10/100BaseTX 89 90 Fa0/15notconnect1autoauto10/100BaseTX 5、三层接口配置及链路测试SW3的上连接口配置 1 SW3(config)#interfa0/1 2 3 SW3(config-if)#switchporttrunkencapsulationdot1q 4 5 SW3(config-if)
22、#switchportmodetrunk 6 7 SW3(config-if)#switchporttrunkallowedvlanall 8 9 SW3(config-if)#switchporttrunknativevlan8/将该Trunk接口的nativeVlan改为Vlan8 10 11 SW3(config-if)#exi 12 13 SW3(config)#end 14 15 SW3#showipinterfacebrief/查看SW3上接口的配置信息 16 17 InterfaceIP-AddressOK?MethodStatusProtocol 18 19 FastEther
23、net0/0unassignedYESunsetupdown 20 21 FastEthernet0/1unassignedYESunsetupup 22 23 FastEthernet0/2unassignedYESunsetupdown 24 25 FastEthernet0/3unassignedYESunsetupup 26 27 FastEthernet0/4unassignedYESunsetupdown 28 29 FastEthernet0/5unassignedYESunsetupdown 30 31 FastEthernet0/6unassignedYESunsetupdo
24、wn 32 33 FastEthernet0/7unassignedYESunsetupdown 34 35 FastEthernet0/8unassignedYESunsetupdown 36 37 FastEthernet0/9unassignedYESunsetupdown 38 39 FastEthernet0/10unassignedYESunsetupup 40 41 FastEthernet0/11unassignedYESunsetupup 42 43 SW3#showinterfacesstatus/查看SW3上接口的状态 44 45 PortNameStatusVlanDu
25、plexSpeedType 46 47 Fa0/0notconnect1autoauto10/100BaseTX 48 49 Fa0/1connectedtrunka-fulla-10010/100BaseTX 50 51 Fa0/2notconnect1autoauto10/100BaseTX 52 53 Fa0/3connectedtrunka-fulla-10010/100BaseTX 54 55 Fa0/4notconnect1autoauto10/100BaseTX 56 57 Fa0/5notconnect1autoauto10/100BaseTX 58 59 Fa0/6notco
26、nnect1autoauto10/100BaseTX 60 61 Fa0/7notconnect1autoauto10/100BaseTX 62 63 Fa0/8notconnect1autoauto10/100BaseTX 64 65 Fa0/9notconnect1autoauto10/100BaseTX 66 67 Fa0/10connected10a-fulla-10010/100BaseTX 68 69 Fa0/11connected11a-fulla-10010/100BaseTX 70 71 Fa0/12notconnect1autoauto10/100BaseTX 72 73
27、Fa0/13notconnect1autoauto10/100BaseTX 74 75 Fa0/14notconnect1autoauto10/100BaseTX 76 77 Fa0/15notconnect1autoauto10/100BaseTX 单臂路由配置78 RT5#configureterminal 79 80 Enterconfigurationcommands,oneperline.EndwithCNTL/Z. 81 82 RT5(config)#intere0/0/主接口对应nativevlan 83 84 RT5(config-if)#ipaddress192.168.8.
28、129255.255.255.128 85 86 RT5(config-if)#noshutdown/打开主接口 87 88 RT5(config-if)#exi 89 90 RT5(config)#intere0/0.10/创建子接口 91 92 RT5(config-subif)#encapsulationdot1q10/封装dot1q,vlanid10,对应vlan10,vlan10的路由点。 93 94 RT5(config-subif)#ipaddress192.168.10.1255.255.255.0 95 96 RT5(config-subif)#noshutdown/打开子接口 97 98 RT5(config-subif)#exi 99 100 RT5(config)#intere0/0.11/创建子接口 101 102 RT5(config-subif)#encapsulationdot1q11/封装dot1q,vlanid11,对应vlan11,vlan11的路由点 103 104 RT5(config-subif)#ipaddress192.168.11.1255.255.255.0 105 106 RT5(config-subif)#noshutdown/打开子接口 107 108 RT5(config-subif)#end
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1