三层交换机(Csico3560)配置Switch>enSwitch#config tEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#hostname jaohuanji 修改名称jaohuanji(config)#vlan 10 创建VLANjaohuanji(config-vlan)#exitjaohuanji(config)#vlan 20 创建VLANjaohuanji(config-vlan)#exitjaohuanji(config)#int f0/10 进入端口配置模式jaohuanji(config-if)#switchport access vlan 10 将端口划分到VLAN中jaohuanji(config-if)#exitjaohuanji(config)#int f0/20 进入端口配置模式jaohuanji(config-if)#switchport access vlan 20 将端口划分到VLAN中jaohuanji(config)#^Z%SYS-5-CONFIG_I: Configured from console by consolejaohuanji#show vlan 查看VLAN信息VLAN Name Status Ports---- -------------------------------- --------- -------------------------------1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4Fa0/5, Fa0/6, Fa0/7, Fa0/8Fa0/9, Fa0/11, Fa0/12, Fa0/13Fa0/14, Fa0/15, Fa0/16, Fa0/17Fa0/18, Fa0/19, Fa0/21, Fa0/22Fa0/23, Fa0/24, Gig0/1, Gig0/210 VLAN0010 active Fa0/1020 VLAN0020 active Fa0/201002 fddi-default active1003 token-ring-default active1004 fddinet-default active1005 trnet-default activeVLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2 ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------1 enet 1500 - - - - - 0 010 enet 1500 - - - - - 0 020 enet 1500 - - - - - 0 01002 enet 1500 - - - - - 0 0jaohuanji#config tEnter configuration commands, one per line. End with CNTL/Z.jaohuanji(config)#int vlan 10 进入VLAN10%LINK-5-CHANGED: Interface Vlan10, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to up jaohuanji(config-if)#ip address 192.168.1.1 255.255.255.0 配置VLAN10的虚拟接口IP地址jaohuanji(config-if)#no shut 开启端口jaohuanji(config-if)#exitjaohuanji(config)#int vlan 20 进入VLAN20%LINK-5-CHANGED: Interface Vlan20, changed state to upjaohuanji(config-if)#ip address 192.168.3.1 255.255.255.0 配置VLAN20的虚拟接口IP地址jaohuanji(config-if)#no shut 开启端口jaohuanji(config)#^Z%SYS-5-CONFIG_I: Configured from console by consolejaohuanji#show ip route 查询路由表配置Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static route······jaohuanji#config tEnter configuration commands, one per line. End with CNTL/Z.jaohuanji(config)#route rip 进入RIP视图jaohuanji(config-router)#network 192.168.1.0 发布直连路由jaohuanji(config-router)#network 192.168.3.0 发布直连路由jaohuanji(config-router)#version 2 修改RIP版本jaohuanji(config-router)#^Z%SYS-5-CONFIG_I: Configured from console by consolejaohuanji#路由器1配置Router>enRouter#configConfiguring from terminal, memory, or network [terminal]? tEnter configuration commands, one per line. End with CNTL/Z.Router (config)#hostname R1 修改名称R1(config)#int f0/0 进入端口配置模式R1(config-if)#no shut 开启端口%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to upR1(config-if)#ip address 192.168.3.2 255.255.255.0 设置端口IPR1(config-if)#int serial 2/0 进入端口配置模式R1(config-if)#no shut 开启端口%LINK-5-CHANGED: Interface Serial2/0, changed state to downR1(config-if)#ip address 192.168.4.1 255.255.255.0 设置端口IPR1(config-if)#clock rate 64000 设置端口时钟R1(config)#^Z%SYS-5-CONFIG_I: Configured from console by consoleR1#show ip route 查询路由表配置Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not setC 192.168.3.0/24 is directly connected, FastEthernet0/0R1#config tEnter configuration commands, one per line. End with CNTL/Z.R1(config)#router rip 进入RIP视图R1(config-router)#network 192.168.3.0 发布直连路由R1(config-router)#network 192.168.4.0 发布直连路由R1(config-router)#version 2 修改RIP版本R1(config-router)#^Z%SYS-5-CONFIG_I: Configured from console by consoleR1#R2路由器配置Router>enRouter#config tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#hostname R2 修改名称R2(config)#int f0/0 进入端口配置模式R2(config-if)#no shut 开启端口%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up R2(config-if)#ip address 192.168.2.1 255.255.255.0 设置端口IPR2(config-if)#int serial 2/0 进入端口配置模式R2(config-if)#no shut 开启端口%LINK-5-CHANGED: Interface Serial2/0, changed state to upR2(config-if)#%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/0, changed state to upip ad R2(config-if)#ip address 192.168.4.2 255.255.255.0 设置端口IPR2(config-if)#^Z%SYS-5-CONFIG_I: Configured from console by consoleR2#show ip route 查询路由表配置Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not setC 192.168.2.0/24 is directly connected, FastEthernet0/0C 192.168.4.0/24 is directly connected, Serial2/0R2#config tEnter configuration commands, one per line. End with CNTL/Z.R2(config)#router rip 进入RIP视图R2(config-router)#network 192.168.2.0 发布直连路由R2(config-router)#network 192.168.4.0 发布直连路由R2(config-router)#version 2 修改RIP版本R2(config-router)#^Z%SYS-5-CONFIG_I: Configured from console by consoleR2#show ip route 查询路由表配置Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not setR 192.168.1.0/24 [120/2] via 192.168.4.1, 00:00:07, Serial2/0C 192.168.2.0/24 is directly connected, FastEthernet0/0R 192.168.3.0/24 [120/1] via 192.168.4.1, 00:00:07, Serial2/0C 192.168.4.0/24 is directly connected, Serial2/0R2#。