实验要求:
1.R6为ISP,接口IP地址为公有地址;该设备只能配IP地址,之后不能在对其进行任何配置;
2.R1-R5为局域网,私有IP地址192.168.1.0/24请合理分配;
3.R1,R2,R4,各有两个环回地址,R5R6各有一个;所有路由器上环回均代表连接用户的接口;
4.R3下的两台PC通过DHCP自动获取IP地址;
5.选路最佳,路由表尽量小,避免环路;
6.R1-R5均可访问R6的环回;
7.R6 telnet R5的公有IP地址时,实际登录到R1上;
8.R4与R5正常通过1000M链路,故障时,通过100M链路。
拓扑图
基本配置
r1:
[R1]interface g0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.1.5 30
[R1-GigabitEthernet0/0/0]interface g0/0/1
[R1-GigabitEthernet0/0/1]ip address 192.168.1.7 30 (前面都是接口地址)
[R1-GigabitEthernet0/0/1]interface LoopBack 0 (开始环回地址)
[R1-LoopBack0]ip address 191.168.1.33 28
[R1-LoopBack0]interface LoopBack 1
[R1-LoopBack1]ip address 191.168.1.49 28其他路由器接口依次配好地址和环回
r3配置dhcp
[R3]dhcp enable
[R3]ip pool 1
[R3-ip-pool-1]network 192.168.1.96 mask 255.255.255.224
[R3-ip-pool-1]gateway-list 192.168.1.97 (接口ip)
[R3]ip pool 1]dns-list 8.8.8.8 114.114.114.114
[R3-ip-pool-1]quit
[R3]interface g0/0/2
[R3-GigabitEthernet0/0/2]dhcp select global
配置静态路由
[R1]ip route-static 192.168.1.20 30 192.168.1.18
[R1]ip route-static 192.168.1.96 27 192.168.1.18
[R1]ip route-static 192.168.1.24 30 192.168.1.6
[R1]ip route-static 192.168.1.30 30 192.168.1.18
[R1]ip route-static 12.0.0.0 24 192.168.1.6
[R1]ip route-static 192.168.1.64 27 192.168.1.6
[R1]ip route-static 192.168.1.128 27 192.168.1.6
[R1]ip route-static 192.168.1.160 27 192.168.1.6
其他依次配置
设置空接口路由
[R1]ip route-static 192.168.1.32 27 NULL 0
[R2]ip route-static 192.168.1.64 27 NULL 0
[R4]ip route-static 192.168.1.128 27 NULL 0
r5配置nat和缺省路由
[R5]ip route-static 0.0.0.0 0 12.0.0.2
[R5]acl 2000
[R5-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255(反掩码)
[R5-acl-basic-2000]int g0/0/1
[R5-GigabitEthernet0/0/1]nat outbound 2000
r1进行telant
[R1-aaa]local-user R1 password cipher 123
Info: Add a new user.
[R1-aaa]local-user R1 service-type telnet
[R1-aaa]q
[R1]user-interface vty 0 4
[R1-ui-vty0-4]authentication-mode aaa
r5进行端口映射
[R5]interface g0/0/1
[R5-GigabitEthernet0/0/1]nat server protocol tcp global current-interface 23 ins
ide 192.168.1.5 23
进行测试
r1至r5均可ping通r6环回
P1,P2pingr6