华为ENSP的MGRE实验:
建立好拓扑图 之后就是对各个路由器的配置:
R2配置:
int s3/0/0
link-protocol hdlc 更改接口为hdlc认证
ip address 12.1.1.2 24
int lo0
ip add 2.2.2.2 24
int s3/0/1
[r2-Serial3/0/1]ip address 23.1.1.2 24
[r2-Serial3/0/1]q
[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 address 24.1.1.1 24
[r2-Serial4/0/0]ppp authentication-mode chap
[r2-Serial4/0/0]q
[r2]aaa
[r2-aaa]local-user b password cipher 654321
[r2-aaa]local-user b service-type ppp
R1:
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 24
[r1]int s4/0/0
[r1-Serial4/0/0]ip address 12.1.1.1 24
[r1-Serial4/0/0]link-protocol hdlc
[r1]ip route-static 0.0.0.0 0 12.1.1.2
[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
[r1-Tunnel0/0/0]nhrp entry multicast dynamic
[r1-Tunnel0/0/0]nhrp network-id 100
[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 Tunnel 0/0/0
[r1-Tunnel0/0/0]undo rip split-horizon
[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]int s4/0/0
[r3-Serial4/0/0]ip add 23.1.1.1 24
[r3]ip route-static 0.0.0.0 0 23.1.1.2
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 192.168.2.1 24
[r3]interface 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
[r3-Tunnel0/0/0]nhrp entry 192.168.4.1 12.1.1.1 register
[r3-Tunnel0/0/0]nhrp network-id 100
[r3]rip 1
[r3-rip-1]ver 2
[r3-rip-1]network 192.168.2.0
[r3-rip-1]network 192.168.4.0
[r3]acl 2000
[r3-acl-basic-2000]rule permit source 192.168.2.0 0.0.0.255
[r3-Serial4/0/0]nat outbound 2000
R4:
[r4]int s4/0/0
[r4-Serial4/0/0]ip add 24.1.1.1 24
[r4]ip route-static 0.0.0.0 0 24.1.1.2
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip add 192.168.3.1 24
[r4]interface 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
[r4-Tunnel0/0/0]nhrp entry 192.168.4.1 12.1.1.1 register
[r4-Tunnel0/0/0]nhrp network-id 100
[r4]rip 1
[r4-rip-1]ver 2
[r4-rip-1]network 192.168.4.0
[r4-rip-1]network 192.168.3.0
[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
注:华为的接口初始为PPP认证,根据题目更改为HDLC认证
在配置R2-R3,R2-R4的认证时,先配置完认证,再连通两边的路由器,这样,或者在途中在两者之间的网线断掉再重启,这样避免认证失效。