路由器的ppp封装和pap认证:

Pap 只是单向认证——即远程路由器router2 中心路由器 router 0 上的认证。

 

Router 0 <中心点>的配置:

Press RETURN to get started!

 

 

Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#interface fastEthernet 0/0
Router(config-if)#ip address 1.1.1.1 255.0.0.0
Router(config-if)#no shutdown

 

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Router(config-if)#exit
Router(config)#interface serial 0/0
Router(config-if)#ip address 2.2.2.1 255.0.0.0
Router(config-if)#no shutdown

 

%LINK-5-CHANGED: Interface Serial0/0, changed state to down
Router(config-if)#clock rate 64000
Router(config-if)#no shutdown
Router(config-if)#
%LINK-5-CHANGED: Interface Serial0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up
Router(config-if)#
Router(config-if)#exit
Router(config)#ip route 3.3.3.0 255.0.0.0 serial 0/0
Router(config)#^Z
%SYS-5-CONFIG_I: Configured from console by console
      
Router#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

 

Gateway of last resort is not set

 

C    1.0.0.0/8 is directly connected, FastEthernet0/0
C    2.0.0.0/8 is directly connected, Serial0/0
S    3.0.0.0/8 is directly connected, Serial0/0
Router#ping 3.3.3.2

 

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 62/62/63 ms

 

Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#interface serial 0/0
Router(config-if)#encapsulation ppp

 

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to down
Router(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up
Router(config-if)#exit
Router(config)#hostname 1111
1111(config)#?
Configure commands:
  access-list      Add an access list entry
  banner           Define a login banner
  boot             Modify system boot parameters
  cdp              Global CDP configuration subcommands
  clock            Configure time-of-day clock
  config-register  Define the configuration register
  crypto           Encryption module
  do               To run exec commands in config mode
  enable           Modify enable password parameters
  end              Exit from configure mode
  exit             Exit from configure mode
  hostname         Set system's network name
  interface        Select an interface to configure
  ip               Global IP configuration subcommands
  line             Configure a terminal line
  no               Negate a command or set its defaults
  router           Enable a routing process
  service          Modify use of network based services
  username         Establish User Name Authentication
1111(config)#enable password 33
1111(config)#username 1111 password 33
1111(config)#end
%SYS-5-CONFIG_I: Configured from console by console
1111#ping 3.3.3.2

 

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.2, timeout is 2 seconds:
.!!!.
Success rate is 60 percent (3/5), round-trip min/avg/max = 47/78/94 ms

 

1111#ping 3.3.3.2

 

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 63/84/125 ms

 

1111#

 

 

 

 

Router 2 的配置:

Press RETURN to get started!

 

 

 

Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#interface fastEthernet 0/0
Router(config-if)#ip address 3.3.3.1 255.0.0.0
Router(config-if)#no shutdown

 

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Router(config-if)#exit
Router(config)#interface serial 0/0
Router(config-if)#ip address 2.2.2.2 255.0.0.0
Router(config-if)#no shutdown

 

%LINK-5-CHANGED: Interface Serial0/0, changed state to up
Router(config-if)#exit
Router(config)#ip route 1.1.1.0 255.0.0.0 serial 0/0
Router(config)#^Z
%SYS-5-CONFIG_I: Configured from console by console
Router#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

 

Gateway of last resort is not set

 

S    1.0.0.0/8 is directly connected, Serial0/0
C    2.0.0.0/8 is directly connected, Serial0/0
C    3.0.0.0/8 is directly connected, FastEthernet0/0
Router#ping 1.1.1.2

 

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 62/62/63 ms

 

Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#interface serial 0/0
Router(config-if)#encapsulation ppp

 

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to downRouter(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up
Router(config-if)#
Router(config)#interface serial 0/0
Router(config-if)#ppp ?
  authentication  Set PPP link authentication method
  pap             Set PAP authentication paramet
Router(config-if)#ppp pap ?
  sent-username  Set outbound PAP username
Router(config-if)#ppp pap sent-username 1111 password 33
Router(config-if)#end
%SYS-5-CONFIG_I: Configured from console by console
Router#ping 1.1.1.2

 

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 63/75/94 ms

 

Router#