1.配置每个路由的IP地址
[r1]int s 4/0/0
[r1-Serial4/0/0]ip address 15.0.0.1 24
[r1-Serial4/0/0]int g 0/0/0
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 24
[r2] int s 4/0/0
[r2-Serial4/0/0] ip address 25.0.0.1 24
[r2-Serial4/0/0] int g 0/0/0
[r2-GigabitEthernet0/0/0] ip address 192.168.2.1 24
[r3]int s 4/0/0
[r3-Serial4/0/0]ip ad 35.0.0.1 24
[r3-Serial4/0/0]int g 0/0/0
[r3-GigabitEthernet0/0/0]ip ad 192.168.3.1 24
[r4]int g 0/0/0
[r4-GigabitEthernet0/0/0]ip ad 45.0.0.1 24
[r4-GigabitEthernet0/0/0]int g 0/0/1
[r4-GigabitEthernet0/0/1]ip ad 192.168.4.1 24
[ISP] int s 3/0/0
[ISP-Serial3/0/0]ip ad 15.0.0.2 24[ISP-Serial3/0/0]int s 3/0/1
[ISP-Serial3/0/1]ip ad 25.0.0.2 24
[ISP-Serial3/0/1]int s 4/0/0
[ISP-Serial4/0/0]ip ad 35.0.0.2 24[ISP-Serial4/0/0]int g 0/0/0
[ISP-GigabitEthernet0/0/0]ip ad 45.0.0.2 24[ISP-GigabitEthernet0/0/0]int l0
[ISP-LoopBack0]ip ad 5.5.5.5 24
2.r1和r5之间实现ppp连接及pap认证
认证方r5
[ISP]aaa
[ISP-aaa]local-user admin password cipher 114514
[ISP-aaa]local-user admin service-type ppp
[ISP]int s 3/0/0
[ISP-Serial3/0/0]ppp authentication-mode pap
被认证方r1
[r1-Serial4/0/0]ppp pap local-user admin password cipher 123456
3.r2和r5用ppp连接且作chap认证
认证方r5
[ISP]int s 3/0/1
[ISP-Serial3/0/1]ppp authentication-mode chap
被认证方r2
[r2]int s 4/0/0
[r2-Serial4/0/0]ppp chap user admin
[r2-Serial4/0/0]ppp chap password cipher 114514
4.r3和r5之间用HDLC封装
[r3]int s 4/0/0
[r3-Serial4/0/0]link-protocol hdlc
[ISP]int s 4/0/0
[ISP-Serial4/0/0]link-protocol hdlc
5. r1r2r3构建MGRE环境,r1为中心点
中心点r5
[ISP-Serial4/0/0]int tunnel 0/0/0
[ISP-Tunnel0/0/0]ip ad 192.168.5.1 24
[ISP-Tunnel0/0/0]tunnel-protocol gre p2mp
[ISP-Tunnel0/0/0]source 15.0.0.1
[ISP-Tunnel0/0/0]nhrp network-id 100
[ISP-Tunnel0/0/0]nhrp entry multicast dynamic
[r2]int tunnel 0/0/0
[r2-Tunnel0/0/0]ip ad 192.168.5.2 24
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp
[r2-Tunnel0/0/0]source Serial 4/0/0
Sep 22 2022 16:21:43-08:00 r2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Tunnel0/0/0 has entered the UP state.
[r2-Tunnel0/0/0]nhrp network-id 100
[r2-Tunnel0/0/0]nhrp entry 192.168.5.1 15.0.0.1 register
[r3]int Tunnel 0/0/0
[r3-Tunnel0/0/0]ip ad 192.168.5.3 24
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source Serial 4/0/0
Sep 22 2022 16:24:17-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Tunnel0/0/0 has entered the UP state.
[r3-Tunnel0/0/0]nhrp network-id 100
[r3-Tunnel0/0/0]nhrp entry 192.168.5.1 15.0.0.1 register
6.r1 r4 搭建gre
[r1] int tunnel 0/0/1
[r1-Tunnel0/0/1]ip ad 192.168.6.1 24
[r1-Tunnel0/0/1]tunnel-protocol gre
[r1-Tunnel0/0/1]source 15.0.0.1
[r1-Tunnel0/0/1]description 45.0.0.1
[r4]int tunnel 0/0/01
[r4-Tunnel0/0/1]ip ad 192.168.6.2 24
[r4-Tunnel0/0/1]tunnel-protocol gre
[r4-Tunnel0/0/1]description 15.0.0.1
[r4-Tunnel0/0/1]source 45.0.0.1
7.整个私有网络基于rip可达
[r1] rip
[r1-rip-1] version 2
[r1-rip-1] network 192.168.1.0
[r1-rip-1] network 192.168.5.0
[r1-rip-1] network 192.168.6.0
[r2] rip
[r2-rip-1] v 2
[r2-rip-1] net 192.168.5.0
[r2-rip-1] net 192.168.2.0
[r3] rip
[r3-rip-1] v 2
[r3-rip-1] net 192.168.5.0
[r3-rip-1] net 192.168.3.0
[r4] rip
[r4-rip-1] v 2
[r4-rip-1] net 192.168.4.0
[r4-rip-1] net 192.168.6.0
[r1] interface Tunnel 0/0/0
[r1-Tunnel0/0/0] undo rip split-horizon ---关闭水平分割
8.配置缺省路由,使私网全网可达
[r1] ip route-static 0.0.0.0 0 15.0.0.2
[r2] ip route-static 0.0.0.0 0 25.0.0.2
[r3] ip route-static 0.0.0.0 0 35.0.0.2
[r4] ip route-static 0.0.0.0 0 45.0.0.2
9.配置 acl抓取流量,用r2的主机pc3访问公网的环回
[r2]acl 2000
[r2-acl-basic-2000]rule permit source 192.168.0.0 0.0.255.255
[r2]int s 4/0/0
[r2-Serial4/0/0]nat outbound 2000