一. 实验要求
二. 配置
1. 规划
2. ip配置
2.1 R2
[r2]int s3/0/0
[r2-Serial3/0/0]link
[r2-Serial3/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
[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]int s3/0/1
[r2-Serial3/0/1]ip address 23.1.1.2 24
[r2-Serial3/0/1]q
[r2]
[r2]aaa
[r2-aaa]local-user a password cipher 123456
Info: Add a new user.
[r2-aaa]local-user a service-type ppp
[r2-aaa]q
[r2]int s3/0/1
[r2-Serial3/0/1]ppp authentication-mode pap
[r2-Serial3/0/1]q
[r2]int s4/0/0
[r2-Serial4/0/0]ip add 24.1.1.2 24
[r2-Serial4/0/0]ppp authentication-mode chap
[r2-Serial4/0/0]q
[r2]aaa
[r2-aaa]local-user b password cipher 654321
Info: Add a new user.
[r2-aaa]local-user b service-type ppp
2.2 R1
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.1.1 24
[r1-GigabitEthernet0/0/0]q
[r1]int s4/0/0
[r1-Serial4/0/0]ip add 12.1.1.1 24
[r1-Serial4/0/0]link
[r1-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
测试
2.3 R3
先在R2上操作:
[r2]int s3/0/1
[r2-Serial3/0/1]shutdown
[r2-Serial3/0/1]undo shutdown
在R3上:
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 192.168.2.1 24
[r3]int s4/0/0
[r3-Serial4/0/0]ip add 23.1.1.1 24
[r3-Serial4/0/0]ppp pap ?
local-user Specify user name
[r3-Serial4/0/0]ppp pap local-user a ?
password Specify user password
[r3-Serial4/0/0]ppp pap local-user a password cipher 123456
[r3-Serial4/0/0]
Jan 2 2023 20:38:17-08:00 r3 %%01IFNET/4/LINK_STATE(l)[19]:The line protocol PP
P on the interface Serial4/0/0 has entered the UP state.
[r3-Serial4/0/0]
Jan 2 2023 20:38:17-08:00 r3 %%01IFNET/4/LINK_STATE(l)[20]:The line protocol PP
P IPCP on the interface Serial4/0/0 has entered the UP state.
测试
2.4 R4
先在R2上操作:
[r2]int s4/0/0
[r2-Serial4/0/0]shutdown
[r2-Serial4/0/0]undo shutdown
在R4上:
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip add 192.168.3.1 24
[r4]int s4/0/0
[r4-Serial4/0/0]ip add 24.1.1.1 24
[r4-Serial4/0/0]ppp chap user b
[r4-Serial4/0/0]ppp chap password cipher 654321
测试
3. 路由配置
R1:
[r1]ip route-static 0.0.0.0 0 12.1.1.2
R3:
[r3]ip route-static 0.0.0.0 0 23.1.1.2
R4:
[r4]ip route-static 0.0.0.0 0 24.1.1.2
测试
4. 电脑配置
5. 构建MGRE
R1:
[r1]int Tunnel 0/0/0
[r1-Tunnel0/0/0]ip add 192.168.4.1 24
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp
[r1-Tunnel0/0/0]source 12.1.1.1
Jan 2 2023 21:18:00-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
R3:
[r3]int Tunnel 0/0/0
[r3-Tunnel0/0/0]ip add 192.168.4.3 24
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source Serial 4/0/0
Jan 2 2023 21:23:16-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
R4:
[r4]int Tunnel 0/0/0
[r4-Tunnel0/0/0]ip add 192.168.4.4 24
[r4-Tunnel0/0/0]tunnel-protocol gre p2mp
[r4-Tunnel0/0/0]source Serial 4/0/0
Jan 2 2023 21:26:11-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
测试
6. 内网
R1:
[r1]rip 1
[r1-rip-1]ver 2
[r1-rip-1]network 192.168.1.0
[r1-rip-1]network 192.168.4.0
[r1]int t0/0/0
[r1-Tunnel0/0/0]undo rip split-horizon
R3:
[r3]rip 1
[r3-rip-1]ver 2
[r3-rip-1]network 192.168.2.0
[r3-rip-1]network 192.168.4.0
R4:
[r4]rip 1
[r4-rip-1]ver 2
[r4-rip-1]network 192.168.4.0
[r4-rip-1]network 192.168.3.0
测试
7.测试实验
8.acl配置
R1:
[r1]acl 2000
[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 outbound 2000
R3:
[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
R4:
[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
测试