华为路由器:ppp协议

it2024-05-09  42

实验拓扑

R1

The device is running! <Huawei> <Huawei>sys Enter system view, return user view with Ctrl+Z. [Huawei] [Huawei]sys R1 [R1]int g0/0/0 [R1-GigabitEthernet0/0/0]ip address 192.168.1.254 24 [R1-GigabitEthernet0/0/0]int s2/0/0 [R1-Serial2/0/0]ip address 10.0.0.1 8 [R1-Serial2/0/0]q [R1]aaa #启用aaa配置管理 [R1-aaa]local-user pokes password cipher 123456 #在数据库中创建1个以pokes为用户名,密码为ppp的本地账户 [R1-aaa]local-user pokes service-type ppp [R1-aaa]q [R1]int s2/0/0 [R1-Serial2/0/0]ppp authentication-mode pap #在主认证端上指明ppp的认证方式pap [R1-Serial2/0/0]q [R1]ip route-static 0.0.0.0 0.0.0.0 10.0.0.2 [R1]

R2

The device is running! <Huawei>sys Enter system view, return user view with Ctrl+Z. [Huawei]sys R2 [R2]int g0/0/0 [R2-GigabitEthernet0/0/0]ip add 192.168.2.254 24 [R2-GigabitEthernet0/0/0] [R2-GigabitEthernet0/0/0]int s2/0/0 [R2-Serial2/0/0]ip add 10.0.0.2 8 [R2-Serial2/0/0] [R2-Serial2/0/0]ppp pap local-user pokes password cipher 123456 #使用pap认证方式,用户名为pokes,密码为123456(与主认证端一致) [R2-Serial2/0/0]q [R2]ip route-static 0.0.0.0 0.0.0.0 10.0.0.1 [R2]

查看ppp链路状态

[R2]display interface s2/0/0 Serial2/0/0 current state : UP Line protocol current state : UP Last line protocol up time : 2020-10-21 12:25:12 UTC-08:00 Description:HUAWEI, AR Series, Serial2/0/0 Interface Route Port,The Maximum Transmit Unit is 1500, Hold timer is 10(sec) Internet Address is 10.0.0.2/8 Link layer protocol is PPP LCP opened, IPCP opened #这里LCP子层和IPCP子层都open,ppp链路正常建立了 Last physical up time : 2020-10-21 12:13:33 UTC-08:00 Last physical down time : 2020-10-21 12:13:27 UTC-08:00 Current system time: 2020-10-21 12:46:19-08:00 Physical layer is synchronous, Virtualbaudrate is 64000 bps Interface is DTE, Cable type is V11, Clock mode is TC Last 300 seconds input rate 6 bytes/sec 48 bits/sec 0 packets/sec Last 300 seconds output rate 2 bytes/sec 16 bits/sec 0 packets/sec Input: 427 packets, 13992 bytes Broadcast: 0, Multicast: 0 Errors: 0, Runts: 0 Giants: 0, CRC: 0 Alignments: 0, Overruns: 0 Dribbles: 0, Aborts: 0 No Buffers: 0, Frame Error: 0 ---- More ----

查看端口

[R2]display ip interface brief *down: administratively down ^down: standby (l): loopback (s): spoofing The number of interface that is UP in Physical is 3 The number of interface that is DOWN in Physical is 2 The number of interface that is UP in Protocol is 3 The number of interface that is DOWN in Protocol is 2 Interface IP Address/Mask Physical Protocol GigabitEthernet0/0/0 192.168.2.254/24 up up GigabitEthernet0/0/1 unassigned down down NULL0 unassigned up up(s) Serial2/0/0 10.0.0.2/8 up up #被认证端的接口自动获取到了ip地址 Serial2/0/1 unassigned down down

验证结果

PC1 ping PC2

Welcome to use PC Simulator! PC>ping 192.168.2.1 Ping 192.168.2.1: 32 data bytes, Press Ctrl_C to break Request timeout! From 192.168.2.1: bytes=32 seq=2 ttl=126 time=15 ms From 192.168.2.1: bytes=32 seq=3 ttl=126 time=32 ms From 192.168.2.1: bytes=32 seq=4 ttl=126 time=15 ms From 192.168.2.1: bytes=32 seq=5 ttl=126 time=31 ms --- 192.168.2.1 ping statistics --- 5 packet(s) transmitted 4 packet(s) received 20.00% packet loss round-trip min/avg/max = 0/23/32 ms PC>
最新回复(0)