Отладка PPPoE в Cisco
Успех процесса поиска неисправности практически всегда основывается на знании процесса установки соединения и умении использовать инструменты отладки. Далее рассмотрим процесс установки соединения с использованием команды debug с различными опциями. Первым этапом в установке соединения идет установка pppoe сессии. Ниже приведен процесс установки сессии с вырезками из вывода debug-команд:
debug pppoe events
Nov 2 07:38:12.495: PPPoE 0: I PADI R:0800.27da.d2e0 L:ffff.ffff.ffff Fa0/0
*Nov 2 07:38:12.495: Service tag: NULL Tag
*Nov 2 07:38:12.495: PPPoE 0: O PADO, R:0019.56d6.d5f4 L:0800.27da.d2e0 Fa0/0
*Nov 2 07:38:12.495: Service tag: NULL Tag
*Nov 2 07:38:12.495: PPPoE 0: I PADR R:0800.27da.d2e0 L:0019.56d6.d5f4 Fa0/0
*Nov 2 07:38:12.495: Service tag: NULL Tag
*Nov 2 07:38:12.495: PPPoE : encap string prepared
*Nov 2 07:38:12.495: [5]PPPoE 5: Access IE handle allocated
*Nov 2 07:38:12.495: [5]PPPoE 5: pppoe SSS switch updated
*Nov 2 07:38:12.495: [5]PPPoE 5: AAA get retrieved attrs
*Nov 2 07:38:12.495: [5]PPPoE 5: AAA get nas port details
*Nov 2 07:38:12.495: [5]PPPoE 5: AAA get dynamic attrs
*Nov 2 07:38:12.495: [5]PPPoE 5: AAA get dynamic attrs
*Nov 2 07:38:12.495: [5]PPPoE 5: AAA unique ID allocated
*Nov 2 07:38:12.499: [5]PPPoE 5: No AAA accounting method list
*Nov 2 07:38:12.499: [5]PPPoE 5: Service request sent to SSS
*Nov 2 07:38:12.499: [5]PPPoE 5: Created, Service: None R:0019.56d6.d5f4 L:0800.27da.d2e00
*Nov 2 07:38:12.499: [5]PPPoE 5: State NAS_PORT_POLICY_INQUIRY Event SSS_LOCAL
*Nov 2 07:38:12.499: [5]PPPoE 5: O PADS R:0800.27da.d2e0 L:0019.56d6.d5f4 Fa0/0
*Nov 2 07:38:12.499: [5]PPPoE 5: State PPP_START Event DYN_BIND
*Nov 2 07:38:12.499: [5]PPPoE 5: data path set to PPP
*Nov 2 07:38:12.571: [5]PPPoE 5: State LCP_NEGOTIATION Event PPP_LOCAL
*Nov 2 07:38:12.571: PPPoE 5/SB: Sent vtemplate request on base Vi1
*Nov 2 07:38:12.575: [5]PPPoE 5: State VACCESS_REQUESTED Event VA_RESP
*Nov 2 07:38:12.575: [5]PPPoE 5: Vi1.1 interface obtained
*Nov 2 07:38:12.575: [5]PPPoE 5: State PTA_BINDING Event STAT_BIND
*Nov 2 07:38:12.575: [5]PPPoE 5: data path set to Virtual Acess
*Nov 2 07:38:12.575: [5]PPPoE 5: Connected PTA
*Nov 2 07:38:12.579: [5]PPPoE 5: AAA get dynamic attrs
*Nov 2 07:38:12.579: [5]PPPoE 5: AAA get dynamic attrs
debug pppoe packets:
*Nov 2 07:39:46.999: PPPoE 0: I PADI R:0800.27da.d2e0 L:ffff.ffff.ffff Fa0/0
FF FF FF FF FF FF 08 00 27 DA D2 E0 88 63 11 09
00 00 00 10 01 01 00 00 01 03 00 08 02 00 00 00 …
*Nov 2 07:39:46.999: PPPoE 0: O PADO, R:0019.56d6.d5f4 L:0800.27da.d2e0 Fa0/0
*Nov 2 07:39:46.999: Service tag: NULL Tag
08 00 27 DA D2 E0 00 19 56 D6 D5 F4 88 63 11 07
00 00 00 31 01 01 00 00 01 03 00 08 02 00 00 00 …
*Nov 2 07:39:47.003: PPPoE 0: I PADR R:0800.27da.d2e0 L:0019.56d6.d5f4 Fa0/0
00 19 56 D6 D5 F4 08 00 27 DA D2 E0 88 63 11 19
00 00 00 24 01 01 00 00 01 03 00 08 02 00 00 00 …
*Nov 2 07:39:47.003: [6]PPPoE 6: O PADS R:0800.27da.d2e0 L:0019.56d6.d5f4 Fa0/0
08 00 27 DA D2 E0 00 19 56 D6 D5 F4 88 63 11 65
00 06 00 24 01 01 00 00 01 03 00 08 02 00 00 00 …
Теперь подробнее о debug pppoe events:
*Nov 2 07:39:46.999: PPPoE 0: I PADI R:0800.27da.d2e0 L:ffff.ffff.ffff Fa0/0
Говорит на что-то откуда-то приходит на интерфейс FastEthernet0/0. Теперь разберемся что, куда и зачем.
debug pppoe pack
Первым шагом PPPoE клиент рассылает PADI(PPPoE Active Discovery Initiation) пакеты целью обнаружения PPPoE серверов (очень схоже с работой DHCP). Пакет посылается клиентом на широковещательный адрес: FF FF FF FF FF FF. Так же здесь же можно видеть mac адрес клиента, который подключается — 0800.27da.d2e0. После того как PPPoE сервер получает запрос PADI, который он может обслуживать, сервер посылает PADO (PPPoE Active Discovery Offer) пакет, так сказать, предлагая свои услуги. В результате чего сервере доступа видно следующее:
debug pppoe packets:
*Nov 2 07:39:46.999: PPPoE 0: O PADO, R:0019.56d6.d5f4 L:0800.27da.d2e0 Fa0/0
*Nov 2 07:39:46.999: Service tag: NULL Tag
08 00 27 DA D2 E0 00 19 56 D6 D5 F4 88 63 11 07
00 00 00 31 01 01 00 00 01 03 00 08 02 00 00 00 …
О PADO – говорит о том что пакет PADO был исходящий (О=Output). R:0019.56d6.d5f4 L:0800.27da.d2e0 – указывает mac удаленного сервера(R=remote) и локального интерфейса, через который был получен пакет. При получении PADO пакета, клиент выбирает сервер с которым будет работать (так как PADI был отправлен широковещательно, то может придти несколько PADO), и отправляет PADR (PPPoE Active Discovery Request). Данный пакет уже отправляется на unicast адрес, взятый из PADO:
*Nov 2 07:39:47.003: PPPoE 0: I PADR R:0800.27da.d2e0 L:0019.56d6.d5f4 Fa0/0
00 19 56 D6 D5 F4 08 00 27 DA D2 E0 88 63 11 19
00 00 00 24 01 01 00 00 01 03 00 08 02 00 00 00 …
Когда сервер PPPoE получает PADR, он генерирует уникальный ключ PPPoE сессии и отвечает клиенту путем передачи PADS (PPPoE Active Discovery Session-confirmation):
*Nov 2 07:39:47.003: [6]PPPoE 6: O PADS R:0800.27da.d2e0 L:0019.56d6.d5f4 Fa0/0
08 00 27 DA D2 E0 00 19 56 D6 D5 F4 88 63 11 65
00 06 00 24 01 01 00 00 01 03 00 08 02 00 00 00 …
Из вышеприведенной строки, видно, что сессии был присвоен номер 6, этот номер и будет далее вставляться во все пакеты до тех пор, пока PPPoE сессия не будет терминирована. Этот же ID будет показан в выводе команды show pppoe session:
pppoe-nas#sh pppoe session
1 session in LOCALLY_TERMINATED (PTA) State
1 session total
Uniq ID PPPoE RemMAC Port Source VA State
SID LocMAC VA-st
6 6 0800.27da.d2e0 Fa0/0 Vt1 Vi1.1 PTA
0019.56d6.d5f4 UP
В колонке VA-St можно увидеть значение UP – это означает, что PPPoE сессия установлена. После того как, будет поднята PPPoE сессия, начнется процесс установки PPP соединения, который будет проходить в стандартном режиме.
Отладка
Перед началом настройки PPPoE рекомендуется проверить версию IOS, проверить физическое соединение модема с сетью.
Шаг 1: Если после того, как маршрутизатор был полностью сконфигурирован, и соединение не поднялось, в первую очередь необходимо проверить физическое соединение маршрутизатора и физическое соединение с модемом, работает ли модем, индикацию на СРЕ устройстве со стороны клиента. Только после проверки наличия физической связи следует приступать к проверке правильности настроек маршрутизатора.
Шаг 2: Проверили физическое соединение, проверили настройки, теперь можно приступать к проверке 2-го уровня. Здесь уже понадобится умение разбираться в выводе debug и show команд. Первое с чего следует начать – это проверка, есть ли связь между сервером PPPoE и клиентским устройством. При работе с сервером доступа рекомендуется использовать команду debug pppoe events, так как она имеет более дружественный вывод.
Предположим первую ситуацию, когда debug выдает повторяющиеся через некоторое время строки типа:
debug pppoe events
*Nov 2 07:38:12.495: PPPoE 0: I PADI R:0800.27da.d2e0 L:ffff.ffff.ffff Fa0/0
*Nov 2 07:38:12.495: Service tag: NULL Tag
или
debug pppoe packets
pppoe-nas#
*Nov 2 07:39:46.999: PPPoE 0: I PADI R:0800.27da.d2e0 L:ffff.ffff.ffff Fa0/0
FF FF FF FF FF FF 08 00 27 DA D2 E0 88 63 11 09
00 00 00 10 01 01 00 00 01 03 00 08 02 00 00 00 …
Это означает, что PADI пакеты не доходят до PPPoE сервера. В данном случае рекомендуется ещё раз проверить соединение на физическом уровне, и если не выявлено никаких проблем, то проверить настройки vlan.
Шаг 3: Наиболее часто встречаемые проблемы при установке PPP соединения лежат в несоответствии типа аутентификации или неправильно заданных имени пользователя или пароля.
Первым примером рассмотрим ситуацию, когда произошла ошибка в выборе метода аутентификации CHAP или PAP (согласование метода происходит в 1 фазе установки соединения). Предположим, что с клиентской стороны настроен на метод PAP. При данной ошибке, в отличие от ошибки в пароле или пользователе, можно на основании вывода debug команд произвести нужные изменения в настройках клиентского устройства. Рассмотрим вывод команды debug ppp negotiation:
pppoe-nas#
*Nov 2 08:01:04.643: ppp15 PPP: Send Message[Dynamic Bind Response]
*Nov 2 08:01:04.643: ppp15 PPP: Using vpn set call direction
*Nov 2 08:01:04.643: ppp15 PPP: Treating connection as a callin
*Nov 2 08:01:04.643: ppp15 PPP: Session handle[57000011] Session id[15]
*Nov 2 08:01:04.643: ppp15 PPP: Phase is ESTABLISHING, Passive Open
*Nov 2 08:01:04.643: ppp15 LCP: State is Listen
*Nov 2 08:01:04.659: ppp15 LCP: I CONFREQ [Listen] id 0 len 17
*Nov 2 08:01:04.659: ppp15 LCP: MRU 1480 (0x010405C8)
*Nov 2 08:01:04.659: ppp15 LCP: MagicNumber 0x010A4CCA (0x0506010A4CCA)
*Nov 2 08:01:04.659: ppp15 LCP: Callback 6 (0x0D0306)
*Nov 2 08:01:04.659: ppp15 LCP: O CONFREQ [Listen] id 1 len 19
*Nov 2 08:01:04.659: ppp15 LCP: MRU 1492 (0x010405D4)
*Nov 2 08:01:04.659: ppp15 LCP: AuthProto CHAP (0x0305C22305)
*Nov 2 08:01:04.659: ppp15 LCP: MagicNumber 0x1D33F9D9 (0x05061D33F9D9)
*Nov 2 08:01:04.659: ppp15 LCP: O CONFREJ [Listen] id 0 len 7
*Nov 2 08:01:04.659: ppp15 LCP: Callback 6 (0x0D0306)
*Nov 2 08:01:04.659: ppp15 LCP: I CONFNAK [REQsent] id 1 len 8
*Nov 2 08:01:04.659: ppp15 LCP: AuthProto PAP (0x0304C023)
*Nov 2 08:01:04.659: ppp15 LCP: O CONFREQ [REQsent] id 2 len 19
*Nov 2 08:01:04.659: ppp15 LCP: MRU 1492 (0x010405D4)
*Nov 2 08:01:04.659: ppp15 LCP: AuthProto MS-CHAP (0x0305C22380)
*Nov 2 08:01:04.659: ppp15 LCP: MagicNumber 0x1D33F9D9 (0x05061D33F9D9)
*Nov 2 08:01:04.663: ppp15 LCP: I CONFREQ [REQsent] id 1 len 14
*Nov 2 08:01:04.663: ppp15 LCP: MRU 1480 (0x010405C8)
*Nov 2 08:01:04.663: ppp15 LCP: MagicNumber 0x010A4CCA (0x0506010A4CCA)
*Nov 2 08:01:04.663: ppp15 LCP: O CONFNAK [REQsent] id 1 len 8
*Nov 2 08:01:04.663: ppp15 LCP: MRU 1492 (0x010405D4)
*Nov 2 08:01:04.671: ppp15 LCP: I CONFNAK [REQsent] id 2 len 8
*Nov 2 08:01:04.671: ppp15 LCP: AuthProto PAP (0x0304C023)
*Nov 2 08:01:04.671: ppp15 LCP: O CONFREQ [REQsent] id 3 len 19
*Nov 2 08:01:04.671: ppp15 LCP: MRU 1492 (0x010405D4)
*Nov 2 08:01:04.671: ppp15 LCP: AuthProto CHAP (0x0305C22305)
*Nov 2 08:01:04.671: ppp15 LCP: MagicNumber 0x1D33F9D9 (0x05061D33F9D9)
*Nov 2 08:01:04.671: ppp15 LCP: I CONFREQ [REQsent] id 2 len 14
*Nov 2 08:01:04.671: ppp15 LCP: MRU 1480 (0x010405C8)
*Nov 2 08:01:04.671: ppp15 LCP: MagicNumber 0x010A4CCA (0x0506010A4CCA)
*Nov 2 08:01:04.671: ppp15 LCP: O CONFNAK [REQsent] id 2 len 8
*Nov 2 08:01:04.671: ppp15 LCP: MRU 1492 (0x010405D4)
*Nov 2 08:01:04.679: ppp15 LCP: I CONFNAK [REQsent] id 3 len 8
*Nov 2 08:01:04.679: ppp15 LCP: AuthProto PAP (0x0304C023)
*Nov 2 08:01:04.679: ppp15 LCP: O CONFREQ [REQsent] id 4 len 19
*Nov 2 08:01:04.679: ppp15 LCP: MRU 1492 (0x010405D4)
*Nov 2 08:01:04.679: ppp15 LCP: AuthProto MS-CHAP (0x0305C22380)
*Nov 2 08:01:04.679: ppp15 LCP: MagicNumber 0x1D33F9D9 (0x05061D33F9D9)
*Nov 2 08:01:04.711: ppp15 LCP: I CONFREQ [REQsent] id 3 len 14
*Nov 2 08:01:04.711: ppp15 LCP: MRU 1492 (0x010405D4)
*Nov 2 08:01:04.711: ppp15 LCP: MagicNumber 0x010A4CCA (0x0506010A4CCA)
*Nov 2 08:01:04.711: ppp15 LCP: O CONFACK [REQsent] id 3 len 14
*Nov 2 08:01:04.711: ppp15 LCP: MRU 1492 (0x010405D4)
*Nov 2 08:01:04.711: ppp15 LCP: MagicNumber 0x010A4CCA (0x0506010A4CCA)
*Nov 2 08:01:04.723: ppp15 LCP: I CONFNAK [ACKsent] id 4 len 8
*Nov 2 08:01:04.723: ppp15 LCP: AuthProto PAP (0x0304C023)
*Nov 2 08:01:04.723: ppp15 LCP: O CONFREQ [ACKsent] id 5 len 19
*Nov 2 08:01:04.723: ppp15 LCP: MRU 1492 (0x010405D4)
*Nov 2 08:01:04.723: ppp15 LCP: AuthProto CHAP (0x0305C22305)
*Nov 2 08:01:04.723: ppp15 LCP: MagicNumber 0x1D33F9D9 (0x05061D33F9D9)
*Nov 2 08:01:04.731: ppp15 LCP: I CONFNAK [ACKsent] id 5 len 8
*Nov 2 08:01:04.731: ppp15 LCP: AuthProto PAP (0x0304C023)
*Nov 2 08:01:04.731: ppp15 LCP: O CONFREQ [ACKsent] id 6 len 19
*Nov 2 08:01:04.731: ppp15 LCP: MRU 1492 (0x010405D4)
*Nov 2 08:01:04.731: ppp15 LCP: AuthProto MS-CHAP (0x0305C22380)
*Nov 2 08:01:04.731: ppp15 LCP: MagicNumber 0x1D33F9D9 (0x05061D33F9D9)
*Nov 2 08:01:04.739: ppp15 LCP: I CONFNAK [ACKsent] id 6 len 8
*Nov 2 08:01:04.739: ppp15 LCP: AuthProto PAP (0x0304C023)
*Nov 2 08:01:04.739: ppp15 LCP: O CONFREQ [ACKsent] id 7 len 19
*Nov 2 08:01:04.739: ppp15 LCP: MRU 1492 (0x010405D4)
*Nov 2 08:01:04.739: ppp15 LCP: AuthProto CHAP (0x0305C22305)
*Nov 2 08:01:04.739: ppp15 LCP: MagicNumber 0x1D33F9D9 (0x05061D33F9D9)
*Nov 2 08:01:04.751: ppp15 LCP: I CONFNAK [ACKsent] id 7 len 8
*Nov 2 08:01:04.751: ppp15 LCP: AuthProto PAP (0x0304C023)
*Nov 2 08:01:04.751: ppp15 LCP: O CONFREQ [ACKsent] id 8 len 19
*Nov 2 08:01:04.751: ppp15 LCP: MRU 1492 (0x010405D4)
*Nov 2 08:01:04.751: ppp15 LCP: AuthProto MS-CHAP (0x0305C22380)
*Nov 2 08:01:04.751: ppp15 LCP: MagicNumber 0x1D33F9D9 (0x05061D33F9D9)
*Nov 2 08:01:04.759: ppp15 LCP: I CONFNAK [ACKsent] id 8 len 8
*Nov 2 08:01:04.759: ppp15 LCP: AuthProto PAP (0x0304C023)
*Nov 2 08:01:04.759: ppp15 LCP: O CONFREQ [ACKsent] id 9 len 19
*Nov 2 08:01:04.759: ppp15 LCP: MRU 1492 (0x010405D4)
*Nov 2 08:01:04.759: ppp15 LCP: AuthProto CHAP (0x0305C22305)
*Nov 2 08:01:04.759: ppp15 LCP: MagicNumber 0x1D33F9D9 (0x05061D33F9D9)
*Nov 2 08:01:04.771: ppp15 LCP: I CONFNAK [ACKsent] id 9 len 8
*Nov 2 08:01:04.771: ppp15 LCP: AuthProto PAP (0x0304C023)
*Nov 2 08:01:04.771: ppp15 LCP: O CONFREQ [ACKsent] id 10 len 19
*Nov 2 08:01:04.771: ppp15 LCP: MRU 1492 (0x010405D4)
*Nov 2 08:01:04.771: ppp15 LCP: AuthProto MS-CHAP (0x0305C22380)
*Nov 2 08:01:04.771: ppp15 LCP: MagicNumber 0x1D33F9D9 (0x05061D33F9D9)
*Nov 2 08:01:04.779: ppp15 LCP: I CONFNAK [ACKsent] id 10 len 8
*Nov 2 08:01:04.779: ppp15 LCP: AuthProto PAP (0x0304C023)
*Nov 2 08:01:04.779: ppp15 LCP: Failed to negotiate with peer
*Nov 2 08:01:04.779: ppp15 PPP: Sending Acct Event[Down] id[15]
*Nov 2 08:01:04.779: ppp15 LCP: O TERMREQ [ACKsent] id 11 len 4
*Nov 2 08:01:04.779: ppp15 PPP: Phase is TERMINATING
*Nov 2 08:01:04.791: ppp15 LCP: I TERMACK [TERMsent] id 11 len 4
*Nov 2 08:01:04.791: ppp15 LCP: State is Closed
*Nov 2 08:01:04.791: ppp15 PPP: Phase is DOWN
*Nov 2 08:01:04.791: ppp15 PPP: Send Message[Disconnect]
*Nov 2 08:01:04.771: ppp15 LCP: AuthProto PAP (0x0304C023) – означает что поступил запрос содержащий в себе параметры соединения, которые предлагает предлагает клиент. В этих параметрах значится, что метод аутентификации предлагается – PAP.
Теперь рассмотрим пример, когда PPP соединение не устанавливается из-за несоответствия типа имени пользователя или пароля. Дело в том, что вывод debug команд при неправильно заданном имени пользователя или пароля одинаковы, поэтому не имеет смысла рассматривать эти случаи по отдельности.
debug ppp negotiation
pppoe-nas#
*Nov 2 07:58:59.987: ppp12 PPP: Send Message[Dynamic Bind Response]
*Nov 2 07:58:59.987: ppp12 PPP: Using vpn set call direction
*Nov 2 07:58:59.987: ppp12 PPP: Treating connection as a callin
*Nov 2 07:58:59.987: ppp12 PPP: Session handle[F400000E] Session id[12]
*Nov 2 07:58:59.987: ppp12 PPP: Phase is ESTABLISHING, Passive Open
*Nov 2 07:58:59.987: ppp12 LCP: State is Listen
*Nov 2 07:58:59.999: ppp12 LCP: I CONFREQ [Listen] id 0 len 17
*Nov 2 07:58:59.999: ppp12 LCP: MRU 1480 (0x010405C8)
*Nov 2 07:58:59.999: ppp12 LCP: MagicNumber 0x4AFF688E (0x05064AFF688E)
*Nov 2 07:58:59.999: ppp12 LCP: Callback 6 (0x0D0306)
*Nov 2 07:58:59.999: ppp12 LCP: O CONFREQ [Listen] id 1 len 19
*Nov 2 07:58:59.999: ppp12 LCP: MRU 1492 (0x010405D4)
*Nov 2 07:58:59.999: ppp12 LCP: AuthProto CHAP (0x0305C22305)
*Nov 2 07:58:59.999: ppp12 LCP: MagicNumber 0x1D3212E1 (0x05061D3212E1)
*Nov 2 07:58:59.999: ppp12 LCP: O CONFREJ [Listen] id 0 len 7
*Nov 2 07:58:59.999: ppp12 LCP: Callback 6 (0x0D0306)
*Nov 2 07:59:00.003: ppp12 LCP: I CONFACK [REQsent] id 1 len 19
*Nov 2 07:59:00.003: ppp12 LCP: MRU 1492 (0x010405D4)
*Nov 2 07:59:00.003: ppp12 LCP: AuthProto CHAP (0x0305C22305)
*Nov 2 07:59:00.007: ppp12 LCP: MagicNumber 0x1D3212E1 (0x05061D3212E1)
*Nov 2 07:59:00.007: ppp12 LCP: I CONFREQ [ACKrcvd] id 1 len 14
*Nov 2 07:59:00.007: ppp12 LCP: MRU 1480 (0x010405C8)
*Nov 2 07:59:00.007: ppp12 LCP: MagicNumber 0x4AFF688E (0x05064AFF688E)
*Nov 2 07:59:00.007: ppp12 LCP: O CONFNAK [ACKrcvd] id 1 len 8
*Nov 2 07:59:00.007: ppp12 LCP: MRU 1492 (0x010405D4)
*Nov 2 07:59:00.015: ppp12 LCP: I CONFREQ [ACKrcvd] id 2 len 14
*Nov 2 07:59:00.015: ppp12 LCP: MRU 1480 (0x010405C8)
*Nov 2 07:59:00.015: ppp12 LCP: MagicNumber 0x4AFF688E (0x05064AFF688E)
*Nov 2 07:59:00.015: ppp12 LCP: O CONFNAK [ACKrcvd] id 2 len 8
*Nov 2 07:59:00.015: ppp12 LCP: MRU 1492 (0x010405D4)
*Nov 2 07:59:00.023: ppp12 LCP: I CONFREQ [ACKrcvd] id 3 len 14
*Nov 2 07:59:00.023: ppp12 LCP: MRU 1492 (0x010405D4)
*Nov 2 07:59:00.023: ppp12 LCP: MagicNumber 0x4AFF688E (0x05064AFF688E)
*Nov 2 07:59:00.023: ppp12 LCP: O CONFACK [ACKrcvd] id 3 len 14
*Nov 2 07:59:00.027: ppp12 LCP: MRU 1492 (0x010405D4)
*Nov 2 07:59:00.027: ppp12 LCP: MagicNumber 0x4AFF688E (0x05064AFF688E)
*Nov 2 07:59:00.027: ppp12 LCP: State is Open
*Nov 2 07:59:00.027: ppp12 PPP: Phase is AUTHENTICATING, by this end
*Nov 2 07:59:00.027: ppp12 CHAP: O CHALLENGE id 1 len 30 from «pppoe-nas»
*Nov 2 07:59:00.035: ppp12 LCP: I IDENTIFY [Open] id 4 len 18 magic 0x4AFF688E MSRASV5.10
*Nov 2 07:59:00.035: ppp12 LCP: I IDENTIFY [Open] id 5 len 31 magic 0x4AFF688E MSRAS-0-2-4
*Nov 2 07:59:00.035: ppp12 CHAP: I RESPONSE id 1 len 30 from «pppoeuser»
*Nov 2 07:59:00.035: ppp12 PPP: Phase is FORWARDING, Attempting Forward
*Nov 2 07:59:00.035: ppp12 PPP: Phase is AUTHENTICATING, Unauthenticated User
*Nov 2 07:59:00.039: ppp12 CHAP: O FAILURE id 1 len 25 msg is «Authentication failed»
*Nov 2 07:59:00.039: ppp12 PPP: Sending Acct Event[Down] id[12]
*Nov 2 07:59:00.039: ppp12 PPP: Phase is TERMINATING
*Nov 2 07:59:00.039: ppp12 LCP: O TERMREQ [Open] id 2 len 4
*Nov 2 07:59:00.139: ppp12 LCP: I TERMACK [TERMsent] id 2 len 4
*Nov 2 07:59:00.139: ppp12 LCP: State is Closed
*Nov 2 07:59:00.139: ppp12 PPP: Phase is DOWN
*Nov 2 07:59:00.139: ppp12 PPP: Send Message[Disconnect]
Видим, что только что закончилась 1 фазы установки PPP соединения(LCP). Начиная со второй строки мы можем отследить процесс аутентификации.
*Nov 2 07:59:00.027: ppp12 CHAP: O CHALLENGE id 1 len 30 from «pppoe-nas» – данное сообщение означает, что сервер доступа получил входящий запрос содержащий в себе запрос, который клиент должен захешировать совместно с соответствующем паролем алгоритмом MD5 и отправить в ответ на challenge запрос, что мы и видим в следующих 3-ех строках:
*Nov 2 07:59:00.035: ppp12 LCP: I IDENTIFY [Open] id 4 len 18 magic 0x4AFF688E MSRASV5.10
*Nov 2 07:59:00.035: ppp12 LCP: I IDENTIFY [Open] id 5 len 31 magic 0x4AFF688E MSRAS-0-2-4
*Nov 2 07:59:00.035: ppp12 CHAP: I RESPONSE id 1 len 30 from «pppoeuser»
Следует заметить, что в сообщении об отправке ответа в кавычках стоит имя пользователя, которое указанно в настройках chap.
*Nov 2 07:59:00.039: ppp12 CHAP: O FAILURE id 1 len 25 msg is «Authentication failed» – это сообщение уже говорит, что сервер доступа признал ответ неправильным и начинает процедуру разрыва соединения.
В случае же когда аутентификация прошла успешно, в debug ppp negotiation появится следующее сообщение:
*Nov 2 08:08:04.383: ppp22 PPP: Phase is FORWARDING, Attempting Forward
*Nov 2 08:08:04.383: ppp22 PPP: Phase is AUTHENTICATING, Unauthenticated User
*Nov 2 08:08:04.387: ppp22 PPP: Phase is FORWARDING, Attempting Forward
*Nov 2 08:08:04.387: ppp22 PPP: Send Message[Connect Local]
*Nov 2 08:08:04.391: ppp22 PPP: Bind to [Virtual-Access1.1]
Отладка соединений WAN
Помните, что команда debug используется для поиска и устранения неполадок и доступна в привилегированном режиме интерфейса командной строки. В выходных данных команды debug отображается информация о различных операциях маршрутизатора, относящихся к трафику, генерируемому или принимаемому маршрутизатором, и все сообщениях об ошибках. Это может занять значительное количество ресурсов, и маршрутизатору приходится программно коммутировать отлаживаемые пакеты. Команду debug не следует использовать как средство мониторинга; напротив, предполагается, что она используется в течение короткого периода времени для поиска и устранения неполадок.
Для отображения информации о работе PPP используйте команду debug ppp . На рисунке показан синтаксис команды. Для отключения вывода отладочных данных используйте вариант этой команды с отрицанием ( no ).
Understanding debug ppp negotiation Output
The documentation set for this product strives to use bias-free language. For the purposes of this documentation set, bias-free is defined as language that does not imply discrimination based on age, disability, gender, racial identity, ethnic identity, sexual orientation, socioeconomic status, and intersectionality. Exceptions may be present in the documentation due to language that is hardcoded in the user interfaces of the product software, language used based on RFP documentation, or language that is used by a referenced third-party product. Learn more about how Cisco is using Inclusive Language.
Contents
Introduction
In dial-related applications, PPP is the most commonly used encapsulation type. PPP allows two machines on a point-to-point communication link to negotiate various parameters for authentication, compression, and the Layer 3 (L3) protocols, such as IP. A failure in the PPP negotiation between two routers causes the connection to fail.
The debug ppp negotiation command enables you to view the PPP negotiation transactions, identify the problem or stage when the error occurs, and develop a resolution. However, it is imperative that you understand the debug ppp negotiation command output. This document provides a comprehensive method to read debug ppp negotiation command output.
Prerequisites
Requirements
Readers of this document must ensure that these conditions are met:
PPP must be enabled on the interfaces on both routers. Issue the encapsulation ppp command to accomplish this.
Issue this command to enable Millisecond timestamps on the router:
For more information on debug commands, see Important Information on Debug Commands.
Note: PPP negotiation between two peers cannot start unless the lower layer (ISDN, physical interface, dial-up line, and so on) under PPP functions perfectly. For example, if you want to run PPP over ISDN, then all ISDN layers must be up; otherwise PPP does not start.
Components Used
This document is not restricted to specific software and hardware versions.
Conventions
For more information on document conventions, refer to the Cisco Technical Tips Conventions.
Phases of PPP Negotiation
The link goes through several phases in the process of PPP negotiation, as shown in this table. The end result is that PPP is either up or down.
| Phase | Description |
|---|---|
| DOWN | In this phase, PPP is down. This message is seen after the link and PPP are completely brought down: |
| ESTABLISHING | PPP transitions to this phase when it receives an indication that the physical layer is up and ready to be used. LCP 1 negotiation occurs in this phase. |
| AUTHENTICATING | If PPP authentication (CHAP 2 or PAP 3 ) is desired on the link, then PPP transitions to this phase. Keep in mind that PPP authentication is optional. |
| UP | Once authentication is complete, PPP transitions to the UP phase. NCP 4 negotiation occurs in this phase. |
| TERMINATING | In this phase, PPP shuts down. |
1. LCP = Link Control Protocol
2. CHAP = Challenge Handshake Authentication Protocol
3. PAP = Password Authentication Protocol
4. NCP = Network Control Protocol
This diagram shows the PPP phase transitions:
PPP Negotiation Packets: A Description
This table includes description of PPP negotiation packets that are used in both LCP and NCP negotiation:
| Packet | Code | Description |
|---|---|---|
| CONFREQ | Configure-Request | To open a connection to the peer, the device transmits this message along with the configuration options and values the sender wishes the peer to support. All options and values are negotiated simultaneously. If the peer responds with a CONFREJ or CONFNAK message, then the router sends another CONFREQ with another set of options or values. |
| CONFREJ | Configure-Reject | If some configuration option received in the CONFREQ message is not acceptable or not recognizable, the router responds with a CONFREJ message. The unacceptable option (from the CONFREQ message) is included in the CONFREJ message. |
| CONFNAK | Configure-NAK 1 | If the received configuration option is recognizable and acceptable, but some value is not acceptable, the router transmits a CONFNAK message. The router appends the option and value that it can accept in the CONFNAK message so that the peer can include that option in the next CONFREQ message. |
| CONFACK | Configure-ACK 2 | If all options in the CONFREQ message are recognizable and all values are acceptable, then the router transmits a CONFACK message. |
| TERMREQ | Terminate-Request | This message is used to initiate an LCP close. |
| TERMACK | Terminate-ACK | This message is transmitted in response to the TERMREQ message. |
1. NAK = Negative Acknowledge
2. ACK = Acknowledge
Note: Each peer can send CONFREQs with the option or value it wants the peer to support. This can cause the options negotiated in each direction to be different. For example, one side may wish to authenticate the peer, while the other may not.
LCP, Authentication, and NCP Stage
Within some of the PPP phases described previously, PPP also goes into specific stages such as LCP negotiation, authentication, and NCP negotiation. For more information, refer to RFC 1548 and RFC 1661 .
LCP (Mandatory Phase)
LCP is a phase in which parameters to establish, configure, and test the data-link connection are negotiated. An LCP state of open means that LCP was successfully completed, while an LCP state of closed indicates an LCP failure.
This diagram shows a conceptual view of an LCP handshake:
The LCP negotiation also uses a parameter called MagicNumber, which is used to determine if the link is looped back. A random string is sent across the link and, if the same value is returned, then the router determines that the link is looped back.
Authentication (Optional Phase by Default)
In this stage, the authentication is performed with the authentication protocol (CHAP or PAP) agreed upon in LCP negotiation. For PAP related information, refer to Configuring and Troubleshooting PPP Password Authentication Protocol (PAP).
Note: Authentication is optional and PPP only enters this stage if it needs to authenticate.
NCP (Mandatory Phase)
This phase is used to establish and configure different network-layer protocols. The most common L3 protocol negotiated is IP. The routers exchange IP Control Protocol (IPCP) messages to negotiate options specific to the protocol (IP in this example).
RFC 1332 says that IPCP negotiates two options: compression and IP address assignments. However, IPCP is also used to pass network related information such as primary and backup Windows Name Service (WINS) and Domain Name System (DNS) servers.
The negotiation occurs with the use of CONF messages, as described in the PPP Negotiation Packets: A Description section of this document.
Troubleshooting with debug ppp negotiation Output
When you read the debug ppp negotiation command output for troubleshooting purposes, follow these instructions:
Identify the phase transitions in the debug command output. Determine the furthest phase the connection achieved, such as UP or AUTHENTICATING. This can help you identify the phase in which the connection failed. For more information on the phases, see the Phases of PPP Negotiation section.
For the phase in which the failure occurred, look for messages that indicate that LCP, authentication, or NCP (as appropriate) are successful:
The LCP state should be open. You can also look at the last incoming and outgoing CONFACK messages to verify that the parameters you require have been negotiated.
Authentication should be successful. If you use two-way authentication, then each transaction must be successful. For more information on troubleshooting PPP authentication failures, refer to Troubleshooting PPP (CHAP or PAP) Authentication.
The IPCP state should be open. Verify that the addressing is correct and that a route to the peer is installed.
Read debug ppp negotiation Output
Most lines in the debug ppp negotiation command output are characterized by:
The timestamp—Millisecond timestamps are useful. See the Prerequisites section of this document for more information.
Interface and Interface number—This field is useful when debug connections use multiple connections, or when the connection transitions through several interfaces. For example, certain connections (such as multilink calls) are controlled by the physical interface at the beginning, but are later controlled by the dialer interface or virtual-access interface.
Type of PPP message—This field indicates whether the line is a general PPP, LCP, CHAP, PAP, or IPCP message.
Direction of the message—An I indicates an incoming packet, and an O indicates an outgoing packet. This field can be used to determine if the message was generated or received by the router.
Message—This field includes the particular transaction under negotiation.
ID—This field is used to match and coordinate request messages to the appropriate response messages. You can use the ID field to associate a response with an incoming message. This option is especially useful when the incoming message and the response are far apart in the debug output.
Length—The length field defines the length of the information field. This field is not important for general troubleshooting.
Note: Fields 4 through 7 may not appear in all PPP messages, depending on the purpose of the message.
Note: This example illustrates the fields:
Sample debug ppp negotiation Output
This is an annotated description of debug ppp negotiation command output:
Glossary and Common Messages
General
CONFREQ (Configure-Request):
When the lower layer becomes available (Up), a CONFREQ is sent to start the first PPP phase (LCP phase). It is used in LCP and NCP phases as an attempt to configure the connection. To open a connection to the peer, the device transmits this message along with the configuration options and values the sender wishes the peer to support. All options and values are negotiated simultaneously. If the peer responds with a CONFREJ or CONFNAK message, then the router sends another CONFREQ with another set of options or values.
CONFACK (Configure-Acknowledge):
If all options in the CONFREQ message are recognizable and all values are acceptable, then the router transmits a CONFACK message.
CONFREJ (Configure Reject):
If some configuration option received in the CONFREQ is not acceptable or not recognizable, the router responds with a CONFREJ message. The unacceptable option (from the CONFREQ) is included in the CONFREJ message.
CONFNAK (Configure Negative Acknowledge):
If the received configuration option is recognizable and acceptable, but some value is not acceptable, the router transmits a CONFNAK message. The router appends the option and value that it can accept in the CONFNAK message so that the peer can include that option in the next CONFREQ message.
ECHOREQ (Echo Request) and ECHOREP (Echo Reply):
PPP uses keepalives in order to maintain the integrity of the connection. These keepalives are the ECHOREQ frame that is sent to remote PPP peer, and the remote PPP peer should respond with an ECHOREP frame upon receipt of an ECHOREQ frame. By default, if the router misses five ECHOREP frames, then the link is considered down and PPP is brought down.
TERMREQ (Termination Request):
This frame indicates that the PPP peer that sent this frame terminates the PPP connection.
TERMACK (Termination Acknowledge):
This message is transmitted in response to the TERMREQ message. This closes down the PPP connection.
TERMINATING
This message indicates that the PPP connection has been brought down. An LCP or NCP connection can be cut off:
on administrative close (LCP only).
when the lower level goes out of service (dial-up line, ISDN, and so on).
when negotiations fall through.
on line loop detection.
ACCM (Asynchronous Control Character Map):
This is one of the LCP-negotiated options within the CONFREQ frame. ACCM sets the character escape sequences. ACCM tells the port to ignore specified control characters within the data stream. If the router at the other end of the connection does not support ACCM negotiation, the port is forced to use FFFFFFFF. In that case, issue this command:
ACFC (Address and Control Field Compression):
ACFC is an LCP option that allows endpoints to send messages back and forth more efficiently.
AuthProto (Authentication Protocol):
AuthProto is the authentication protocol type negotiated in the CONFREQ frame between both PPP connection peers for use in the authentication phase. If no PPP authentication is configured, this output is not seen in CONFREQ frame negotiated parameters. The possible values are CHAP or PAP.
Callback "#":
This message indicates that the callback option is under negotiation. The number after the callback syntax indicates which callback option is negotiated. The number 0 is normal PPP callback, while the number 6 indicates the Microsoft callback option (which is automatically available in Cisco IOS® Software Release 11.3(2)T or later).
CHAP (Challenge Handshake Authentication Protocol):
This message indicates that the authentication protocol under negotiation is CHAP.
EndpointDisc (End Point Discriminator):
This is an LCP option used to identify a PPP peer in PPP multilink connection. For more information, refer to Criteria for Naming Multilink PPP Bundles.
LCP: State is Open
This message indicates that the LCP negotiation has been completed successfully.
LQM (Link Quality Monitoring)
LQM is available on all serial interfaces that run PPP. LQM monitors the link quality and takes the link down when the quality drops below a configured percentage. The percentages are calculated for both the incoming and outgoing directions. The outgoing quality is calculated by comparison of the total number of packets and bytes sent with the total number of packets and bytes received by the peer. The incoming quality is calculated by comparison of the total number of packets and bytes received with the total number of packets and bytes sent by the peer.
When LQM is enabled, Link Quality Reports (LQRs) are sent every keepalive period. LQRs are sent in place of keepalives. All incoming keepalives are responded to properly. If LQM is not configured, keepalives are sent every keepalive period, and all incoming LQRs are responded to with an LQR.
MagicNumber
Magic Number support is available on all serial interfaces. PPP always attempts to negotiate for Magic Numbers, which are used to detect looped-back networks. A random string is sent across the link and if the same value is returned, then the router determines that the link is looped back.
The link might or might not be taken down upon looped-back detection; it depends on the use of the down-when-looped command.
PAP (Password Authentication Protocol)
This message indicates that the authentication protocol under negotiation for use by PPP peers is PAP. For more information on PAP, refer to Configuring and Troubleshooting PPP Password Authentication Protocol (PAP).
PFC (Protocol Field Compression)
This option turns compression for the protocol fields either on or off.
MRRU (Max Receive Reconstructed Unit)
This is an LCP option negotiated in the process of PPP multilink LCP setup. This option determines the maximum number of bytes that can constitute a frame. If MRRU is not negotiated in LCP, then Multilink PPP (MPPP) cannot run on the link.
MRU (Maximum Received Unit)
MRU is an LCP option negotiated in the CONFREQ frame to negotiate the size of the exchanged packets.
Authentication
AUTH-REQ (Authentication Request)
This frame is sent from the local PPP peer (on which authentication is enabled) to the remote peer. It asks the remote peer to send a valid username and password for PPP connection authentication. This frame is used only with PAP.
AUTH-ACK (Authentication Acknowledge)
This frame is sent out from the authenticated PPP peer to the authenticating PPP peer. This frame carries the valid username and password pair. This frame is used only when PAP is used for PPP connection authentication.
AUTH-NAK or FAILURE
This frame is sent out from the authenticating PPP peer when the authentication failed on the authenticating PPP peer.
CHALLENGE
This is the CHAP challenge frame that is sent from the authenticating PPP peer to the authenticated PPP peer. The challenge frame consists of an ID, a random number, and either the host name of the local communication server or the name of the user on the remote device. This frame is used only when CHAP is used for PPP connection authentication.
RESPONSE
This frame is the CHAP response sent from the authenticated PPP peer to the authenticating PPP peer.
The required response consists of two parts:
An MD5 hash output of the shared secret.
Either the host name of the remote device or the name of the user on the remote device.
This frame is used only when CHAP is used for PPP connection authentication.
Address a.b.c.d
On an outgoing CONFREQ message, this value indicates the IP address the local router wishes to use. If the address included is 0.0.0.0, the local machine requests the peer to supply it an IP address it can use.
On an incoming CONFREQ message, this value indicates the IP address the peer wishes to use. If the address included is 0.0.0.0, the peer requests the local machine to supply it an IP address it can use.
On an outgoing CONFNAK message, this value indicates the IP address the peer should use rather than the one the peer suggested in the CONFREQ message.
On an incoming CONFNAK message, this value indicates the IP address the local machine should use, instead of the one it suggested in the previous CONFREQ message.
On an outgoing CONFACK message, this value indicates that the IP address requested by the peer is acceptable to the local machine.
On an incoming CONFACK message, this value indicates that the IP address requested by the local machine is acceptable to the peer.
CCP (Compression Control Protocol)
This message indicates that a compression protocol is under negotiation between both PPP peers. Cisco IOS Software supports these compression protocols to be negotiated over a PPP connection:
MS-Point-to-Point Compression (MS-PPC)
CDPCP (Cisco Discovery Protocol Control Protocol)
This message indicates that CDP negotiation occurs in the NCP phase. To turn off CDP on the router, issue the no cdp run command.
CODEREJ (Code Reject)
A CODEREJ packet is sent upon receipt of an uninterpretable packed from the remote PPP peer.
Install route to a.b.c.d
When the router finishes IPCP (NCP phase for IP L3 protocol), it must install the given IP address to the remote PPP peer in the routing table and be seen as a connected route in the routing table. If you do not see this message, verify that the no peer neighbor-route command is not configured.
IPCP (IP Control Protocol)
This value indicates that IP is the network layer under negotiation in the NCP phase.
IPCP State is Open
This message indicates the IPCP (NCP phase for IP L3 protocol) has been completed successfully.
PROTREJ (Protocol Reject)
The PPP peer, upon receipt of a PPP packet with an unknown protocol field, uses the PROTREJ message to indicate that the peer has attempted to use a protocol that is unsupported. When a PPP device receives a PROTREJ message, it must at the earliest opportunity cease to send packets of the indicated protocol.