实验拓扑图
实验要求
1.R5为ISP,只能进行IP地址配置,其所有地址均配为公有IP地址
2,R1和R5间使用PPP的PAP认证,R5为主认证方:
R2与R5之间使用ppp的CHAP认证,R5为主认证方;
R3与R5之间使用HDLC封装;
3.R1、R2、R3构建一个MGRE环境,R1为中心站点,R1、R4间为点到点的GRE:
4.整个私有网络基于RIP全网可达
实验思路
(1)配置ip地址
r1
[r1]in g0/0/0
[r1-GigabitEthernet0/0/0]ip a 192.168.1.254 24
[r1-GigabitEthernet0/0/0]int s4/0/0
[r1-Serial4/0/0]ip a 15.1.1.1 24
[r1-Serial4/0/0]q
r2
[r2]in g0/0/0
[r2-GigabitEthernet0/0/0]ip a 192.168.2.254 24
[r2-GigabitEthernet0/0/0]int s4/0/0
[r2-Serial4/0/0]ip a 25.1.1.1 24
[r2-Serial4/0/0]q
r3
[r3]in g0/0/0
[r3-GigabitEthernet0/0/0]
[r3-GigabitEthernet0/0/0]ip a 192.168.3.254 24
[r3-GigabitEthernet0/0/0]int s4/0/0
[r3-Serial4/0/0]ip a 35.1.1.1 24
[r3-Serial4/0/0]q
r4
[r4]in g0/0/0
[r4-GigabitEthernet0/0/0]ip a 192.168.4.254 24
[r4-GigabitEthernet0/0/0]int g0/0/1
[r4-GigabitEthernet0/0/1]ip a 45.1.1.1 24
[r4-GigabitEthernet0/0/1]q
r5
[ISP]int s4/0/1
[ISP-Serial4/0/1]ip a 15.1.1.2 24
[ISP-Serial4/0/1]int s3/0/1
[ISP-Serial3/0/1]ip a 25.1.1.2 24
[ISP-Serial3/0/1]int s4/0/0
[ISP-Serial4/0/0]ip a 35.1.1.2 24
[ISP-Serial4/0/0]int g 0/0/0
[ISP-GigabitEthernet0/0/0]ip a 45.1.1.2 24
[ISP-GigabitEthernet0/0/0]int l0
[ISP-LoopBack0]ip a 5.5.5.5 24
[ISP-LoopBack0]q
pc1
pc2
pc3
pc4
(2)配置指向ISP的缺省路由
[r1]ip route-static 0.0.0.0 0 15.1.1.2
[r2]ip route-static 0.0.0.0 0 25.1.1.2
[r3]ip route-static 0.0.0.0 0 35.1.1.2
[r4]ip route-static 0.0.0.0 0 45.1.1.2
(3)接口间的认证
(1)r1与r5之间使用PPP的PAP认证, r5为主认证方
LSP(r5)
[ISP]aaa
[ISP-aaa]local-user zengge privilege level 15 password cipher 123
[ISP-aaa]local-user zengge service-type ppp
[ISP-aaa]q
[ISP]int s4/0/1
[ISP-Serial4/0/1]link-protocol ppp
[ISP-Serial4/0/1]ppp authentication-mode pap
r1
[r1]int s4/0/0
[r1-Serial4/0/0]link-protocol ppp
[r1-Serial4/0/0]ppp pap local-user zengge password cipher 123
[r1-Serial4/0/0]q
(2)r2 与 r5间使用ppp的chap认证, r5为主认证方
r5
[ISP]aaa
[ISP-aaa]local-user aiye privilege level 15 password cipher 123
Info: Add a new user.
[ISP-aaa]local-user aiye service-type ppp
[ISP-aaa]q
[ISP]int s3/0/1
[ISP-Serial3/0/1]link-protocol ppp
[ISP-Serial3/0/1]ppp authentication-mode chap
[ISP-Serial3/0/1]q
r2
[r2]int s4/0/0
[r2-Serial4/0/0]link-protocol ppp
[r2-Serial4/0/0]ppp chap user aiye
[r2-Serial4/0/0]ppp chap password cipher 123
[r2-Serial4/0/0]q
(3)r3与r5之间做HDLC封装
r3
[r3]int s4/0/0
[r3-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
r5
[ISP]int s4/0/0
[ISP-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
(4)MGRE环境构建
r1
[r1]int Tunnel 0/0/0
[r1-Tunnel0/0/0]ip a 10.1.2.1 24
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp
[r1-Tunnel0/0/0]source 15.1.1.1
[r1-Tunnel0/0/0]nhrp entry multicast dynamic
[r1-Tunnel0/0/0]nhrp network-id 100
r2
[r2]int Tunnel 0/0/0
[r2-Tunnel0/0/0]ip a 10.1.2.2 24
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp
[r2-Tunnel0/0/0]source 25.1.1.1
[r2-Tunnel0/0/0]nhrp network-id 100
[r2-Tunnel0/0/0]nhrp entry 10.1.2.1 15.1.1.1 register
[r2-Tunnel0/0/0]q
r3
[r3]int Tunnel 0/0/0
[r3-Tunnel0/0/0]ip a 10.1.2.3 24
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source 35.1.1.1
[r3-Tunnel0/0/0]nhrp network-id 100
[r3-Tunnel0/0/0]nhrp entry 10.1.2.1 15.1.1.1 register
[r3-Tunnel0/0/0]q
(4)gre点到点配置
r1
[r1]int Tunnel 0/0/1
[r1-Tunnel0/0/1]ip a 10.1.1.1 24
[r1-Tunnel0/0/1]tunnel-protocol gre
[r1-Tunnel0/0/1]source 15.1.1.1
[r1-Tunnel0/0/1]destination 45.1.1.1
r4
[r4]int Tunnel 0/0/1
[r4-Tunnel0/0/1]ip a 10.1.1.4 24
[r4-Tunnel0/0/1]tunnel-protocol gre
[r4-Tunnel0/0/1]source 45.1.1.1
[r4-Tunnel0/0/1]destination 15.1.1.1
(4)配置RIP动态路由协议
r1
[r1]rip 1
[r1-rip-1]v 2
[r1-rip-1]network 192.168.1.0
[r1-rip-1]network 10.0.0.0
[r1-rip-1]silent-interface GigabitEthernet 0/0/0
[r1-rip-1]q
[r1]int Tunnel 0/0/0
[r1-Tunnel0/0/0]rip authentication-mode md5 usual cipher 123
[r1-Tunnel0/0/0]q
[r1]int Tunnel 0/0/1
[r1-Tunnel0/0/1]rip authentication-mode md5 usual cipher 123
[r1-Tunnel0/0/1]q
r2
[r2]rip 1
[r2-rip-1]v 2
[r2-rip-1]network 192.168.2.0
[r2-rip-1]network 10.0.0.0
[r2-rip-1]silent-interface GigabitEthernet 0/0/0
[r2-rip-1]q
[r2]int Tunnel 0/0/0
[r2-Tunnel0/0/0]rip authentication-mode md5 usual cipher 123
r3
[r1]rip 1
[r3-rip-1]v 2
[r3-rip-1]network 192.168.3.0
[r3-rip-1]network 10.0.0.0
[r3-rip-1]silent-interface GigabitEthernet 0/0/0
[r3-rip-1]q
[r3]int Tunnel 0/0/0
[r3-Tunnel0/0/0]rip authentication-mode md5 usual cipher 123
r4
[r4]rip 1
[r4-rip-1]v 2
[r4-rip-1]network 192.168.4.0
[r4-rip-1]network 10.0.0.0
[r4-rip-1]silent-interface GigabitEthernet 0/0/0
[r4-rip-1]q
[r4]int Tunnel 0/0/1
[r4-Tunnel0/0/1]rip authentication-mode md5 usual cipher 123
(5)配置ACL访问控制表
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]int s4/0/0
[r1-Serial4/0/0]nat outbound 2000
[r1-Serial4/0/0]q
r2
[r2]acl 2000
[r2-acl-basic-2000]rule permit source 192.168.2.0 0.0.0.255
[r2-acl-basic-2000]q
[r2]int s4/0/0
[r2-Serial4/0/0]nat outbound 2000
[r2-Serial4/0/0]q
r3
[r3]acl 2000
[r3-acl-basic-2000]rule permit source 192.168.3.0 0.0.0.255
[r3-acl-basic-2000]q
[r3]int s4/0/0
[r3-Serial4/0/0]nat outbound 2000
[r3-Serial4/0/0]q
r4
[r4]acl 2000
[r4-acl-basic-2000]rule permit source 192.168.4.0 0.0.0.255
[r4]int g0/0/1
[r4-GigabitEthernet0/0/1]nat o
[r4-GigabitEthernet0/0/1]nat outbound 2000
实验结果
发现全网可达