配置pppoe的服务器端:
1.设置vpdn的参数
vpdnenable
!
vpdn-group1
accept-dialin
protocolpppoe
virtual-template1
2.以太口启用d
interfaceFastEthernet0/0
duplexhalf
pppoeenable
3.配置virtual-template
interfaceVirtual-Template1
ipaddress 124.1.1.1 255.255.255.0---------------------网关;
peer default ip address pool IPPOOL-----------------地址池;
pppauthentication pap---------------------------------启用ppp的pap认证;
4.配置地址池
iplocal pool IPPOOL 123.1.1.100 123.1.1.200
5.配置用户名和密码
usernamepppoepassword 0 pppoe
配置路由器pppoe的客户端:
第一步:配置vpdn
vpdn enable(启用路由器的虚拟专用拨号网络---d)
vpdn-groupoffice(建立一个vpdn组,)
request-dialin(初始化一个dtunnel,建立一个请求拨入的vpdn子组,)
protocolpppoe(vpdn子组使用pppoe建立会话隧道)
第二步: 配置路由器连接adsl modem的接口
interfaceEthernet1
no ipaddress
pppoe enable允许以太接口运行pppoe
pppoe-clientdial-pool-number 1将以太接口的pppoe拨号客户端加入拨号池1
第三步:配置逻辑拨号接口:
interfaceDialer1
ip addressnegotiated从adsl服务商动态协商得到ip地址
ip natoutside为该接口启用NAT
encapsulationppp为该接口封装ppp协议
dialer pool1该接口使用1号拨号池进行拨号
dialer-group1该命令对于pppoe是意义不大的
pppauthentication pap callin启用ppp pap验证
ppp papsent-username xxxxxxx password 0 yyyyyyy使用已经申请的用户名和口令
第四步:配置内部网络接口
interfaceEthernet0(内部网络接口)
ip address10.1.1.1 255.255.255.0
ip natinside为该接口启用NAT
第五步:配置路由器为内部网络主机提供dhcp服务
ip dhcpexcluded-address 10.1.1.1
ip dhcp poolABC
import all(导入dns和wins server)
network10.1.1.0 255.255.255.0
default-router10.1.1.1
第六步:配置NAT:
access-list1 permit 10.1.1.0 0.0.0.255
ip natinside source list 1 interface Dialer1 overload
第七步:配置缺省路由
iproute 0.0.0.0 0.0.0.0 Dialer1
配置脚本:
config ter
vpdnenable
vpdn-groupoffice
request-dialin
protocolpppoe
exit
exit
interfacef0/0
noip address
pppoeenable
pppoe-client dial-pool-number 1
exit
interfaceDialer1
ipaddress negotiated
ipnat outside
encapsulationppp
dialerpool 1
dialer-group1
ppppap sent-username xxxxxxx password 0 yyyyyyy
exit
interfacef0/1
ipaddress 10.1.1.1 255.255.255.0
ipnat inside
exit
ipdhcp excluded-address 10.1.1.1
ipdhcp pool ABC
importall
network10.1.1.0 255.255.255.0
default-router10.1.1.1
exit
access-list1 permit 10.1.1.0 0.0.0.255
ipnat inside source list 1 interface Dialer1 overload
exit
configter
iproute 0.0.0.0 0.0.0.0 Dialer1
exit
--------------------------------------------------------------------------------------------------------------------------------------
pppoe-client dial-pool-number 1
exit
interfaceDialer1
ipaddress negotiated
ipnat outside
encapsulationppp
dialerpool 1
dialer-group1
ppppap sent-username xxxxxxx password 0 yyyyyyy
exit
interfacef0/1
ipaddress 10.1.1.1 255.255.255.0
ipnat inside
exit
ipdhcp excluded-address 10.1.1.1
ipdhcp pool ABC
importall
network10.1.1.0 255.255.255.0
default-router10.1.1.1
exit
access-list1 permit 10.1.1.0 0.0.0.255
ipnat inside source list 1 interface Dialer1 overload
exit
configter
iproute 0.0.0.0 0.0.0.0 Dialer1
exit
有兴趣朋友可以了解更多java教程 http://java.itcast.cn/java/video.shtml