Packet Tracer配置PAP&CHAP认证双向
拓扑图:
设备参数:
设备 |
接口 |
IP地址 |
子网掩码 |
默认网关 |
R1 |
S0/0/0 |
192.168.12.1 |
255.255.255.0 |
N/A |
R2 |
S0/0/0 |
192.168.12.1 |
255.255.255.0 |
N/A |
S0/0/1 |
192.168.23.2 |
255.255.255.0 |
N/A |
|
R3 |
S0/0/0 |
192.168.23.3 |
255.255.255.0 |
N/A |
实验步骤:
Router>enable
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R1
R1(config)#username R2 password cisco
R1(config)#INTerface Serial 0/0/0
R1(config-if)#ip address 192.168.12.1 255.255.255.0
R1(config-if)#encapsulation ppp
R1(config-if)#ppp pap sent-username R1 password cisco
R1(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to down
R1(config-if)#exit
Router>enable
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R2
R2(config)#username R1 password cisco
R2(config)#username R3 password cisco
R2(config)#interface s0/0/0
R2(config-if)#clock rate 128000
R2(config-if)#ip address 192.168.12.2 255.255.255.0
R2(config-if)#encapsulation ppp
R2(config-if)#ppp authentication pap
R2(config-if)#ppp pap sent-username R2 password cisco
R2(config-if)#no shutdown
R2(config-if)#
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to up
R2(config-if)#exit
R2(config)#interface s0/0/1
R2(config-if)#clock rate 128000
R2(config-if)#ip add
R2(config-if)#ip address 192.168.23.2 255.255.255.0
R2(config-if)#encapsulation ppp
R2(config-if)#ppp authentication chap
R2(config-if)#no shutdown
R2(config-if)#end
R2#
%SYS-5-CONFIG_I: Configured from console by console
Router>enable
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R3
R3(config)#username R2 password cisco
R3(config)#interface s0/0/0
R3(config-if)#ip address 192.168.23.3 255.255.255.0
R3(config-if)#encapsulation ppp
R3(config-if)#ppp authentication chap
R3(config-if)#no shutdown
实验验证:
R1#show ip interface brief
Interface IP-Address OK? Method Status Protocol
GigabitEthernet0/0 unassigned YES unset administratively down down
GigabitEthernet0/1 unassigned YES unset administratively down down
Serial0/0/0 192.168.12.1 YES manual up up
Serial0/0/1 unassigned YES unset administratively down down
Vlan1 unassigned YES unset administratively down down
R1#ping 192.168.12.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.12.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/4/12 ms
R1#
R2#show ip interface brief
Interface IP-Address OK? Method Status Protocol
GigabitEthernet0/0 unassigned YES unset administratively down down
GigabitEthernet0/1 unassigned YES unset administratively down down
Serial0/0/0 192.168.12.2 YES manual up up
Serial0/0/1 192.168.23.2 YES manual up up
Vlan1 unassigned YES unset administratively down down
R2#ping 192.168.12.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.12.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/6/16 ms
R2#ping 192.168.23.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.23.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/6/9 ms
R2#
R3#show ip interface brief
Interface IP-Address OK? Method Status Protocol
GigabitEthernet0/0 unassigned YES unset administratively down down
GigabitEthernet0/1 unassigned YES unset administratively down down
Serial0/0/0 192.168.23.3 YES manual up up
Serial0/0/1 unassigned YES unset administratively down down
Vlan1 unassigned YES unset administratively down down
R3#
R3#ping 192.168.23.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.23.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/5 ms
通过show ip interface brief可发现端口和协议都是up的,这样实验就算完成了。
不积跬步无以至千里,不积小流无以成江海;
千里之行,始于足下;
每天一个小实验。