💪
PPP の練習
本エントリについて
Dynagen、Dynamips を使って、PPP を練習します。
Dynagen、Dynamips の利用環境はすでに整っているものとします。
参考
直結
r1
conf t
hostname r1
int s1/0
ip addr 172.16.0.253 255.255.255.0
no shut
r2
conf t
hostname r2
int s1/1
ip addr 172.16.0.254 255.255.255.0
no shut
r1#show controllers s1/0
M4T: show controller:
PAS unit 0, subunit 0, f/w version 1-45, rev ID 0x2800001, version 1
idb = 0x66626A84, ds = 0x66627B2C, ssb=0x66627EE8
Clock mux=0x0, ucmd_ctrl=0x1C, port_status=0x7B
Serial config=0x8, line config=0x200
maxdgram=1608, bufpool=78Kb, 120 particles
DCD=up DSR=up DTR=up RTS=up CTS=up
line state: up
cable type : V.11 (X.21) DCE cable, received clockrate 2015232
base0 registers=0x3D000000, base1 registers=0x3D002000
mxt_ds=0x66BA4FE4, rx ring entries=78, tx ring entries=128
rxring=0xF7CA0E0, rxr shadow=0x6662E54C, rx_head=40
txring=0xF7CA3A0, txr shadow=0x6662E928, tx_head=45, tx_tail=45, tx_count=0
throttled=0, enabled=0
halted=0, last halt reason=0
Microcode fatal errors=0
rx_no_eop_err=0, rx_no_stp_err=0, rx_no_eop_stp_err=0
rx_no_buf=0, rx_soft_overrun_err=0, dump_err= 0, bogus=0, mxt_flags=0x0
tx_underrun_err=0, tx_soft_underrun_err=0, tx_limited=1(2)
tx_fullring=0, tx_started=51, mxt_flush_count=0
rx_int_count=40, tx_int_count=54
r2#show controllers s1/1
M4T: show controller:
PAS unit 1, subunit 1, f/w version 1-45, rev ID 0x2800001, version 1
idb = 0x666857E8, ds = 0x66686890, ssb=0x66686C4C
Clock mux=0x0, ucmd_ctrl=0x1C, port_status=0x7B
Serial config=0x8, line config=0x200
maxdgram=1608, bufpool=78Kb, 120 particles
DCD=up DSR=up DTR=up RTS=up CTS=up
line state: up
cable type : V.11 (X.21) DCE cable, received clockrate 2015232
base0 registers=0x3D000000, base1 registers=0x3D002000
mxt_ds=0x672F42E0, rx ring entries=78, tx ring entries=128
rxring=0xF7DC520, rxr shadow=0x6668D2B0, rx_head=45
txring=0xF7DC7E0, txr shadow=0x6668D68C, tx_head=45, tx_tail=45, tx_count=0
throttled=0, enabled=0
halted=0, last halt reason=0
Microcode fatal errors=0
rx_no_eop_err=0, rx_no_stp_err=0, rx_no_eop_stp_err=0
rx_no_buf=0, rx_soft_overrun_err=0, dump_err= 0, bogus=0, mxt_flags=0x0
tx_underrun_err=0, tx_soft_underrun_err=0, tx_limited=1(2)
tx_fullring=0, tx_started=45, mxt_flush_count=0
rx_int_count=45, tx_int_count=47
r2#show int s1/1
Serial1/1 is up, line protocol is up
Hardware is M4T
Internet address is 172.16.0.254/24
MTU 1500 bytes, BW 1544 Kbit/sec, DLY 20000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation HDLC, crc 16, loopback not set
Keepalive set (10 sec)
Restart-Delay is 0 secs
CRC checking enabled
Last input 00:00:07, output 00:00:04, output hang never
Last clearing of "show interface" counters never
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: weighted fair
Output queue: 0/1000/64/0 (size/max total/threshold/drops)
Conversations 0/1/256 (active/max active/max total)
Reserved Conversations 0/0 (allocated/max allocated)
Available Bandwidth 1158 kilobits/sec
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
57 packets input, 5616 bytes, 0 no buffer
Received 27 broadcasts, 0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
57 packets output, 5589 bytes, 0 underruns
0 output errors, 0 collisions, 1 interface resets
0 unknown protocol drops
0 output buffer failures, 0 output buffers swapped out
2 carrier transitions DCD=up DSR=up DTR=up RTS=up CTS=up
r1#show int s1/0
Serial1/0 is up, line protocol is up
Hardware is M4T
Internet address is 172.16.0.253/24
MTU 1500 bytes, BW 1544 Kbit/sec, DLY 20000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation HDLC, crc 16, loopback not set
Keepalive set (10 sec)
Restart-Delay is 0 secs
CRC checking enabled
Last input 00:00:02, output 00:00:05, output hang never
Last clearing of "show interface" counters never
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: weighted fair
Output queue: 0/1000/64/0 (size/max total/threshold/drops)
Conversations 0/1/256 (active/max active/max total)
Reserved Conversations 0/0 (allocated/max allocated)
Available Bandwidth 1158 kilobits/sec
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
71 packets input, 6541 bytes, 0 no buffer
Received 41 broadcasts, 0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
82 packets output, 7799 bytes, 0 underruns
0 output errors, 0 collisions, 2 interface resets
0 unknown protocol drops
0 output buffer failures, 0 output buffers swapped out
3 carrier transitions DCD=up DSR=up DTR=up RTS=up CTS=up
r1#show ip int bri
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 10.2.0.254 YES NVRAM up up
FastEthernet0/1 unassigned YES NVRAM administratively down down
Serial1/0 172.16.0.253 YES NVRAM up up
Serial1/1 172.16.1.254 YES NVRAM up down
Serial1/2 unassigned YES NVRAM administratively down down
Serial1/3 unassigned YES NVRAM administratively down down
r1#ping 172.16.0.253
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.0.253, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 32/37/44 ms
r1#ping 172.16.0.254
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.0.254, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/18/20 ms
r2#ping 172.16.0.253
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.0.253, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/20/28 ms
r2#ping 172.16.0.254
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.0.254, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 28/35/40 ms
r2#show ip int bri
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 10.2.1.254 YES NVRAM up up
FastEthernet0/1 unassigned YES NVRAM administratively down down
Serial1/0 172.16.2.253 YES NVRAM up down
Serial1/1 172.16.0.254 YES NVRAM up up
Serial1/2 unassigned YES NVRAM administratively down down
Serial1/3 unassigned YES NVRAM administratively down down
PPP
CHAP認証
r1(config)#username r2 password cisco
r1(config)#int s1/0
r1(config-if)#encapsulation ppp
r1(config-if)#ppp authentication chap
r2(config)#username r1 password cisco
r2(config)#int s1/1
r2(config-if)#encapsulation ppp
r2(config-if)#ppp authentication chap
r2#show int s1/1
Serial1/1 is up, line protocol is up
Hardware is M4T
Internet address is 172.16.0.254/24
MTU 1500 bytes, BW 1544 Kbit/sec, DLY 20000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation PPP, LCP Open
Open: IPCP, CDPCP, crc 16, loopback not set
Keepalive set (10 sec)
Restart-Delay is 0 secs
CRC checking enabled
Last input 00:00:52, output 00:00:02, output hang never
Last clearing of "show interface" counters 00:45:58
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: weighted fair
Output queue: 0/1000/64/0 (size/max total/threshold/drops)
Conversations 0/1/256 (active/max active/max total)
Reserved Conversations 0/0 (allocated/max allocated)
Available Bandwidth 1158 kilobits/sec
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
4624 packets input, 93325 bytes, 0 no buffer
Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
4650 packets output, 91524 bytes, 0 underruns
0 output errors, 0 collisions, 137 interface resets
0 unknown protocol drops
0 output buffer failures, 0 output buffers swapped out
137 carrier transitions DCD=up DSR=up DTR=up RTS=up CTS=up
r1#show int s1/0
Serial1/0 is up, line protocol is up
Hardware is M4T
Internet address is 172.16.0.253/24
MTU 1500 bytes, BW 1544 Kbit/sec, DLY 20000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation PPP, LCP Open
Open: IPCP, CDPCP, crc 16, loopback not set
Keepalive set (10 sec)
Restart-Delay is 0 secs
CRC checking enabled
Last input 00:00:11, output 00:00:02, output hang never
Last clearing of "show interface" counters 00:52:57
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: weighted fair
Output queue: 0/1000/64/0 (size/max total/threshold/drops)
Conversations 0/1/256 (active/max active/max total)
Reserved Conversations 0/0 (allocated/max allocated)
Available Bandwidth 1158 kilobits/sec
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
4716 packets input, 96670 bytes, 0 no buffer
Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
4793 packets output, 99842 bytes, 0 underruns
0 output errors, 0 collisions, 182 interface resets
9 unknown protocol drops
0 output buffer failures, 0 output buffers swapped out
182 carrier transitions DCD=up DSR=up DTR=up RTS=up CTS=up
r2#ping 172.16.0.253
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.0.253, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/17/24 ms
r2#ping 172.16.0.254
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.0.254, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 24/36/40 ms
debug ppp authentication の内容
*Mar 1 00:09:37.519: Se1/0 PPP: Authorization required
*Mar 1 00:09:37.527: Se1/0 CHAP: O CHALLENGE id 3 len 23 from "r1"
*Mar 1 00:09:37.531: Se1/0 CHAP: I CHALLENGE id 3 len 23 from "r2"
*Mar 1 00:09:37.535: Se1/0 CHAP: Using hostname from unknown source
*Mar 1 00:09:37.535: Se1/0 CHAP: Using password from AAA
*Mar 1 00:09:37.535: Se1/0 CHAP: O RESPONSE id 3 len 23 from "r1"
*Mar 1 00:09:37.551: Se1/0 CHAP: I RESPONSE id 3 len 23 from "r2"
*Mar 1 00:09:37.555: Se1/0 PPP: Sent CHAP LOGIN Request
*Mar 1 00:09:37.555: Se1/0 PPP: Received LOGIN Response PASS
*Mar 1 00:09:37.559: Se1/0 PPP: Sent LCP AUTHOR Request
*Mar 1 00:09:37.559: Se1/0 PPP: Sent IPCP AUTHOR Request
*Mar 1 00:09:37.559: Se1/0 LCP: Received AAA AUTHOR Response PASS
*Mar 1 00:09:37.559: Se1/0 IPCP: Received AAA AUTHOR Response PASS
*Mar 1 00:09:37.559: Se1/0 CHAP: O SUCCESS id 3 len 4
*Mar 1 00:09:37.563: Se1/0 CHAP: I SUCCESS id 3 len 4
*Mar 1 00:09:37.567: Se1/0 PPP: Sent CDPCP AUTHOR Request
*Mar 1 00:09:37.567: Se1/0 CDPCP: Received AAA AUTHOR Response PASS
PAP認証
r1(config)#int s1/0
r1(config-if)#no ppp authentication chap
r1(config-if)#ppp pap sent-username r1 password cisco
r1(config-if)#ppp authentication pap
r2(config)#int s1/1
r2(config-if)#no ppp authentication chap
r2(config-if)#shut
r1(config-if)#ppp pap sent-username r2 password cisco
r2(config-if)#ppp authentication pap
r2(config-if)#no shut
r2#show int s1/1
Serial1/1 is up, line protocol is up
Hardware is M4T
Internet address is 172.16.0.254/24
MTU 1500 bytes, BW 1544 Kbit/sec, DLY 20000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation PPP, LCP Open
Open: IPCP, CDPCP, crc 16, loopback not set
Keepalive set (10 sec)
Restart-Delay is 0 secs
CRC checking enabled
Last input 00:00:52, output 00:00:02, output hang never
Last clearing of "show interface" counters 00:45:58
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: weighted fair
Output queue: 0/1000/64/0 (size/max total/threshold/drops)
Conversations 0/1/256 (active/max active/max total)
Reserved Conversations 0/0 (allocated/max allocated)
Available Bandwidth 1158 kilobits/sec
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
4624 packets input, 93325 bytes, 0 no buffer
Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
4650 packets output, 91524 bytes, 0 underruns
0 output errors, 0 collisions, 137 interface resets
0 unknown protocol drops
0 output buffer failures, 0 output buffers swapped out
137 carrier transitions DCD=up DSR=up DTR=up RTS=up CTS=up
r1#show int s1/0
Serial1/0 is up, line protocol is up
Hardware is M4T
Internet address is 172.16.0.253/24
MTU 1500 bytes, BW 1544 Kbit/sec, DLY 20000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation PPP, LCP Open
Open: IPCP, CDPCP, crc 16, loopback not set
Keepalive set (10 sec)
Restart-Delay is 0 secs
CRC checking enabled
Last input 00:00:06, output 00:00:00, output hang never
Last clearing of "show interface" counters 00:47:43
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: weighted fair
Output queue: 0/1000/64/0 (size/max total/threshold/drops)
Conversations 0/1/256 (active/max active/max total)
Reserved Conversations 0/0 (allocated/max allocated)
Available Bandwidth 1158 kilobits/sec
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
4620 packets input, 91920 bytes, 0 no buffer
Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
4694 packets output, 94684 bytes, 0 underruns
0 output errors, 0 collisions, 181 interface resets
9 unknown protocol drops
0 output buffer failures, 0 output buffers swapped out
181 carrier transitions DCD=up DSR=up DTR=up RTS=up CTS=up
r2#ping 172.16.0.254
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.0.254, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 32/37/44 ms
r2#ping 172.16.0.253
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.0.253, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/17/24 ms
*Mar 1 00:20:20.151: Se1/0 PAP: Using hostname from interface PAP
*Mar 1 00:20:20.151: Se1/0 PAP: Using password from interface PAP
*Mar 1 00:20:20.155: Se1/0 PAP: O AUTH-REQ id 1 len 13 from "r1"
*Mar 1 00:20:20.155: Se1/0 PAP: I AUTH-REQ id 1 len 13 from "r2"
*Mar 1 00:20:20.159: Se1/0 PAP: Authenticating peer r2
*Mar 1 00:20:20.171: Se1/0 PPP: Sent PAP LOGIN Request
*Mar 1 00:20:20.183: Se1/0 PPP: Received LOGIN Response PASS
*Mar 1 00:20:20.191: Se1/0 PPP: Sent LCP AUTHOR Request
*Mar 1 00:20:20.195: Se1/0 PPP: Sent IPCP AUTHOR Request
*Mar 1 00:20:20.195: Se1/0 LCP: Received AAA AUTHOR Response PASS
*Mar 1 00:20:20.195: Se1/0 IPCP: Received AAA AUTHOR Response PASS
*Mar 1 00:20:20.199: Se1/0 PAP: O AUTH-ACK id 1 len 5
*Mar 1 00:20:20.203: Se1/0 PAP: I AUTH-ACK id 1 len 5
*Mar 1 00:20:20.207: Se1/0 PPP: Sent CDPCP AUTHOR Request
*Mar 1 00:20:20.207: Se1/0 CDPCP: Received AAA AUTHOR Response PASS
*Mar 1 00:20:20.211: Se1/0 PPP: Sent IPCP AUTHOR Request
まとめ
Dynagen、Dynamips を使って、PPP を練習しました。
https://www.linemo.jp/process/apn/android/ のようにして CHAPはいつまでも生き残りますね。
Discussion