实验拓扑:

 

 

PC:


hostname PC


interface FastEthernet0/0
ip address 10.1.1.1 255.255.255.0

no ip routing //关闭路由器的路由功能,模拟成一台PC机
ip default-gateway 10.1.1.254 //配置默认网关

 

NAT:

hostname NAT

interface FastEthernet0/0
no sh
pppoe enable group global //全局开启PPPoe
pppoe-client dial-pool-number 1  //将物理端口绑定到拨号池1


interface FastEthernet1/0
ip address 10.1.1.254 255.255.255.0
ip nat inside                           //nat的内部转换端口
no sh
!
interface Dialer1                   //创建逻辑接口
ip address negotiated           //接口通过ppp协商获取地址
ip nat outside                       //该接口为NAT转换的外部端口
encapsulation ppp               //封装PPP,默认就是PPP封装方式
dialer pool 1                       //建立拨号地址池1(用于高级DDR中,逻辑接口需要关联由具体的                                             物理接口组成的地址池才能进行拨号)
dialer-group 1                    //关联刺激拨号规则
ppp pap sent-username ccie password cisco     //发送ppp认证的用户名ccie和密码cisco 
!
ip route 0.0.0.0 0.0.0.0 Dialer1 //创建一条静态路由,下一条为逻辑接口
!
ip nat inside source list 1 interface Dialer1 overload   //对逻辑接口进行端口复用
!
access-list 1 permit any           //定义ACL,允许所有
dialer-list 1 protocol ip list 1     //要定义刺激拨号的规则

 

BAS

hostname BAS
!
username ccie password cisco     //创建pppoe拨号的数据库
!
bba-group pppoe global              //建立全局bba组,可以改名字
!
bba-group pppoe telcom           
virtual-template 1                         //绑定到虚拟模板接口1 
 !
interface FastEthernet0/0
ip address 212.1.1.1 255.255.255.252
no sh
!
interface FastEthernet1/0
no sh
pppoe enable group telcom           //接口上调用
!
interface Virtual-Template1           //进入到虚拟模板接口
ip address 211.1.1.254 255.255.255.0
peer default ip address pool  PPPOE //指定pppoe客户端的地址池,地址池的名字为PPPOE         ppp authentication pap                     //pppoe采用pap认证方式
!
router ospf 1
network 211.1.1.0 0.0.0.255 area 0
network 212.1.1.0 0.0.0.3 area 0
!
ip local pool PPPOE 211.1.1.1 211.1.1.253     //定义pppoe客户端地址池的地址范围

 

ISP

hostname ISP
!
interface Loopback0
ip address 8.8.8.8 255.255.255.255
!
interface FastEthernet0/0
ip address 212.1.1.2 255.255.255.252
!
router ospf 1
network 8.8.8.8 0.0.0.0 area 0
network 212.1.1.0 0.0.0.3 area 0