找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 29245|回复: 27

[其它] 点对点协议 (Point to Point Protocol over Ethernet)

[复制链接]
发表于 2005-9-11 22:32:27 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
点对点协议 (Point to Point Protocol over Ethernet)
概要:
PPPoE 基于以太网的点对点协议 (Point to Point Protocol over Ethernet) 当前的 PPPOE 主要被 ISP 商用于 xDSL 和 cable modems 与用户端的连接,他们几乎与以太网一样。 PPPoE 是一种标准的点对点协议 (PPP) 他们之间只是传输上的差异: PPPoE 使用 modem 连接来代替普通的以太网。一般来说 , PPPoE 是基于与用户认证和通过分发 IP 地址给客户端。
  MikroTik routeros 能做一个的 radius 客户端 ? 你能使用一台 RADIUS 服务器去验证 PPPoE 的客户端和对他们计费
  一个 PPPoE 连接由客户端和一个访问集线服务器组成,客户端可以是一个安装了 PPPoE 协议的 windows 电脑。 PPPoE 客户端和服务器能工作在任何以太网等级的路由器接口( interface ) - wireless 802.11 (Aironet, Cisco, WaveLan, Prism, Atheros), 10/100/1000 Mbit/s Ethernet, RadioLan and EoIP (Ethernet over IP tunnel). No encryption, MPPE 40bit RSA and MPPE 128bit RSA encryption 都支持 .
快速设置向导
配置 MikroTik RouterOS PPPoE 客户端
1.        仅添加一个 pppoe-client:
/interface pppoe-client add name=pppoe-user-mike user=mike password=123 interface=wlan1 service-name=internet disabled=no
配置 MikroTik RouteROS 去访问集线服务器 (PPPoE Server)
   2.为客户端添加一个地址池从 10.1.1 .62 to 10.1.1.72 并命名为“ pppoe-pool ” :
/ip pool add name="pppoe-pool" ranges= 10.1.1 .62-10.1.1.72
3添加 PPP 策略 , 命名为 pppoe-profile , local-address 将是访问本地路由器的地址,客户端的地址来至 pppoe-pool :
/ppp profile add name="pppoe-profile" local-address= 10.1.1 .1 remote-address=pppoe-pool
4. 添加用户名 mike 和密码 Add 123 :
/ppp secret add name=mike password=123 service=pppoe profile=pppoe-profile
5. 现在添加 pppoe 服务器设置:
/interface pppoe-server server add service-name=internet interface=wlan1 default-profile=pppoe-profile


规格
需要功能包 : ppp
需要等级 : Level1 (limited to 1 interface) , Level3 (limited to 200 interfaces) , Level4 (limited to 200 interfaces) , Level5 (limited to 500 interfaces) , Level6 (unlimited)
操作路径 : /interface pppoe-server , /interface pppoe-client
协议标准和技术: PPPoE (RFC 2516)
硬件要求 : PPPoE 服务器的需要增加 RAM ( 每一个连接大概需要 50kB) 和 CPU 频率,最大支持 10000 个连接。
PPPoE 客户端设置
操作路径 : /interface pppoe-client
属性描述
name ( 名称 ; 默认 : pppoe-out1 ) ?PPPoE 的接口名称
interface ( 名称 ) ? 选择 PPPoE 服务器的接口使连接通过
mtu ( 整型 ; 默认 : 1480 ) ? 最大传输单位 . 。最适合的 MTU 值(以避免以太网连接的 1500-byte ,设置为 1480 以避免数据包的重复存储)
mru ( 整型 ; 默认 : 1480 ) ? 最大接收单位。最适合的 MRU 值(以避免以太网连接的 1500-byte ,设置为 1480 以避免数据包的重复存储)
user ( 文本 ; 默认 : "" ) ? 连接在 PPPoE 服务器的用户帐号。
password ( 文本 ; 默认 : "" ) ? 连接 PPPoE 服务器的用户密码
profile ( 名称 ) ? 连接的默认策略
allow ( multiple choice: mschap2, mschap1, chap, pap; default: mschap2, mschap1, chap, pap ) ? 客户端使用的验证协议
service-name ( 文本 ; 默认 : "" ) ? 在访问集线器上设定指定服务名( AC )
ac-name ( 文本 ; 默认 : "" ) ? 这条可以为空白,当客户端与任何一个访问集线器相连,会选取该服务名。
add-default-route (yes | no; 默认 : no ) ? 是否添加动态默认路由。
dial-on-demand (yes | no; 默认 : no ) ? 当连接唯一的 AC 时,传输数据产生,在断开连接,没有传输数据时, idle-timeout 将被设置。
use-peer-dns (yes | no; 默认 : no ) ? 是否使用路由器的默认 DNS 给 ppp 的 DNS

