如图配置IP地址
启用 CHAP 认证,用户名/密码为:HuaWei/123456
确保RAR20-A和RAR20-B之间可以互通
按照如下步骤进行。
1)配置IP地址,确保设备互通
<Huawei>system-view
[Huawei]sysname RAR20-A
[RAR20-A]interface Serial 4/0/0
[RAR20-A-Serial4/0/0]ip add 192.168.12.1 24
[RAR20-A-Serial4/0/0]quit
<Huawei>system-view
[Huawei]sysname RAR20-B
[RAR20-B-]interface Serial 4/0/0
[RAR20-B-Serial4/0/0]ip address 192.168.12.2 24
[RAR20-B-Serial4/0/0]quit
2)配置CHAP 认证
[RAR20-A]aaa
[RAR20-A-aaa]local-user HuaWei password cipher 123456 //创建用户名和密码
[RAR20-A-aaa]local-user HuaWei service-type ppp // 指定用户的服务类型为PPP
[RAR20-A-aaa]quit
[RAR20-A]interface Serial 4/0/0
[RAR20-A-Serial4/0/0]ppp authentication-mode chap //开启CHAP 认证
[RAR20-A-Serial4/0/0]ppp chap user HuaWei //指定用于CHAP认证的用户名
[RAR20-A-Serial4/0/0]quit
[RAR20-B-interface Serial 4/0/0
[RAR20-B--Serial4/0/0]ppp chap user HuaWei //被认证端使用的用户名
[RAR20-Serial4/0/0]ppp chap password cipher 123456 //被认证端使用的密码
[RAR20-Serial4/0/0]quit
[RAR20]interface Serial 4/0/0
[RAR20-B-Serial4/0/0]shutdown //关闭接口
[R2-Serial4/0/0]undo shutdown //打开接口
3)测试RAR20-A与RAR20-B-之间的连通
[RAR20-A]ping 13.1.1.2
PING 13.1.1.2: 56 data bytes, press CTRL_C to break
Reply from 13.1.1.2: bytes=56 Sequence=1 ttl=255 time=110 ms
Reply from 13.1.1.2: bytes=56 Sequence=2 ttl=255 time=20 ms
Reply from 13.1.1.2: bytes=56 Sequence=3 ttl=255 time=30 ms
Reply from 13.1.1.2: bytes=56 Sequence=4 ttl=255 time=20 ms
Reply from 13.1.1.2: bytes=56 Sequence=5 ttl=255 time=30 ms
--- 13.1.1.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/42/110 ms