单臂路由的配置实例 网络拓扑:
路由器配置: Router>enable Router#configure terminal Enter configuration commands, one perline. End with CNTL/Z. Router(config)#host cisco2811 cisco2811(config)# int fa0/0 cisco2811(config-if)#no sh cisco2811(config-if)#intfa0/0.2 cisco2811(config-subif)#encapsulationdot1Q 2 cisco2811(config-subif)#ipadd 10.10.10.254 255.255.255.0 cisco2811(config-subif)#intfa0/0.3 cisco2811(config-subif)#encapsulationdot1Q 3 cisco2811(config-subif)#ipadd 10.10.11.254 255.255.255.0 cisco2811(config-subif)# 交换机配置: Switch>enable Switch#configure terminal Enter configuration commands, one perline. End with CNTL/Z. Switch(config)#hostname cisco2960 cisco2960(config)#int fa0/3 cisco2960(config-if)#switchport mode trunk cisco2960(config-if)#end cisco2960#vlan database % Warning: It is recommended to configureVLAN from config mode, asVLAN database mode is being deprecated. Please consult user documentation for configuring VTP/VLAN in config mode. cisco2960(vlan)#vlan 2 name gouzhongxing VLAN 2 added: Name: gouzhongxing cisco2960(vlan)#vlan 3 name lixiaomeng VLAN 3 added: Name: lixiaomeng cisco2960(vlan)#exit APPLY completed. Exiting.... cisco2960#configure terminal Enter configuration commands, one perline. End with CNTL/Z. cisco2960(config)#int fa0/1 cisco2960(config-if)#switchport mode access cisco2960(config-if)#switchport access vlan3 cisco2960(config-if)#exit cisco2960(config)#int fa0/2 cisco2960(config-if)#switchport mode access cisco2960(config-if)#switchport access vlan2 cisco2960(config-if)#end cisco2960# %SYS-5-CONFIG_I: Configured from console byconsole cisco2960#write Building configuration... [OK] cisco2960# 测试实验效果: PC>ping 10.10.11.3 Pinging 10.10.11.3 with 32 bytes of data: Reply from 10.10.11.3: bytes=32 time=109msTTL=127 Reply from 10.10.11.3: bytes=32 time=125msTTL=127 Reply from 10.10.11.3: bytes=32 time=109msTTL=127 Reply from 10.10.11.3: bytes=32 time=125msTTL=127 Ping statistics for 10.10.11.3: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times inmilli-seconds: Minimum = 109ms, Maximum = 125ms, Average = 117ms PC>
|