S1(config-if)#switch mode trunk S1(config-if)#int f0/24
S1(config-if)#switch mode trunk
S1(config)#int f0/1
S1(config-if)#spanning-tree portfast S1(config-if)#int f0/13
S1(config-if)#spanning-tree portfast
五、验证与测试
7帧中继封装R3:
R2(config)#int s1/1
R2(config-if)#encapsulation frame-relay R2(config-if)#frame-relay interface-dlci 102 R2(config-if)#frame-relay lmi-type cisco
R2(config-if)#ip add 123.123.123.1 255.255.255.0 R2(config-if)#no shut
8.PAT 8.1PAT:
(只在R2上做了,只在se0/1/0上设置为inside,只在se0/1/1上设置为outside)
R2(config)#int s0/1/0 R2(config-if)#ip nat inside R2(config-if)#int s0/1/1 R2(config-if)#ip nat outside R2(config-if)#exit
R2(config)#ip nat pool NAT 123.123.123.10 123.123.123.100netmask 255.255.255.0 R2(config)#access-list 1 permit 192.168.0. 0.0.255.255 R2(config)#access-list 1 deny any
R2(config)#ip nat inside source list 1 interface serial 0/1/1 overload
8.2PAT测试:
用R1 ping R2,在R2上开启debug R1>en
Password:
R1#ping 13.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 13.1.1.1, timeout is 2 seconds: !!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 31/31/32 ms R2#
NAT: s=192.168.2.4->210.31.235.2, d=59.69.110.2 [3]
R2# NAT*: s=59.69.110.2, d=210.31.235.2->192.168.2.4 [3] ICMP: echo reply sent, src 200.1.1.2, dst 200.1.1.1
ICMP: echo reply sent, src 200.1.1.2, dst 200.1.1.1
9单臂路由
(在R3做了单臂路由,f0/1与交换机f0/24相连) S3(config)#int f0/1
S3(config-if)#switchport mode access S3(config-if)#switchport access vlan 2 S3(config-if)#int f0/12
S3(config-if)#switchport mode access S3(config-if)#switchport access vlan 3 S3(config-if)#int f0/24
S3(config-if)#switchport mode trunk
R3(config)#int f0/1
R3(config)#ip add 59.69.113.5 255.255.255.0 R3(config)#no shut R3(config)#int f0/1.1
R3(config-subif)#encapsulation dot1Q 2
R3(config-subif)#ip add 59.69.111.1 255.255.255.0 R3(config)#int f0/1.2
R3(config-subif)#encapsulation dot1Q 3
R3(config-subif)#ip add 59.69.112.1 255.255.255.0 R3(config-subif)#exit
10.HSRP
R6#show standby brief
P indicates configured to preempt. |
Interface Grp Prio P State Active Standby Virtual IP Gi0/0 1 120 P Active local unknown 192.168.2.1 Gi0/0 2 100 P Listen 192.168.45.5 unknown 192.168.2.254
11.多路由重分布
R2#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks C 192.168.12.0/24 is directly connected, Serial1/0 C 192.168.12.1/32 is directly connected, Serial1/0 1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/65] via 192.168.12.1, 00:01:36, Serial1/0 2.0.0.0/24 is subnetted, 1 subnets
C 2.2.2.0 is directly connected, Loopback1
O E2 192.168.14.0/24 [110/20] via 192.168.12.1, 00:01:36, Serial1/0 O E2 192.168.15.0/24 [110/20] via 192.168.12.1, 00:01:36, Serial1/0 10.0.0.0/24 is subnetted, 1 subnets
C 10.10.10.0 is directly connected, Tunnel1 123.0.0.0/24 is subnetted, 1 subnets
C 123.123.123.0 is directly connected, Serial1/1
六、总结和体会
经过这次的实训,我完整的练习了从需求分析、网络规划、具体实施和命令输入过程。完成了路由与交换工程设计到实施的步骤。感觉到了路由与交换设备领域的博大精深,体会到一切规划都是要满足需求分析,满足客户的需求是工程的目标。而且满足需求的途径方法是都种多样的,例如为满足来往通信路径相同,可以利用策略路由、QOS和各种方法的组合等。解决问题的方法也是多种多样的,路由与交换是一门很有深度的知识,学习他还要很长的路要走。
七、参考文献
《思科网络实验室路由与交换实验指南》
网上资料等