港湾路由器PPPOE配置事例(思科的类同)- -

                                      
一、环境
软件版本:1.3正式版
路由器:1760/2651/3680
二、配置事例
1、 PPPOE客户端配置:
2、PPPOE服务器配置:
3、路由器做为PPPOE接入服务器(本地认证),同时router也作为PPPOEinternet的客户端,另外还使用了NAT功能。
4、监视和维护PPPOE

1、PPPOE客户端配置:
配置拨号:
Router(config)#interface dialer 0
Router (config-if-dialer0)#ip address negotiated
Router (config-if-dialer0)#dialer pool 1
Router (config-if-dialer0)#dialer permit-dial-null-string
Router (config-if-dialer0)#dialer-group 1
Router (config-if-dialer0)#ppp pap sent-username user password pass
Router (config-if-dialer0)#exit
Router (config)#dialer-list 1 protocol ip permit
使能PPPOE:
Router (config-if-eth0/1)#pppoe-client dial-pool-number 1
2、PPPOE服务器配置:
配置virtual-templete:
Router(config)# ip local pool ip-pool 10.0.0.2 10.0.0.255
Router(config)#interface virtual-templete 0
Router (config-if-virtual-templete0)#ip address 10.0.0.1/24
Router (config-if-virtual-templete0)# peer de ip address pool ip-pool
Router (config-if-virtual-templete0)# ppp authentication chap default
Router (config-if-virtual-templete0)#exit
使能PPPOE:
Router(config)#pppoe virtual-template 0
Router (config-if-eth0/0)#pppoe enable
配置AAA采用本地认证
Router(config)#aaa-enable
Router(config)#aaa authentication ppp default local
Router(config)#username user1 privilege 1 password user1
Router(config)#username aaa privilege 1 password aaa
3、路由器Router做为PPPOE接入服务器(本地认证),同时router也作为PPPOE上internet的客户端,另外还使用了NAT功能。
    
配置:
access-list 1 permit 192.168.0.0/24      
aaa-enable
aaa authentication login default local
aaa authentication ppp default local
username 163 privilege 1 password 163
username admin privilege 1 password harbour
pppoe virtual-template 0
ip local pool ip-pool 192.168.0.2 192.168.0.255
dialer-list 1 protocol ip permit
!
interface eth1/0
pppoe-client dial-pool-number 1
!
interface eth2/0
pppoe enable

!
interface async0/0
!
interface dialer0
ip address negotiated
ip nat outside
ppp pap sent-username 163 password 163
dialer pool 1
dialer-group 1
dialer permit-dial-null-string
!
interface virtual-template0
ip address 192.168.0.1/24
ip nat inside
peer default ip address pool ip-pool
ppp authentication chap default
compress stac     —— 此命令需要与客户端配合(如果客户端选择了压缩,则在路由器上要配上压缩,否则就不需要配了),否则网络注册比较慢(大概20秒种)!
ppp ipcp DNS 91.21.80.1
!
!Rip config
router rip
!
ip route 0.0.0.0/0 eth1/0
ip nat on
ip nat inside source list 1 interface eth1/0
line console 0
line aux 0
line vty 0
password harbour
login authentication default
line vty 1 9
!
!end
监视和维护PPPOE
PPPOE DEBUG信息 Debug pppoe pppoe-data/ pppoe-packets
  
(1) debug pppoe pppoe-packet的显示信息解释如下:
router# debug pppoe pppoe-packet
router# term moni
pppoe:eth0/1 I code = PADI(0x09)
网口eth0/1收到pppoe客户端的PADI
pppoe:eth0/1 O code = PADO(0x07)
网口eth0/1向pppoe客户端输出PADO
pppoe:eth0/1 I code = PADR(0x19)
网口eth0/1收到pppoe客户端的PADR
pppoe:eth0/1 O code = PADS(0x65)
网口eth0/1向pppoe客户端输出PADS
pppoe:eth0/1 change state to SESSION
pppoe连接进入会话阶段
(2) debug pppoe pppoe-data的显示信息解释如下:
router# debug pppoe pppoe-packet
router# term moni
pppoe:eth0/1 IN packet ,size 46
网口eth0/1收到尺寸为46字节的包
ppoe:eth0/1 OUT packet ,size 40
网口eth0/1输出尺寸为40字节的包
pppoe:eth0/1 OUT packet ,size 29
网口eth0/1输出尺寸为29字节的包
pppoe:eth0/1 IN packet ,size 46
网口eth0/1收到尺寸为46字节的