如果存在一条默认的 pppoe 的路由, add-default-route 将不会创建一个新的路由
事例 Example
在 gig 接口上添加和启用客户端客户端,连接 AC 提供的 testSN 服务名,使用的用户帐号 john 和密码 password :
[admin@RemoteOffice] interface pppoe-client> add interface=gig \
\... service-name=testSN user=john password=password disabled=no
[admin@RemoteOffice] interface pppoe-client> print
Flags: X - disabled, R - running
0 R name="pppoe-out1" mtu=1480 mru=1480 interface=gig user="john"
password="password" profile=default service-name="testSN" ac-name=""
add-default-route=no dial-on-demand=no use-peer-dns=no
监视 PPPoE 客户端
命令名称 : /interface pppoe-client monitor
属性描述
status ( 文本 ) ? 客户端的状态
Dialing ? 拨号连接的情况
Verifying password... ? 确认连接到服务器,密码正在核对处理
Terminated ? 接口没有启用,或是另一端未建立连接
encoding ( 文本 ) ? 在该条连接中使用加密和编码。
uptime ( 时间 ) ? 连接时间显示为天、时、分、秒
service-name ( 文本 ) ? 客户端连接的服务器名称
ac-name ( 文本 ) ? 客户端已经连接到的 AC 名称
ac-mac ( MAC 地址 ) ? 客户端已经连接的访问集线器( AC ) MAC 地址。
事例
监视 pppoe-out1 连接情况:
[admin@MikroTik] interface pppoe-client> monitor pppoe-out1          
status:        "connected"        
uptime:        10s        
encoding:        "none"        
service-name:        "testSN"        
ac-name:        " 10.0.0 .1"        
ac-mac:        00:C0F:07:5E:E6       
[admin@MikroTik] interface pppoe-client>        
PPPoE 服务器设置 (Access Concentrator)
操作路径 : /interface pppoe-server server
属性
PPPoE 服务器 (access concentrator) 在每一个接口上支持不同的服务名,即每个接口支持一个 PPPoE 服务点。现在的 pppoe 服务器使用 Celeron 600 CPU 经过测试后,吞吐量达到 160M /s ,在使用更高速度的 CPU ,吞吐量会根据比例递增。
access concentrator name 和 PPPoE 服务名( service-name ) 作为客户端登陆 AC 的身份验证 are used by clients to identity the access concentrator to register with. access concentrator name 同路由器的 is the same as the identity of the router displayed before the command prompt. Identity 在设置 may be set within the /system identity submenu.
PPPoE users are created in /ppp secret menu, see the AAA manual for further information.
Note that if no service name is specified in WindowsXP, it will use only service with no name. So if you want to serve WindowsXP clients, leave your service name empty.
属性描述
service-name ( 文本 ) ? PPPoE 服务名称
mtu ( 整型 ; 默认 : 1480 ) ? 最大传输单位。最适合的 MTU 值(以避免以太网连接的 1500-byte ,设置为 1480 以避免数据包的重复存储)
mru ( integer ; default: 1480 ) ? 最大接受单位。最适合的 MRU 值(以避免以太网连接的 1500-byte ,设置为 1480 以避免数据包的重复存储)
authentication ( 多种选择: mschap2 | mschap1 | chap | pap; 默认 : mschap2, mschap1, chap, pap ) ? 验证的算法
keepalive-timeout ? 定义 defines the time period (in seconds) after which the router is starting to send keepalive packets every second. If no traffic and no keepalive responses has came for that period of time (i.e. 2 * keepalive-timeout), not responding client is proclaimed disconnected.
one-session-per-host (yes | no; 默认 : no ) ? 每次只允许一个主机对话连接 (MAC 地址被确定 ). 如果主机将试着去建立一个新的对话连接,旧的一个将会被关闭。
default-profile ( name ; 默认 : default ) ? 使用默认的策略配置
Notes
The default keepalive-timeout value of 10 is OK in most cases. 如果你设置为 0 ,路由器直到客户登出或重新启动都不会断开客户端。 If you set it to 0 , the router will not disconnect clients until they log out or router is restarted. To resolve this problem, the one-session-per-host property can be used.
Security issue : do not assign an IP address to the interface you will be receiving the PPPoE requests on.
Example
将 PPPoE 服务器添加到 ether1 interface 上,并提供 ex 服务名,每次仅允许一个主机连接 :
[admin@MikroTik] interface pppoe-server server> add interface=ether1 \
\... service-name=ex one-session-per-host=yes
[admin@MikroTik] interface pppoe-server server> print
Flags: X - disabled
0 X service-name="ex" interface=ether1 mtu=1480 mru=1480
authentication=mschap2,mschap,chap,pap keepalive-timeout=10
one-session-per-host=yes default-profile=default
[admin@MikroTik] interface pppoe-server server>
PPPoE 服务器用户
操作路径 : /interface pppoe-server
属性描述
name ( 名称 ) ? 接口名称
service-name ( 名称 ) ? 用户连接的服务名
remote-address ( MAC 地址 ) ? 已连接客户端的 MAC 地址
user ( 名称 ) ? 已连接的用户名
encoding ( 文本 ) ? 该连接使用加密和编码
uptime ? 显示客户端已连接了多长时间
事例
查看当前连接的用户:
[admin@MikroTik] interface pppoe-server> print
Flags: R - running
# NAME SERVICE REMOTE-ADDRESS USER ENCO... UPTIME
0 R  ex 00:C0:CA:16:16:A5 ex 12s
[admin@MikroTik] interface pppoe-server>
断掉用户名为 ex 的连接 :
[admin@MikroTik] interface pppoe-server> remove [find user=ex]
[admin@MikroTik] interface pppoe-server> print
[admin@MikroTik] interface pppoe-server>
故障分析
        我能够连接到服务器, Ping 也能完全通过,但我仍然不能打开 web 页面?
