目录
题目
如图所示
根据题目设置拓扑图
路由器之间的连接方式是Serial接口,本身没有,需要单独加
如图所示
配置公网IP
AR2
设置S3/0/0口封装类型为HDLC
[r2]int s3/0/0
[r2-Serial3/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
Jan 10 2023 20:43:17-08:00 r2 %%01IFNET/4/CHANGE_ENCAP(l)[0]:The user performed
the configuration that will change the encapsulation protocol of the link and th
en selected Y.
[r2-Serial3/0/0]
Jan 10 2023 20:43:17-08:00 r2 %%01PPP/4/PHYSICALDOWN(l)[1]:On the interface Seri
al3/0/0, PPP link was closed because the status of the physical layer was Down.
*注:S3/0/1口封装类型为PPP,华为本身就是PPP,不需要改*
IP地址和环回:
[r2-Serial3/0/0]ip address 12.1.1.2 24
[r2-Serial3/0/0]int lo0
[r2-LoopBack0]ip add 2.2.2.2 24
[r2-LoopBack0]q
[r2]interface Serial 3/0/1
[r2-Serial3/0/1]ip address 23.1.1.2 24
[r2-Serial3/0/1]q
[r2]interface Serial 4/0/0
[r2-Serial4/0/0]ip address 24.1.1.1 24
定义账号:
[r2]aaa
[r2-aaa]local-user cn password cipher 123456
Info: Add a new user.
[r2-aaa]local-user cn service-type ppp
[r2-aaa]local-user wjh password cipher 654321
Info: Add a new user.
[r2-aaa]local-user wjh service-type ppp
设置S3/0/1接口需要进行pap认证
[r2-Serial3/0/1]ppp authentication-mode pap
设置S4/0/0接口需要进行chap认证
[r2-Serial4/0/0]ppp authentication-mode chap
[r2-Serial4/0/0]q
AR1
[r1-GigabitEthernet0/0/0]ip add 192.168.1.1 24
Jan 10 2023 21:14:21-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r1-GigabitEthernet0/0/0]q
[r1]interface Serial 4/0/0
[r1-Serial4/0/0]ip add 12.1.1.1 24
设置S4/0/0口封装类型为HDLC
[r1]interface Serial 4/0/0
[r1-Serial4/0/0]link-protocol HDLC
*检验是否设置成功ping 12.1.1.1(S3/0/0)*
AR3
[r3-Serial4/0/0]ip add 23.1.1.1 24
[r3-Serial4/0/0]
Jan 10 2023 21:22:09-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol PPP
IPCP on the interface Serial4/0/0 has entered the UP state.
AR4
[r4-Serial4/0/0]ip address 24.1.1.1 24
配置公网路由
缺省路由
AR1:
[r1]ip route-static 0.0.0.0 0 12.1.1.2
AR3:
[r3]ip route-static 0.0.0.0 0 23.1.1.2
AR4:
[r4]ip route-static 0.0.0.0 0 24.1.1.2
检测:
用r1pingr2的环回和23.1.1.1、24.1.1.1,查看是否能够ping通
配置私网IP
AR3
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 192.168.2.1 24
Jan 10 2023 22:15:15-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
AR4
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip add 192.168.3.1 24
Jan 10 2023 22:15:42-08:00 r4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
PC1
PC2
PC3
构建MRGE环境(R1、R2、R3)
AR1
[r1]interface Tunnel 0/0/0
[r1-Tunnel0/0/0]ip address 192.168.4.1 24
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp
[r1-Tunnel0/0/0]source 12.1.1.1
Jan 10 2023 22:30:28-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Tunnel0/0/0 has entered the UP state.
[r1-Tunnel0/0/0]nhrp entry multicast dynamic
[r1-Tunnel0/0/0]nhrp network-id 100
AR3
[r3]interface Tunnel 0/0/0
[r3-Tunnel0/0/0]ip address 192.168.4.3 24
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source Serial 4/0/0
Jan 10 2023 22:34:28-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 entry 192.168.4.1 12.1.1.1 register
[r3-Tunnel0/0/0]nhrp network-id 100
AR4
[r4]interface Tunnel 0/0/0
[r4-Tunnel0/0/0]ip address 192.168.4.4 24
[r4-Tunnel0/0/0]tunnel-protocol gre p2mp
[r4-Tunnel0/0/0]source Serial 4/0/0
Jan 10 2023 22:36:34-08:00 r4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Tunnel0/0/0 has entered the UP state.
[r4-Tunnel0/0/0]nhrp entry 192.168.4.1 12.1.1.1 register
[r4-Tunnel0/0/0]nhrp network-id 100
使用rip获取路由
AR1
[r1]rip 1
[r1-rip-1]ver 2
[r1-rip-1]network 192.168.1.0
[r1-rip-1]network 192.168.4.0
AR3
[r3]rip 1
[r3-rip-1]ver 2
[r3-rip-1]network 192.168.2.0
[r3-rip-1]network 192.168.4.0
AR4
[r4]rip 1
[r4-rip-1]ver 2
[r4-rip-1]network 192.168.4.0
[r4-rip-1]network 192.168.3.0
用PC1ping192.168.2.2或192.168.3.2,查看是否能ping通
使PC可以上网(ping通R2的环回)
AR1
[r1]acl 2000
[r1-acl-basic-2000]per
[r1-acl-basic-2000]ru
[r1-acl-basic-2000]rule per
[r1-acl-basic-2000]rule permit so
[r1-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[r1-acl-basic-2000]int s4/0/0
[r1-Serial4/0/0]nat ou
[r1-Serial4/0/0]nat outbound 2000
AR3
[r3]acl 2000
[r3-acl-basic-2000]rule permit source 192.168.2.0 0.0.0.255
[r3-acl-basic-2000]int s4/0/0
[r3-Serial4/0/0]nat outbound 2000
AR4
[r4]acl 2000
[r4-acl-basic-2000]rule permit source 192.168.3.0 0.0.0.255
[r4-acl-basic-2000]int s4/0/0
[r4-Serial4/0/0]nat outbound 2000