系统管理指南:网络服务

Procedure如何获取 PPPoE 的诊断信息

您可以使用 PPP 和标准的 UNIX 实用程序来确定 PPPoE 问题。如果您怀疑链路问题是由于 PPPoE 所致,请使用以下诊断工具获取疑难解答信息。

  1. 成为运行 PPPoE 通道的计算机(PPPoE 客户机或 PPPoE 访问服务器)的超级用户。

  2. 按照如何启用 PPP 调试功能过程中的说明,打开调试功能。

  3. 查看日志文件 /var/log/pppdebug 的内容。

    以下示例显示了使用 PPPoE 通道生成的部分链路日志文件。


    Sep  6 16:28:45 enyo pppd[100563]: [ID 702911 daemon.info] Plugin 
    
      pppoe.so loaded.
    
    Sep  6 16:28:45 enyo pppd[100563]: [ID 860527 daemon.notice] pppd 
    
      2.4.0b1 (Sun Microsystems, Inc.,
    
    Sep  5 2001 10:42:05) started by troot, uid 0
    
    Sep  6 16:28:46 enyo pppd[100563]: [ID 702911 daemon.debug] connect option:
    
       '/usr/lib/inet/pppoec 
    
    -v hme0' started (pid 100564)
    
    Sep  6 16:28:46 enyo pppd[100563]: [ID 702911 daemon.info] Serial connection established.
    
    Sep  6 16:28:46 enyo pppd[100563]: [ID 702911 daemon.info] Using interface sppp0
    
    Sep  6 16:28:46 enyo pppd[100563]: [ID 702911 daemon.notice] Connect: sppp0
    
       <--> /dev/sppptun
    
    Sep  6 16:28:46 enyo pppd[100563]: [ID 702911 daemon.debug] /etc/ppp/pap-secrets
    
      is apparently empty
    
    Sep  6 16:28:46 enyo pppd[100563]: [ID 702911 daemon.debug] /etc/ppp/chap-secrets
    
      is apparently empty
    
    Sep  6 16:28:46 enyo pppd[100563]: [ID 702911 daemon.debug] sent 
    
      [LCP ConfReq id=0xef <mru 1492> 
    
    asyncmap 0x0 <magic 0x77d3e953><pcomp><acomp>
    
    Sep  6 16:28:46 enyo pppd[100563]: [ID 702911 daemon.debug] rcvd 
    
      [LCP ConfReq id=0x2a <mru 1402>
    
    asyncmap 0x0 <magic 0x9985f048><pcomp><acomp 

    如果通过该调试输出无法确定问题,请继续执行此过程。

  4. 获取 PPPoE 的诊断消息。


    # pppd connect "/usr/lib/inet/pppoec -v interface-name"
    

    pppoec 将诊断信息发送到 stderr。如果您在前台运行 pppd,输出将显示在屏幕上。如果在后台运行 pppd,输出将发送到 /etc/ppp/connect-errors

    以下示例显示了协商 PPPoE 通道时生成的消息。


    Connect option: '/usr/lib/inet/pppoec -v hme0' started (pid 100564)
    
    /usr/lib/inet/pppoec: PPPoE Event Open (1) in state Dead (0): action SendPADI (2)
    
    /usr/lib/inet/pppoec: Sending PADI to ff:ff:ff:ff:ff:ff: 18 bytes
    
    /usr/lib/inet/pppoec: PPPoE State change Dead (0) -> InitSent (1)
    
    /usr/lib/inet/pppoec: Received Active Discovery Offer from 8:0:20:cd:c1:2/hme0:pppoed
    
    /usr/lib/inet/pppoec: PPPoE Event rPADO+ (5) in state InitSent (1): action SendPADR+ (5)
    
    /usr/lib/inet/pppoec: Sending PADR to 8:0:20:cd:c1:2: 22 bytes
    
    /usr/lib/inet/pppoec: PPPoE State change InitSent (1) -> ReqSent (3)
    
    /usr/lib/inet/pppoec: Received Active Discovery Session-confirmation from
    
       8:0:20:cd:c1:2/hme0:pppoed
    
    /usr/lib/inet/pppoec: PPPoE Event rPADS (7) in state ReqSent (3): action Open (7)
    
    /usr/lib/inet/pppoec: Connection open; session 0002 on hme0:pppoe
    
    /usr/lib/inet/pppoec: PPPoE State change ReqSent (3) -> Convers (4)
    
    /usr/lib/inet/pppoec: connected

    如果通过该诊断消息无法确定问题,请继续执行此过程。

  5. 运行 snoop。 然后将跟踪保存到文件。

    有关 snoop 的信息,请参阅 snoop(1M) 手册页。


    # snoop -o pppoe-trace-file
    
  6. 查看 snoop 跟踪文件。


    # snoop -i pppoe-trace-file -v pppoe

    ETHER: ----- Ether Header -----
    
    ETHER:
    
    ETHER: Packet 1 arrived at 6:35:2.77
    
    ETHER: Packet size = 32 bytes
    
    ETHER: Destination = ff:ff:ff:ff:ff:ff, (broadcast)
    
    ETHER: Source      = 8:0:20:78:f3:7c, Sun
    
    ETHER: Ethertype = 8863 (PPPoE Discovery)
    
    ETHER:
    
    PPPoE: ----- PPP Over Ethernet -----
    
    PPPoE:
    
    PPPoE: Version = 1
    
    PPPoE: Type = 1
    
    PPPoE: Code = 9 (Active Discovery Initiation)
    
    PPPoE: Session Id = 0
    
    PPPoE: Length = 12 bytes
    
    PPPoE:
    
    PPPoE: ----- Service-Name -----
    
    PPPoE: Tag Type = 257
    
    PPPoE: Tag Length = 0 bytes
    
    PPPoE:
    
    PPPoE: ----- Host-Uniq -----
    
    PPPoE: Tag Type = 259
    
    PPPoE: Tag Length = 4 bytes
    
    PPPoE: Data = Ox00000002
    
    PPPoE:
    
    .
    
    .
    
    .
    
    ETHER: ----- Ether Header -----
    
    ETHER:
    
    ETHER: Packet 5 arrived at 6:35:2.87
    
    ETHER: Packet size = 60 bytes
    
    ETHER: Destination = 8:0:20:78:f3:7c, Sun)
    
    ETHER: Source      = 0:2:fd:39:7f:7, 
    
    ETHER: Ethertype = 8864 (PPPoE Session)
    
    ETHER:
    
    PPPoE: ----- PPP Over Ethernet -----
    
    PPPoE:
    
    PPPoE: Version = 1
    
    PPPoE: Type = 1
    
    PPPoE: Code = 0 (PPPoE Session)
    
    PPPoE: Session Id = 24383
    
    PPPoE: Length = 20 bytes
    
    PPPoE:
    
    PPP: ----- Point-to-Point Protocol -----
    
    PPP:
    
    PPP-LCP: ----- Link Control Protocol -----
    
    PPP-LCP:
    
    PPP-LCP: Code = 1 (Configure Request)
    
    PPP-LCP: Identifier = 80
    
    PPP-LCP: Length = 18