确定你在路由器上指定了正确的 DNS 服务器(在 /ip dns 或在 /ppp profile 中的 dns-server 参数 )
        The PPPoE server shows more than one active user entry for one client, when the clients disconnect, they are still shown and active
Set the keepalive-timeout parameter (in the PPPoE server configuration) to 10 if You want clients to be considered logged off if they do not respond for 10 seconds.
Note that if the keepalive-timeout parameter is set to 0 and the only-one parameter (in PPP profile settings) is set to yes then the clients might be able to connect only once. To resolve this problem one-session-per-host parameter in PPPoE server configuration should be set to yes
        我能使 PPPoE 连接小点的数据包 ( 例如 pings)
你需要改变所以经过 PPPoE 连接的 mss 数据包为 1440 :
[admin@MT] interface pppoe-server server> set 0 max-mtu=1440 max-mru=1440
[admin@MT] interface pppoe-server server> print
Flags: X - disabled
0 service-name="mt" interface=wlan1 max-mtu=1440 max-mru=1440
authentication=pap,chap,mschap1,mschap2 keepalive-timeout=10
one-session-per-host=yes max-sessions=0 default-profile=default
[admin@MT] interface pppoe-server server>
        我的 windows PPPoE 客户端得到了来至 MikroTik PPPoE server 的 IP 地址和默认网关,但不能出 PPPoE server 并且不能连接外部网络 .
PPPoE 服务器没有与客户端连接, 为 PPPoE 客户端的地址配置伪装( masquerading )或是确定你为客户端分配的地址段指定了正确的路由 , 或是你在以太网卡上启用了 Proxy-ARP ( 请看 IP 地址和地址解析协议 Address Resolution Protocol (ARP) )
        我的 Windows XP 不能连接到 PPPoE 服务器
你要在 XP 的 pppoe 客户端属性中指明 "Service Name" 。或是没有在 MikroTik PPPoE 服务器配置服务名( service name ),这样你会得到“ line is busy ”错误或是系统显示 "verifying password - unknown error"
        我想要记录连接建立的日志
