1.拓扑图
1.配置ip
r1:
[R1]int Serial 4/0/0
[R1-Serial4/0/0]ip address 15.0.0.1 24
[R1-Serial4/0/0]int g0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.1.1 24
r2:
[R2]int s 4/0/0
[R2-Serial4/0/0]ip address 25.0.0.1 24
[R2-Serial4/0/0]int g0/0/0
[R2-GigabitEthernet0/0/0]ip address 192.168.2.1 24
r3:
[R3]int s4/0/0
[R3-Serial4/0/0]ip address 35.0.0.1 24
[R3-Serial4/0/0]int g0/0/0
[R3-GigabitEthernet0/0/0]ip address 192.168.3.1 24
r4:
[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]ip address 45.0.0.1 24
Mar 30 2023 21:16:58-08:00 R4 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R4-GigabitEthernet0/0/0]int g0/0/1
[R4-GigabitEthernet0/0/1]ip address 192.168.4.1 24
r5/isp:
interface Serial3/0/0
ip address 35.0.0.5 255.255.255.0
interface Serial4/0/0
ip address 15.0.0.5 255.255.255.0
interface Serial4/0/1
ip address 25.0.0.5 255.255.255.0
interface GigabitEthernet0/0/0
ip address 45.0.0.5 255.255.255.0
配置缺省路由:
[R1]ip route-static 0.0.0.0 0 15.0.0.5
[R2]ip route-static 0.0.0.0 0 25.0.0.5
[R3]ip route-static 0.0.0.0 0 35.0.0.5
[R4]ip route-static 0.0.0.0 0 45.0.0.5
PAP认证:
主认证方:
[R5]aaa
[R5-aaa]local-user huawei password cipher 12345
[R5-aaa]local-user huawei service-type ppp
[R5]interface s4/0/0
[R5-Serial4/0/0]ppp authentication-mode pap
被认证方:
[R1]interface s4/0/0
[R1-Serial4/0/0]ppp pap local-user huawei password cipher 12345
CHAP认证:
主认证方:
[R5]aaa
[R5-aaa]local-user huawei password cipher 12345
[R5-aaa]local-user huawei service-type ppp
[R5]interface s4/0/0
[R5-Serial4/0/0]ppp authentication-mode chap
被认证方:
[R2]interface s4/0/0
[R2-Serial4/0/0]ppp chap user huawei
[R2-Serial4/0/0]ppp chap password cipher 12345
封装:
[R3]inter s4/0/0
[R3-Serial4/0/0]link-protocol hdlc
[R5]interface s3/0/0
[R5-Serial3/0/0]link-protocol hdlc
构建MGRE环境:
r1:
[R1]interface Tunnel 0/0/0
[R1-Tunnel0/0/0]ip address 10.0.0.1 24
[R1-Tunnel0/0/0]tunnel-protocol gre p2mp
[R1-Tunnel0/0/0]source 15.0.0.1
[R1-Tunnel0/0/0]nhrp network-id 100
r2:
[R2]interface Tunnel 0/0/0
[R2-Tunnel0/0/0]ip address 10.0.0.2 24
[R2-Tunnel0/0/0]tunnel-protocol gre p2mp
[R2-Tunnel0/0/0]source s4/0/0
[R2-Tunnel0/0/0]nhrp entry 10.0.0.1 15.1.1.1 register
[R2-Tunnel0/0/0]nhrp network-id 100
r3:
[R3]interface Tunnel 0/0/0
[R3-Tunnel0/0/0]ip address 10.0.0.3 24
[R3-Tunnel0/0/0]tunnel-protocol gre p2mp
[R3-Tunnel0/0/0]source s4/0/0
[R3-Tunnel0/0/0]nhrp network-id 100
[R3-Tunnel0/0/0]nhrp entry 10.0.0.1 15.1.1.1 register
r1,r4之间配置MGR:
r1:
[R1]interface Tunnel 0/0/1
[R1-Tunnel0/0/1]ip address 20.0.0.1 24
[R1-Tunnel0/0/1]tunnel-protocol gre
[R1-Tunnel0/0/1]source 15.0.0.1
[R1-Tunnel0/0/1]destination 45.1.1.4
r4:
[R4]interface Tunnel 0/0/1
[R4-Tunnel0/0/1]ip address 20.1.1.2 24
[R4-Tunnel0/0/1]tunnel-protocol gre
[R4-Tunnel0/0/1]source 45.0.0.4
[R4-Tunnel0/0/1]destination 15.0.0.1
RTP路由:
[R1]rip 1
[R1-rip-1]version 2
[R1-rip-1]network 192.168.1.0
[R1-rip-1]network 10.0.0.0
[R1-rip-1]network 20.0.0.0
[R2]rip 1
[R2-rip-1]version 2
[R2-rip-1]network 192.168.2.0
[R2-rip-1]network 10.0.0.0
[R3]rip 1
[R3-rip-1]version 2
[R3-rip-1]network 192.168.3.0
[R3-rip-1]network 10.0.0.0
[R4]rip 1
[R4-rip-1]version 2
[R4-rip-1]network 20.0.0.0
[R4-rip-1]network 192.168.4.0
由于rip需要开启伪广播和关闭水平分割
[R1]interface Tunnel 0/0/0
[R1-Tunnel0/0/0]nhrp entry multicast dynamic //开启伪广播
[R1-Tunnel0/0/0]undo rip split-horizon
PC配置
设备 | 地址 | 网关 |
---|---|---|
PC1 | 192.168.1.2/24 | 192.168.1.1/24 |
PC2 | 192.168.2.2/24 | 192.168.2.1/24 |
PC3 | 192.168.3.2/24 | 192.168.3.1/24 |
PC4 | 192.168.4.2/24 | 192.168.4.1/24 |
由于R5没有R1其他PC的回包路由所以需要在R1,2,3,4做nat:
[R1]acl 2000
[R1-acl-basic-2000]rule 1 permit source any
[R1-acl-basic-2000]q
[R1]inter s4/0/0
[R1-Serial4/0/0]nat outbound 2000
[R2]acl 2000
[R2-acl-basic-2000]rule 1 permit source any
[R2-acl-basic-2000]q
[R2]inter s4/0/0
[R2-Serial4/0/0]nat outbound 2000
[R3]acl 2000
[R3-acl-basic-2000]rule 1 permit source any
[R3-acl-basic-2000]q
[R3]inter s4/0/0
[R3-Serial4/0/0]nat outbound 2000
[R4]acl 2000
[R4-acl-basic-2000]rule 1 permit source any
[R4-acl-basic-2000]q
[R4]inter s4/0/0
[R4-Serial4/0/0]nat outbound 2000
完成!!!