?IP地址配置,并配置缺省
[R1]int s 4/0/0
[R1-Serial4/0/0]ip add 15.0.0.1 24
[R1]int g 0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.1.1 24
[R1]ip route-static 0.0.0.0 0 15.0.0.2
[R2]int s 4/0/0
[R2-Serial4/0/0]ip add 25.0.0.1 24
[R2]int g 0/0/0
[R2-GigabitEthernet0/0/0]ip add 192.168.2.1 24
[R2]ip route-static 0.0.0.0 0 25.0.0.2
[R3]int s 4/0/0
[R3-Serial4/0/0]ip add 35.0.0.1 24
[R3]int g 0/0/0
[R3-GigabitEthernet0/0/0]ip add 192.168.3.1 24
[R3]ip route-static 0.0.0.0 0 35.0.0.2
[R4]int g 0/0/0
[R4-GigabitEthernet0/0/0]ip add 45.0.0.1 24
[R4]int g 0/0/1
[R4-GigabitEthernet0/0/1]ip add 192.168.4.1 24
[R4]ip route-static 0.0.0.0 0 45.0.0.2
[ISP]int s 3/0/0
[ISP-Serial3/0/0]ip add 15.0.0.2 24
[ISP]int s 3/0/1
[ISP-Serial3/0/1]ip add 25.0.0.2 24
[ISP]int s 4/0/0
[ISP-Serial4/0/0]ip add 35.0.0.2 24
[ISP]int g 0/0/0
[ISP-GigabitEthernet0/0/0]ip add 45.0.0.2 24
[ISP]int lo1
[ISP-LoopBack1]ip add 5.5.5.5 24
R1和R5之间使用PPP的PAP认证,R5为主认证方
因为华为串线链路默认为PPP,所以直接进行认证配置即可
在认证方配置认证并开启认证
[ISP]aaa
[ISP-aaa]local-user admin password cipher 111222
[ISP-aaa]local-user admin service-type ppp
[ISP]int s 3/0/0
[ISP-Serial3/0/0]ppp authentication-mode pap
被认证方与认证方连接
[R1]int s 4/0/0
[R1-Serial4/0/0]ppp pap local-user admin password cipher 111222
可以ping通,即认证成功
?R2和R5之间使用PPP的chap认证,R5为主认证方
在认证方开启认证
[ISP]int s 3/0/1
[ISP-Serial3/0/1]ppp authentication-mode chap
被认证方与认证方连接
[R2]int s 4/0/0
[R2-Serial4/0/0]ppp chap user admin
[R2-Serial4/0/0]ppp chap password cipher 111222
可以ping通,即认证成功
??R3和R5之间使用HDLC封装
两边接口都需要改成hdlc封装
[R3]int s 4/0/0
[R3-Serial4/0/0]link-protocol hdlc
[ISP]int s 4/0/0
[ISP-Serial4/0/0]link-protocol hdlc
R1/R2/R3构建一个MGRE环境,R1为中心站点
[R1]int t 0/0/0
[R1-Tunnel0/0/0]ip add 192.168.5.1 24
[R1-Tunnel0/0/0]tunnel-protocol gre p2mp
[R1-Tunnel0/0/0]sou
[R1-Tunnel0/0/0]source 15.0.0.1
[R1-Tunnel0/0/0]nhrp network-id 100
[R1-Tunnel0/0/0]nhrp entry multicast dynamic
[R2]int t 0/0/0
[R2-Tunnel0/0/0]ip add 192.168.5.2 24
[R2-Tunnel0/0/0]tunnel-protocol gre p2mp
[R2-Tunnel0/0/0]source Serial 4/0/0
[R2-Tunnel0/0/0]nhrp network-id 100
[R2-Tunnel0/0/0]nhrp entry 192.168.5.1 15.0.0.1 register
[R3]int t 0/0/0
[R3-Tunnel0/0/0]ip add 192.168.5.3 24
[R3-Tunnel0/0/0]tunnel-protocol gre p2mp
[R3-Tunnel0/0/0]source Serial 4/0/0
[R3-Tunnel0/0/0]nhrp network-id 100
[R3-Tunnel0/0/0]nhrp entry 192.168.5.1 15.0.0.1 register
R1,R4间为点到点的GRE
[R1]int t 0/0/1
[R1-Tunnel0/0/1]ip add 192.168.6.1 24
[R1-Tunnel0/0/1]tunnel-protocol gre
[R1-Tunnel0/0/1]source 15.0.0.1
[R1-Tunnel0/0/1]description 45.0.0.1
[R4]int t 0/0/0
[R4-Tunnel0/0/0]ip add 192.168.6.2 24
[R4-Tunnel0/0/0]tunnel-protocol gre
[R4-Tunnel0/0/0]source 45.0.0.1
[R4-Tunnel0/0/0]description 15.0.0.1
基于RIP全网可达
?
?所有PC设置IP为源IP
?私网访问公网
[R1]acl 2000
[R1-acl-basic-2000]rule permit source 192.168.1.0 0 0.0.0.255
[R1]int s 4/0/0
[R1-Serial4/0/0]nat outbound 2000
[R2]acl 2000
[R2-acl-basic-2000]rule permit source 192.168.2.0 0 0.0.0.255
[R2]int s 4/0/0
[R2-Serial4/0/0]nat outbound 2000
[R3]acl 2000
[R3-acl-basic-2000]rule permit source 192.168.3.0 0 0.0.0.255
[R3]int s 4/0/0
[R3-Serial4/0/0]nat outbound 2000
[R4]acl 2000
[R4-acl-basic-2000]rule permit source 192.168.1.0 0 0.0.0.255
[R4]int g 0/0/0
[R4-GigabitEthernet0/0/0]nat outbound 2000
?
?
?
?
?
?
|