在 /system logging facility 中配置日志信息并启用 ppp 日志类型

应用事例
在多点的 wireless 802.11 网络中的 PPPoE 应用
在无线网络中,服务器可以设置在一个访问节点( Access Point ) , 任意一个 RouterOS 客户端或是 Windows 客户端都可以连接到访问节点的 PPPoE 认证。无线网卡的 MTU 可以设置为 1600 ,因此接口上的 MTU 设置为 1500 ,这可以充分利于 1500byte 传输数据包,并避免 MTU 比 1500 低出现的任何问题。
让我们考虑下面的配置, MikroTik 无线 AP 能使无线用户端通过验证后访问到本地的网络 :

首先, Prism 网卡应配置为:
[admin@MT_Prism_AP] interface prism> set 0 mode=ap-bridge frequency=2442MHz \
\... ssid=mt disabled=no
[admin@MT_Prism_AP] interface prism> print
Flags: X - disabled, R - running
0 R name="prism1" mtu=1500 mac-address=00:90:4B:02:17:E2 arp=enabled
mode=ap-bridge root-ap=00:00:00:00:00:00 frequency=2442MHz ssid="mt"
default-authentication=yes default-forwarding=yes max-clients=2007
card-type=generic tx-power=auto supported-rates=1-11 basic-rates=1
hide-ssid=no
[admin@MT_Prism_AP] interface prism> /ip address
现在,以太网卡和 IP 地址设置如下:
[admin@MT_Prism_AP] ip address> add address= 10.0.0 .217/24 interface=Local
[admin@MT_Prism_AP] ip address> print
Flags: X - disabled, I - invalid, D - dynamic
# ADDRESS NETWORK BROADCAST INTERFACE
0 10.0.0 .217/24 10.0.0 .0 10.0.0 .255 Local
  
[admin@MT_Prism_AP] ip address> /ip route
[admin@MT_Prism_AP] ip route> add gateway= 10.0.0 .1
[admin@MT_Prism_AP] ip route> print
Flags: X - disabled, I - invalid, D - dynamic, J - rejected,
C - connect, S - static, R - rip, O - ospf, B - bgp
# DST-ADDRESS G GATEWAY DISTANCE INTERFACE
0 S 0.0.0 .0/0 r 10.0.0.1 1 Local
1 DC 10.0.0 .0/24 r 0.0.0.0 0 Local
  
[admin@MT_Prism_AP] ip route> /interface ethernet
[admin@MT_Prism_AP] interface ethernet> set Local arp=proxy-arp
[admin@MT_Prism_AP] interface ethernet> print
Flags: X - disabled, R - running
# NAME MTU MAC-ADDRESS ARP
0 R Local 1500 00:50:08:00:00:F5 proxy-arp
[admin@MT_Prism_AP] interface ethernet>
将 PPPoE 服务添加到 Prism 网卡上:
[admin@MT_Prism_AP] interface pppoe-server server> add interface=prism1 \
\... service-name=mt one-session-per-host=yes disabled=no
[admin@MT_Prism_AP] interface pppoe-server server> print
Flags: X - disabled
0 service-name="mt" interface=prism1 mtu=1480 mru=1480
authentication=mschap2,mschap,chap,pap keepalive-timeout=10
one-session-per-host=yes default-profile=default
[admin@MT_Prism_AP] interface pppoe-server server>
数据包经过 PPPoE 连接后 MSS 将被改变:
[admin@MT_Prism_AP] ip firewall mangle> add protocol=tcp tcp-options=syn-only \
\.. action=passthrough tcp-mss=1440
[admin@MT_Prism_AP] ip firewall mangle> print
Flags: X - disabled, I - invalid
0 src-address= 0.0.0 .0/0:0 -65535 in -interface=all
dst-address= 0.0.0 .0/0:0-65535 protocol=tcp tcp-options=syn-only
icmp-options=any:any flow="" src-mac-address=00:00:00:00:00:00
limit-count=0 limit-burst=0 limit-time=0s action=passthrough
mark-flow="" tcp-mss=1440
[admin@MT_Prism_AP] ip firewall mangle>
最后,我将 PPPoE 客户端设置上:


