ppp
                           12.1.1.0/24
   lo0 1.1.1.1/32 R1 s1/0 --------------s2/0 R2 lo0 2.2.2.2/32

 

r1:
 en
 config t
 hostname R1
 no ip domain-lookup
 lin 0
 exec-timeout 0 0
 logging syn
 exit

 int lo 0
 ip add 1.1.1.1 255.255.255.255
 exit
 int s1/0
 ip add 12.1.1.1 255.255.255.0
 no shutdown
 exit

r2:
 en
 config t
 hostname R2
 no ip domain-lookup
 lin 0
 exec-timeout 0 0
 logging syn
 exit

 int lo 0
 ip add 2.2.2.2 255.255.255.255
 exit
 int s1/0
 ip add 12.1.1.2 255.255.255.0
 no shutdown
 exit

R1#show int s1/0
Serial1/0 is administratively down, line protocol is down
  Hardware is M4T
  MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation HDLC :看它的封装是hdlc
  
R2#show int s2/0
Serial2/0 is administratively down, line protocol is down
  Hardware is M4T
  MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation HDLC,看它的封装

r1 config t
   int s1/0
   encapsulation ppp
   end
R1#show int s1/0
Serial1/0 is administratively down, line protocol is down
  Hardware is M4T
  MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation PPP,LCP Closed,看到现在是封装 PPP 但LCP层是关闭的

r1  config t
    int s1/0
    no shutdown
    end

R1#debug ppp negotiation 看看他们的协商
PPP protocol negotiation debugging is on

 

r2 config t
   int s2/0
   no shutdown
   end
  *Feb 27 17:45:17.283: %LINK-3-UPDOWN: Interface Serial2/0,

changed state to up 物理层up

r1
*Feb 27 17:46:32.651: Se1/0 LCP: O CONFREQ [REQsent] id 87 len 10

全部是sent出去的包 没有回来的

R1#    show int s1/0
Serial1/0 is up, line protocol is down
  Hardware is M4T
  MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation PPP, LCP Listen,看它LCP属于侦听listen.原因是它两边

的封装协议不一样

r1 unde all

R2#    show ip int bri
Interface                  IP-Address      OK? Method Status       

        Protocol
Ethernet0/0                unassigned      YES unset 

administratively down down   
Serial1/0                  unassigned      YES unset 

administratively down down   
Serial2/0                  unassigned      YES unset  up           

        down 协议是dawn的
R2#config t
Enter configuration commands, one per line.  End with CNTL/Z.
R2 int s2/0
R2 encapsulation ppp
   end

R2#debug ppp negotiation
PPP protocol negotiation debugging is on

R2#show int s2/0
Serial2/0 is up, line protocol is up
  Hardware is M4T
  MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation PPP, LCP Open
r1 show cdp nei
r1 config t
   int s1/0
   ip add 12.1.1.1 255.255.255.0
   end

r2 config t
   int s2/0
   ip add 12.1.1.2 255.255.255.0
   end
R1#
*Feb 27 18:43:43.719: %SYS-5-CONFIG_I: Configured from console by

console
R1#
*Feb 27 18:47:26.363: Se1/0 IPCP(第三层路由 IP ICMP): I CONFREQ

[Listen] id 1 len 10
*Feb 27 18:47:26.363: Se1/0 IPCP:    Address 12.1.1.2

(0x03060C010102)
*Feb 27 18:47:26.363: Se1/0 IPCP: O CONFREQ [Listen] id 2 len 10
*Feb 27 18:47:26.363: Se1/0 IPCP:    Address 12.1.1.1

(0x03060C010101)
*Feb 27 18:47:26.363: Se1/0 IPCP: O CONFACK [Listen] id 1 len 10
*Feb 27 18:47:26.363: Se1/0 IPCP:    Address 12.1.1.2

(0x03060C010102)
*Feb 27 18:47:26.371: Se1/0 IPCP: I CONFACK [ACKsent] id 2 len 10
*Feb 27 18:47:26.371: Se1/0 IPCP:    Address 12.1.1.1

(0x03060C010101)
*Feb 27 18:47:26.371: Se1/0 IPCP: State is Open
*Feb 27 18:47:26.371: Se1/0 IPCP: Install(路由表里安装) route to

12.1.1.2
r2 show ip route
C       12.1.1.1/32(路由表不准IP地址的 给32位做主机路由) is

directly connected, Serial2/0  
r1  show ip route
C       12.1.1.2/32 is directly connected, Serial1/0  同上32位


r1 config t
   int s1/0
   no peer neighbor-route
   end

r2 config t
   int s2/0
   no peer neighbor-route
   end

r1 clear ip route *
r1 show ip route

r2 clear ip route *
r2 show ip route

r1 debug ppp packet
R1#show int s1/0
Serial1/0 is up, line protocol is up
  Hardware is M4T
  Internet address is 12.1.1.1/24
  MTU 1500 bytes, BW 1544 Kbit, 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) 保持存活时间
r1 config t
   interface s1/0
   keepalive 1 (只是做实验乱设的 现实不要改)
   end

----------------------------------------------------------------
PPP 认证(authentication)PAP(两次认/握手) CHAP
r1 config t
   int s1/0
   encapsulation ppp
   shutdown
   int s1/0
   ppp authentication ?
   ppp authentication pap

r2 config t
   int s2/0
   encapsulation ppp
   shutdown
   int s2/0
   ppp authentication ?
   ppp authentication pap

r1 ppp pap send-username abc password abc
   end
r1 int s1/0
   no shutddown
   end
r1 debug ppp authentication
   end
r2 int s2/0
   no shutdown
   end
r1 debug all

r1 config t
   username xyz password xyz
   end
r2 config t
   int s2/0
   ppp pap sent-username xyz password xyz
   end
r2 config t
   username abc password abc
   end
r1 show run int s1/0

r1 debug ppp authentication
r1 config t
   int s1/0
   shutdown
   exit
r2 config t
   int s2/0
   shutdown ( 触发一个全新的认证)
   exit
r1 int s1/0
   no shutdown
   exit
------------------------------------------------------
来一次完整的认证
r2 int s2/0
   shutdown
   exit

r1 int s1/0
   no shutdown
   exit
r2 int s2/0
   shutdown
   exit

r1 show run interface s1/0
r1 config t
   int s1/0
   no ppp authentication pap
   no ppp pap sent-username abc password abc
   end
r2 config t
   int s2/0
   no ppp authentication pap
   no ppp pap sent-username xyz password xyz
   end
r1 config t
   int s1/0
   ppp authentication pap
   ppp pap sent-username abc password abc
   end
r2 config t
   int s2/0
   ppp authentication pap       单项认证它不需要再发username

password
   end
r2 debug ppp authentication
r1 debug ppp authentication
再把接口打开
r1 config t
   int s1/0
   no shutdown
   end
r2 config t
   int s2/0
   no shutdown
   end
r1 show ip interface bri     (看看两个UP了没有)
r2 show ip interface bri     (看看两个UP了没有)

-----------------------------------------------------------------------------------------
  1.lcp   2.lcp的认证(authentication)PAP CHAP   3.ncp
ppp 是用在远程接入 点到点  会自动分配地址
ppp 分两层 lcp控制链路的建立   ncp:控制网络协议(ip ipx..)
PPP 是唯一二层协议支持authentication
二层的封装 :ppp hdlc(cisco)   以太网是多点接入