实验题目:
分析重点:
R1、R3、R4上都配置RIP协议且不宣告外网的网段
R1、R3、R4都要配置NAT地址转换、
注意关闭水平分割
拓扑图:
配置内容:
R1:
[Huawei]sysname r1
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.1.1 24
[r1-GigabitEthernet0/0/0]int s4/0/0
[r1-Serial4/0/0]ip add 12.1.1.1 24
[r1-Serial4/0/0]link-protocol hdlc
[r1-Serial4/0/0]q
[r1]ip route-static 0.0.0.0 0 12.1.1.2
[r1]int Tunnel 0/0/0
[r1-Tunnel0/0/0]ip add 1.1.1.1 24
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp
[r1-Tunnel0/0/0]source 12.1.1.1
[r1-Tunnel0/0/0]nhrp entry multicast dynamic
[r1-Tunnel0/0/0]nhrp network-id 100
[r1-Tunnel0/0/0]rip 1
[r1-rip-1]version 2
[r1-rip-1]network 1.0.0.0
[r1-rip-1]network 192.168.1.0
[r1-rip-1]q
[r1]acl number 2000
[r1-acl-basic-2000]rule 5 permit
[r1-acl-basic-2000]int s4/0/0
[r1-Serial4/0/0]nat outbound 2000
[r1-Serial4/0/0]int t0/0/0
[r1-Tunnel0/0/0]undo rip split-horizon //关闭隧道的水平分割
R2(ISP运营商):
[Huawei]sysname isp
[isp]int s3/0/0
[isp-Serial3/0/0]ip add 12.1.1.2 24
[isp-Serial3/0/0]int s3/0/1
[isp-Serial3/0/1]ip add 23.1.1.2 24
[isp-Serial3/0/1]int s4/0/0
[isp-Serial4/0/0]ip add 24.1.1.2 24
[isp-Serial4/0/0]int loo 0
[isp-LoopBack0]ip add 2.2.2.2 24
[isp-LoopBack0]int s3/0/0
[isp-Serial3/0/0]link-protocol hdlc
[isp-Serial3/0/0]aaa
[isp-aaa]local-user huawei password cipher huawei
Info: Add a new user.
[isp-aaa]local-user huawei service-type ppp
[isp-aaa]int s3/0/1
[isp-Serial3/0/1]link-protocol ppp
[isp-Serial3/0/1]ppp authentication-mode pap
[isp-Serial3/0/1]int s4/0/0
[isp-Serial4/0/0]link-protocol ppp
[isp-Serial4/0/0]ppp authentication-mode chap
R3:
[Huawei]sysname r3
[r3]int g0/0/1
[r3-GigabitEthernet0/0/1]ip add 192.168.2.1 24
[r3-GigabitEthernet0/0/1]int s4/0/0
[r3-Serial4/0/0]ip add 23.1.1.3 24
[r3-Serial4/0/0]int s4/0/0
[r3-Serial4/0/0]link-protocol ppp
[r3-Serial4/0/0]ppp pap local-user huawei password cipher huawei
[r3-Serial4/0/0]q
[r3]ip route-static 0.0.0.0 0 23.1.1.2
[r3]int Tunnel 0/0/0
[r3-Tunnel0/0/0]ip add 1.1.1.2 24
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source s4/0/0
[r3-Tunnel0/0/0]nhrp network-id 100
[r3-Tunnel0/0/0]nhrp entry 1.1.1.1 12.1.1.1 register
[r3-Tunnel0/0/0]q
[r3]rip 1
[r3-rip-1]version 2
[r3-rip-1]network 1.0.0.0
[r3-rip-1]network 192.168.2.0
[r3-rip-1]q
[r3]acl number 2000
[r3-acl-basic-2000]rule 5 permit
[r3-acl-basic-2000]int s4/0/0
[r3-Serial4/0/0]nat outbound 2000
R4:
[Huawei]sysname r4
[r4]int g0/0/1
[r4-GigabitEthernet0/0/1]ip add 192.168.3.1 24
[r4-GigabitEthernet0/0/1]int s4/0/0
[r4-Serial4/0/0]ip add 24.1.1.4 24
[r4-Serial4/0/0]int s4/0/0
[r4-Serial4/0/0]link-protocol ppp
[r4-Serial4/0/0]ppp chap user huawei
[r4-Serial4/0/0]ppp chap password cipher huawei
[r4-Serial4/0/0]q
[r4]ip route-static 0.0.0.0 0 24.1.1.2
[r4]int Tunnel 0/0/0
[r4-Tunnel0/0/0]ip add 1.1.1.3 24
[r4-Tunnel0/0/0]tunnel-protocol gre p2mp
[r4-Tunnel0/0/0]source S4/0/0
[r4-Tunnel0/0/0]nhrp network-id 100
[r4-Tunnel0/0/0]nhrp entry 1.1.1.1 12.1.1.1 register
[r4-Tunnel0/0/0]q
[r4]rip 1
[r4-rip-1]version 2
[r4-rip-1]network 1.0.0.0
[r4-rip-1]network 192.168.3.0
[r4-rip-1]q
[r4]acl number 2000
[r4-acl-basic-2000]int s4/0/0
[r4-Serial4/0/0]nat outbound 2000
实验验证:
R1
R3
R4
pc配置图(pc1、pc2、pc3)
pc1 分别ping ISP的环回、pc2、pc3