要求
成品图
设计思路
1.给每个接口配置IP,R2配置环回 。
2.R1与R2之间的接口需要HDLC封装。
3.R2与R3之间的接口需要PPP进行封装,用PAP认证,R2配置为主认证方,R2与R4之间PPP封装,使用CHAP认证,R2为配置主认证方。
4.R1、R2、R3构建MGRE环境,R1为中心站点,R3与R4为分支站点,
5.内网使用RIP协议获取路由来互相访问
设计步骤
1.配置IP
1.R1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.1.2 24
[R1-GigabitEthernet0/0/0]q
[R1]interface Serial4/0/0
[R1-Serial4/0/0]ip address 12.1.1.1 24
1.2HDLC封装
[R1-Serial4/0/0]link-protocol hdlc
[R1-Serial4/0/0]q
2.R2
[R2]int s4/0/0
[R2-Serial4/0/0]ip ad
[R2-Serial4/0/0]ip address 12.1.1.2 24
[R2-Serial4/0/0]int s4/0/1
[R2-Serial4/0/1]ip ad
[R2-Serial4/0/1]ip address 32.1.1.1 24
[R2-Serial4/0/1]int s3/0/0
[R2-Serial3/0/0]ip address 42.1.1.1 24
[R2-Serial3/0/0]
[R2-Serial3/0/0]q
[R2]int s4/0/0
2.2HDLC封装
[R2-Serial4/0/0]link-protocol hdlc
[R2-Serial4/0/0]q
[R2]display ip interface brief
3.R3
[R3]int s4/0/0
[R3-Serial4/0/0]ip ad
[R3-Serial4/0/0]ip address 32.1.1.2 24
[R3-Serial4/0/0]int g0/0/0
[R3-GigabitEthernet0/0/0]ip address 192.168.2.1 24
4.R4
[R4]int s4/0/0
[R4-Serial4/0/0]ip address 42.1.1.2 24
[R4-Serial4/0/0]int g0/0/0
[R4-GigabitEthernet0/0/0]ip address 192.168.3.1 24
2.配置静态路由
[R1]ip route-static 0.0.0.0 0 12.1.1.2
[R3]ip route-static 0.0.0.0 0 32.1.1.1
[R4]ip route-static 0.0.0.0 0 42.1.1.1
3.配置NAT
1.R1
[R1]acl 2000
[R1-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[R1-acl-basic-2000]q
[R1]int s4/0/0
[R1-Serial4/0/0]nat outbound 2000
[R1-Serial4/0/0]q
2.R3
[R3]acl 2000
[R3-acl-basic-2000]rule permit source 192.168.2.0 0.0.0.255
[R3-acl-basic-2000]q
[R3]int s4/0/0
[R3-Serial4/0/0]nat outbound 2000
[R3-Serial4/0/0]q
3.R4
[R4]acl 2000
[R4-acl-basic-2000]rule permit source 192.168.3.0 0.0.0.255
[R4-acl-basic-2000]q
[R4]int s4/0/0
[R4-Serial4/0/0]nat outbound 2000
[R4-Serial4/0/0]q
4.对R2与R3之间的接口进行PPP认证
1.R2
[R2]aaa
[R2-aaa]local-user huawei password cipher 123456
[R2-aaa]local-user huawei service-type ppp
[R2-aaa]q
[R2]interface s4/0/0
[R2-Serial4/0/0]ppp authentication-mode pap
[R2-Serial4/0/0]
2.R3
[R3]int s4/0/0
[R3-Serial4/0/0]ppp pap local-user huawei password cipher 123456
[R3-Serial4/0/0]q
5.对R2与R4之间的接口进行PPP认证
1.R2
[R2]aaa
[R2-aaa]local-user huawei password cipher 12345
[R2-aaa]local-user huawei service-type ppp
[R2-aaa]q
[R2]int s3/0/0
[R2-Serial3/0/0]ppp authentication-mode chap
[R2-Serial3/0/0]q
2.R4
[R4]int s4/0/0
[R4-Serial4/0/0]ppp chap password cipher 12345
[R4-Serial4/0/0]ppp chap user huawei
[R4-Serial4/0/0]q
6.R1、R2、R3构建MGRE环境
1.R1
[R1]int Tunnel 0/0/0
[R1-Tunnel0/0/0]ip address 10.1.1.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
2.R3
R3]int tu
[R3]int Tunnel 0/0/0
[R3-Tunnel0/0/0]ip address 10.1.1.2 24
[R3-Tunnel0/0/0]tunnel-protocol gre p2mp
[R3-Tunnel0/0/0]source s4/0/0
[R3-Tunnel0/0/0]nhrp entry 10.1.1.1 12.1.1.1 register
[R3-Tunnel0/0/0]nhrp network-id 100
[R3-Tunnel0/0/0]q
3.R4
[R4]int Tunnel 0/0/0
[R4-Tunnel0/0/0]ip ad
[R4-Tunnel0/0/0]ip address 10.1.1.3 24
[R4-Tunnel0/0/0]tunnel-protocol gre p2mp
[R4-Tunnel0/0/0]source s4/0/0
[R4-Tunnel0/0/0]nhrp entry 10.1.1.1 12.1.1.1 register
[R4-Tunnel0/0/0]nhrp network-id 100
[R4-Tunnel0/0/0]q
7.使用RIP协议来访问
1.R1
[R1]rip 1
[R1-rip-1]ver 2
[R1-rip-1]network 192.168.1.0
[R1-rip-1]network 10.0.0.0
[R1-rip-1]q
2.R3
[R3]rip 1
[R3-rip-1]ver 2
[R3-rip-1]network 192.168.2.0
[R3-rip-1]network 10.0.0.0
[R3-rip-1]q
3.R4
[R4]rip 1
[R4-rip-1]ver 2
[R4-rip-1]network 192.168.3.0
[R4-rip-1]network 10.0.0.0
[R4-rip-1]q
8.取消水平分割
[R1]int t0/0/0
[R1-Tunnel0/0/0]undo rip split-horizon