[admin@MT_Prism_AP] ip pool> add name=pppoe ranges= 10.0.0 .230-10.0.0.240
[admin@MT_Prism_AP] ip pool> print
# NAME RANGES
0 pppoe 10.0.0 .230-10.0.0.240
[admin@MT_Prism_AP] ip pool> /ppp profile
[admin@MT_Prism_AP] ppp profile> set default use-encryption=yes \
\... local-address= 10.0.0 .217 remote-address=pppoe
[admin@MT_Prism_AP] ppp profile> print
Flags: * - default
0 * name="default" local-address= 10.0.0 .217 remote-address=pppoe
session-timeout=0s idle-timeout=0s use-compression=no
use-vj-compression=no use-encryption=yes require-encryption=no
only-one=no tx-bit-rate=0 rx-bit-rate=0 incoming-filter=""
outgoing-filter=""
[admin@MT_Prism_AP] ppp profile> .. secret
[admin@MT_Prism_AP] ppp secret> add name=w password=wkst service=pppoe
[admin@MT_Prism_AP] ppp secret> add name=l password=ltp service=pppoe
[admin@MT_Prism_AP] ppp secret> print
Flags: X - disabled
# NAME SERVICE CALLER-ID PASSWORD PROFILE
0 w pppoe wkst default
1 l pppoe ltp default
[admin@MT_Prism_AP] ppp secret>
因此我们完成了配置并添加了两个用户: W 和 I 他们通过 PPPoE 客户端软件连接到 PPPoE 服务器上
注: Note that Windows XP 内置加密支持,但 RASPPPOE 不支持 . 因此,比 Windows XP 早的 Windows 不支持此功能 , 推存在默认 profile 中 require-encryption 选择为 yes 在其它情况下,服务器将不接受为加密的客户端数据 .
routeros
发表于 2005-9-13 22:22:30 | 显示全部楼层
老大,你太强了,佩服,我要是打这么多字,我都晕死了!
routeros
回复

使用道具 举报

发表于 2005-9-13 22:44:47 | 显示全部楼层
routeros
回复

使用道具 举报

发表于 2005-9-26 19:10:00 | 显示全部楼层
那个笑呵呵的是怎么回事
routeros
回复

使用道具 举报

发表于 2005-10-10 23:48:44 | 显示全部楼层
什么东西都照搬照抄
routeros
回复

使用道具 举报

发表于 2005-10-21 17:35:21 | 显示全部楼层
*  3添加 PPP 策略 , 命名为 pppoe-profile , local-address 将是访问本地路由器的地址,客户端的地址来至 pppoe-pool :
可否设置为客户端的地址来自于一个外部的DHCP服务器.
routeros
回复

使用道具 举报

发表于 2005-10-21 17:36:01 | 显示全部楼层
*  3添加 PPP 策略 , 命名为 pppoe-profile , local-address 将是访问本地路由器的地址,客户端的地址来至 pppoe-pool :
可否设置为客户端的地址来自于一个外部的DHCP服务器.
routeros
回复

使用道具 举报

发表于 2005-11-2 09:51:37 | 显示全部楼层
楼主辛苦了。
routeros
回复

使用道具 举报

发表于 2005-11-5 18:53:29 | 显示全部楼层
我顶
routeros
回复

使用道具 举报

发表于 2005-11-6 19:30:18 | 显示全部楼层
抄来的,你这位同志到了成都网大公司了
routeros
回复

使用道具 举报

发表于 2005-11-6 20:51:25 | 显示全部楼层

回复 #1 hzkane 的帖子

学习中
routeros
回复

使用道具 举报

发表于 2005-12-12 13:19:30 | 显示全部楼层
看的云里雾里,....
晕虎虎
routeros
回复

使用道具 举报

发表于 2005-12-27 01:16:11 | 显示全部楼层
基础知识,不错。
routeros
回复

使用道具 举报

发表于 2005-12-27 15:35:24 | 显示全部楼层
顶。。。。。。。。。。
routeros
回复

使用道具 举报

发表于 2006-1-12 21:24:57 | 显示全部楼层
云里雾里
routeros
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|软路由 ( 渝ICP备15001194号-1|渝公网安备 50011602500124号 )

GMT+8, 2024-4-29 15:56 , Processed in 0.185911 second(s), 6 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表