一、搭建拓扑图
二、配置IP地址
R1:
192.168.1.0/24
15.1.1.0/24
R2:
192.168.2.0/24
25.1.1.0/24
R3:
192.168.3.0/24
35.1.1.0/24
R4:
192.168.4.0/24
45.1.1.0/24
三、使用PPP
1、R1和R5使用PAP认证
[r5]aaa
[r5-aaa]local-user huawei password cipher xinxin
Info: Add a new user.
[r5-aaa]local-user huawei service-type PPP
[r5-aaa]int s4/0/0
[r5-Serial4/0/0]link-protocol ppp
[r5-Serial4/0/0]ppp authentication-mode pap
[r1]int s4/0/0
[r1-Serial4/0/0]link-protocol ppp
[r1-Serial4/0/0]ppp pap local-user huawei
[r1-Serial4/0/0]ppp pap local-user huawei password cipher xinxin
2、R2和R5使用CHAP认证
[r5-aaa]int s4/0/1
[r5-Serial4/0/1]link-protocol ppp
[r5-Serial4/0/1]ppp authentication-mode chap
[r2]int s4/0/1
[r2-Serial4/0/1]link-protocol ppp
[r2-Serial4/0/1]ppp chap user piupiu
[r2-Serial4/0/1]ppp chap password cipher xinxin
四、使用HDLC封装
[r5]int s3/0/0
[r5-Serial3/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
[r3]int s4/0/0
[r3-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
五、配置缺省
[r1]ip route-static 0.0.0.0 0 15.1.1.1
[r2]ip route-static 0.0.0.0 0 25.1.1.2
[r3]ip route-static 0.0.0.0 0 35.1.1.2
[r4]ip route-static 0.0.0.0 0 45.1.1.2
六、做NAT
[r1]acl 2000
[r1-acl-basic-2000]rule 5 permit source 192.168.1.0 0.0.0.255
[r2]acl 2000
[r2-acl-basic-2000]rule 5 permit source 192.168.2.0 0.0.0.255
[r2-acl-basic-2000]int s4/0/1
[r2-Serial4/0/1]nat outbound 2000
[r3]acl 2000
[r3-acl-basic-2000]rule 5 permit source 192.168.3.0 0.0.0.255
[r3-acl-basic-2000]q
[r3]int s4/0/0
[r3-Serial4/0/0]nat outbound 2000
[r4]acl 2000
[r4-acl-basic-2000]rule 5 permit source 192.168.4.0 0.0.0.255
[r4-acl-basic-2000]q
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]nat outbound