<?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" />
PPPOE拨号实验
左边台路由器模拟pppoe服务器,右边台路由器模拟客户端拨号路由器,他们之间通过f0/0口相连。
配置服务器端:
PPPOE Server 配置
PPP-S#configure terminal
PPP-S(config)#username cisco password 0 cisco
//建立拨入的用户账户
PPP-S(config)#vpdn enable
PPP-S(config)#no vpdn logging
PPP-S(config)#vpdn-group adls0<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
左边台路由器模拟pppoe服务器,右边台路由器模拟客户端拨号路由器,他们之间通过f0/0口相连。
配置服务器端:
PPPOE Server 配置
PPP-S#configure terminal
PPP-S(config)#username cisco password 0 cisco
//建立拨入的用户账户
PPP-S(config)#vpdn enable
PPP-S(config)#no vpdn logging
PPP-S(config)#vpdn-group adls0<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
/建立名字为” adls<?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />0”的vpdn 组 ,可以有很多个组
PPP-S(config-vpdn)#accept-dialin
//允许拨入(将路由器当PPPOE server用accept-dialin
允许客户端拨入命令;若是将路由器当PPPOE client用
request-dialin向服务器发出请求接入信息。)
PPP-S(config-vpdn-acc-in)#protocol pppoe
//协议采用pppoe, 只能有一个组采用pppoe
PPP-S(config-vpdn-acc-in)#virtual-template 1
// ×××D组和VT1接口绑定,此接口就是拨号后PPPOE
客户端的网关接口。这个可以使任意已经存在的VT,
PPP-S(config-vpdn-acc-in)#exit
但是只能使用一个,后配置的将取代先前的
PPP-S(config-vpdn)#pppoe limit per-mac 1
//限制客户端的MAC地址数
PPP-S(config-vpdn)#interface FastEthernet0/0
PPP-S(config-if)#!ip address 1.1.1.1 255.255.255.0
//ip地址可以不设置
PPP-S(config-if)#no shutdown
PPP-S(config-if)#pppoe enable
PPP-S(config-if)#no cdp enable
PPP-S(config-if)#interface Virtual-Template 1
//设置虚拟模板 1
PPP-S(config-if)#ip address 200.0.0.1 255.255.255.0
//ip地址
PPP-S(config-if)#peer default ip address pool vt1
//使用”vt1”中设置的地址范围给客户端配分配ip
PPP-S(config-if)#ppp authentication chap pap callin
// 采用chap和pap混合验证,也可以单独采用一种
PPP-S(config-if)#ppp ipcp dns 202.101.172.37
//设置拨入客户端的dns,当客户端采用自动获取时
// Router (config-if)#ip unnumbered FastEthernet0/0 #虚拟板接口不设置IP而是借用FastEthernet0/0上的IP地址,这个命令与IP address 命令选用.
PPP-S(config-if)#exit
PPP-S(config)#ip local pool vt1 200.0.0.20 200.0.0.254
//定义可能的分配的地址范围
PPP-S(config)#no cdp run
PPP-S(config)#end
测试参数
Sh user
显示拨入用户信息
Clear pppoe all
断开pppoe连接
Debug ppp | pppoe
显示相应的pppoe拨入信息
客户端配置PPP-C
大致步骤:设置内外网接口,配置拨号用的虚拟机接口(包括采用协议,验证方式,账户密码),最后配置NAT
PPP-C#conf t
PPP-C(config)#vpdn enable
//启用路由器的虚拟专用拨号网络---***d 由于ADSL的PPPoE应用是通过虚拟拨号来实现的所以在路由器中需要使用VPDN的功能
PPP-C(config)#int e1/0
// 路由器内网接口
PPP-C(config-if)#no shut
PPP-C(config-if)#ip add
192.168.0.1 255.255.255.0
PPP-C(config-if)#ip nat inside
PPP-C(config)#int f0/0
//与ADSL model连接的端口
PPP-C(config-if)#no ip add
PPP-C(config-if)#no shut
PPP-C(config-if)#pppoe enable
PPP-C(config-if)#pppoe-client dial-pool-number 100 // 将以太接口的pppoe拨号客户端加入拨号池 100
虚拟拨号接口
PPP-C(config)#int dialer 0
//配置虚拟拨号接口 0 ,类似于xp中建立的拨号连接
PPP-C(config-if)#ip address negotiated
//协商获得ip地址
PPP-C(config-if)#ip mtu 1492
//适用于ADSL线路,原始大小是1500 ,1492=1500-pppoe header
PPP-C(config-if)#no shut
PPP-C(config-if)#encapsulation ppp
//协议类型为ppp
PPP-C(config-if)#ppp authentication chap pap callin
//验证方式采用chap和pap,方式取决于服务器方,二者前后位置可以调换
PPP-C(config-if)#ppp chap hostname cisco
//设置chap 账号
PPP-C(config-if)#ppp chap password cisco
//设置chap 密码
PPP-C(config-if)#ppp pap sent-username cisco password cisco //只是是采用pap验证,上面关于chap的不需要设置
PPP-C(config-if)#dialer pool 100
// 该接口使用100号拨号池进行拨号,应该与上面理接口f0/0 pppoe-client dial-pool-nuber 号码一致
PPP-C(config-if)#ppp ipcp dns
request
//客户端dns采用服务器上预先设置的,也可以手动设置固定ip地址:202.98.96.68
PPP-C(config-if)#ip nat outside
//设置内部接口和dialer 0 的PAT
PPP-C(config)#access-list 1 permit 192.168.0.0 0.0.0.255
PPP-C(config)#ip nat inside source list 1 interface dialer 0 overload
PPP-C(config)#service dhcp
PPP-C(config)#ip dhcp pool nat-ip
//配置作用域
PPP-C(dhcp-config)#network 192.168.0.0 255.255.255.0
//地址范围
PPP-C(dhcp-config)#default-router 192.168.0.1
// 默认网关
PPP-C(dhcp-config)#dns-server 10.0.0.2
//DNS服务器
PPP-C(dhcp-config)#lease 1
//租期1天
PPP-C(config)#ip dhcp excluded-address 192.168.0.2 192.168.0.15 //指定保留的ip地址
PPP-C(config)#ip route 0.0.0.0 0.0.0.0 dialer 0
//配置内部到远端的缺省路由
转载于:https://blog.51cto.com/79502243/566603