试验要求:
1、R2为ISP,其上只能配置IP地址。
2、R1-R2之间为HDLC封装。
3、R2-R3之间为PPP封装,pap认证,R2为主认证方。
4、R2-R4之间为ppp封装,chap认证,R2为主认证方。
5、R1、R2、R3构建MGRE环境,仅R1 IP地址固定。
6、搭建MGRE环境的步骤,全网可达。
根据试验搭建的拓扑图:
试验步骤:
第一步:
给每个pc配置ip,给每个路由器配置ip,过程过于简单,就不在这截图了
第二步:
用R1去ping R2 可以ping通,给R1-R2之间为HDLC封装
步骤:
先对R1操作:
Interface s4/0/0
link-protocol hdlc
然后用R1去ping R2 发现ping不通
对R2操作:
Interface s3/0/0
link-protocol hdlc
发现R1,R2又可以ping通了
第三步:
R2-R3之间为PPP封装,pap认证,R2为主认证方
步骤:
先对R2操作:
Interface s3/0/1
link-protocol ppp
对R3操作:
Interface s4/0/0
link-protocol ppp
认证步骤:
对R2(主认证方):
[r2]aaa
[r2-aaa]local-user biyahui privilege level 15 password cipher 123456
Info: Add a new user.
[r2-aaa]local-user biyahui service-type ppp
[r2-aaa]q
[r2]
[r2]interface Serial 3/0/1
[r2-Serial3/0/1]ppp authentication-mode pap
对R3(被认证方):
[r3]interface Serial 4/0/0
[r3-Serial4/0/0]ppp pap local-user biyahui password cipher 123456
第四步:
R2-R4之间为ppp封装,chap认证,R2为主认证方
步骤:
先对R2操作:
Interface s4/0/0
link-protocol ppp
对R4操作:
Interface s4/0/0
link-protocol ppp
对R2的操作(主认证方):
r2]aaa
[r2-aaa]local-user biyahui privilege level 15 password cipher 123456
[r2-aaa]local-user biyahui service-type ppp
[r2-aaa]q
[r2]interface Serial 4/0/0
[r2-Serial4/0/0]ppp authentication-mode chap
对r4的操作(被认证方):
[r4]interface Serial 4/0/0
[r4-Serial4/0/0]ppp chap password cipher 123456
[r4-Serial4/0/0]ppp chap user biyahui
第五步:
R1、R3、R4构建MGRE环境,仅R1 IP地址固定
对R1写缺省:
[r1]ip route-static 0.0.0.0 0 12.1.1.2
对R3写缺省:
[r3]ip route-static 0.0.0.0 0 13.1.1.2
对R4写缺省:
[r4]ip route-static 0.0.0.0 0 14.1.1.2
写到现在这个地步,R1、R3、R4、可以相互ping通公网,且都可以ping通R2的环回
搭建MGRE环境的步骤:
对R1的操作:
[r1]interface Tunnel 0/0/0
[r1-Tunnel0/0/0]ip address 10.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 dynameic
[r1-Tunnel0/0/0]nhrp network-id 100
对R3的操作:
[r3]interface Tunnel 0/0/0
[r3-Tunnel0/0/0]ip address 10.1.1.2 24
[r3-Tunnel0/0/0]tunnel-protocol gre
[r3-Tunnel0/0/0]source 13.1.1.1
[r1-Tunnel0/0/0]nhrp entry 10.1.1.1 12.1.1.1 register
[r1-Tunnel0/0/0]nhrp network-id 100
对R4的操作:
[r3]interface Tunnel 0/0/0
[r3-Tunnel0/0/0]ip address 10.1.1.4 24
[r3-Tunnel0/0/0]tunnel-protocol gre
[r3-Tunnel0/0/0]source 14.1.1.1
[r1-Tunnel0/0/0]nhrp entry 10.1.1.1 12.1.1.1 register
[r1-Tunnel0/0/0]nhrp network-id 100
现在可以用R1去ping R3的10.1.1.2 可以ping通
第六步:
全网可达:
对R1的操作:
[r1]rip
[r1-rip-1]ver 2
[r1-rip-1]network 192.168.1.0
[r1-rip-1]network 10.0.0.0
对R2:
[r2]rip
[r2-rip-1]ver 2
[r2-rip-1]network 192.168.2.0
[r2-rip-1]network 10.0.0.0
对R3:
[r3]rip
[r3-rip-1]ver 2
[r3-rip-1]network 192.168.3.0
[r3-rip-1]network 10.0.0.0
然后是rip BUG,需要去掉rip水平分割:
R1中:
interface t0/0/0
undo rip splite-horizon
现在R1、R2、R3可以互相ping通
然后写NAT转换:
对R1:
[r1]acl 2000
[r1-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[r1-acl-basic-2000]q
[r1]interface Serial 4/0/0
[r1-Serial4/0/0]nat outbound 2000
对R2:
[r2]acl 2000
[r2-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[r2-acl-basic-2000]q
[r2]interface Serial 4/0/0
[r2-Serial4/0/0]nat outbound 2000
在对R4进行NAT地址转换
对R3:
[r2]acl 2000
[r2-acl-basic-2000]rule permit source 192.168.3.0 0.0.0.255
[r2-acl-basic-2000]q
[r2]interface Serial 4/0/0
[r2-Serial4/0/0]nat outbound 2000
现在R1、R2都是可以互相ping通,都还能ping通环回
试验到此全网可达!