Skip to content

南京智网信息 18.pppoe配置, B篇, RouterOS中文教程, 其他文章 》‘其他文章’分类下的全部文章:

18.3 PPPoE Server 设置

操作路径: /interface pppoe-server server

PPPoE server (access concentrator)支持在每一个接口上的多服务,需要设置不同的service 名称,当前PPPoE server

的吞吐量在一个Celeron 600 CPU 测试达到160 Mb/s ,如果使用更高性能的CPU,吞吐量将会程比例的增加。

service-name (文本) – PPPoE 服务名称

mtu (整型; 默认: 1480) – 最大传输单位。最适合的MTU 值(以避免以太网连接的1500-byte,设置为1480 以避免

数据包的重复存储)

mru (整型; default: 1480) – 最大接受单位。最适合的MRU 值(以避免以太网连接的1500-byte,设置为1480 以避

免数据包的重复存储)

mrru (整型: 512..65535; 默认: disabled) – 在连接中能被接收的最大数据包长度。如一个数据包比隧道

的MTU 值大时,将会被分割到多个数据包中,允许实际大小的IP 或以太网的数据包发送到隧道。

authentication (多种选择:mschap2 | mschap1 | chap | pap; 默认: mschap2, mschap1, chap, pap) – 验

证算法

keepalive-timeout – 定义时间周期(秒) 连接开始后路由器每秒钟会发出keepalive 数据包。如果在设定的时间周期内

没有传输和没有keepalive 回应,客户端将会被认为失去连接。

one-session-per-host (yes | no; 默认: no) – 每次只允许一个主机对话连接 (MAC 地址被确定). 如果主机将试着

去建立一个新的对话连接,旧的一个将会被关闭。

default-profile (名称; 默认: default) – 使用默认的策略配置

max-sessions (整形; 默认: 0) – AC 能服务的最大客户端数量

0 – 没有限制

interface (名称) – 客户端连接的网卡接口

注:keepalive-timeout 值通常情况下设置为10。如果你设置为0,路由器将不会断开客户端,直到他们自己注销或

是路由器重启该用户帐号才会断开。解决这个问题,one-session-per-host 属性需启用

安全提示:请不要分配一个IP 地址到PPPoE 的物理网卡上,避免出现用户不通过PPPoE 验证即可上网的情况。

明确的讲MRRU 意思为基于单连接的MP,该协议被为拆分大数据包为更小的。在windows 下在网络属性下,

设置按钮中打开“为单链路连接协商多重链接”MRRU 是强行设置为1614。这个设置有益于超载线路MTU 探

测失败。且MP 协议应在双方都被启用。

zi301

基于 802.11g 无线网络的PPPoE 服务

在无线网络中,服务器可以设置在一个访问节点(Access Point),任意一个RouterOS 客户端或是Windows 客户端都可

以连接到访问节点的PPPoE 认证。无线网卡的MTU 可以设置为1600,因此接口上的MTU 设置为1500,这可以充分利于

1500byte 传输数据包,并避免MTU 比1500 低出现的任何问题。

让我们考虑下面的配置,MikroTik 无线AP 能使无线用户端通过验证后访问到本地的网络:

zi302

首先,需要配置无线网卡:

[admin@PPPoE-Server] interface wireless> set 0 mode=ap-bridge \

frequency=2442 band=2.4ghz-b/g ssid=mt disabled=no

[admin@PPPoE-Server] interface wireless> print

Flags: X - disabled, R - running

0 name="wlan1" mtu=1500 mac-address=00:01:24:70:53:04 arp=enabled

disable-running-check=no interface-type=Atheros AR5211

radio-name="000124705304" mode=station ssid="mt" area=""

frequency-mode=superchannel country=no_country_set antenna-gain=0

frequency=2412 band=2.4ghz-b scan-list=default rate-set=default

supported-rates-b=1Mbps,2Mbps,5.5Mbps,11Mbps

supported-rates-a/g=6Mbps,9Mbps,12Mbps,18Mbps,24Mbps,36Mbps,48Mbps,

54Mbps

basic-rates-b=1Mbps basic-rates-a/g=6Mbps max-station-count=2007

ack-timeout=dynamic tx-power=default tx-power-mode=default

noise-floor-threshold=default periodic-calibration=default

burst-time=disabled fast-frames=no dfs-mode=none antenna-mode=ant-a

wds-mode=disabled wds-default-bridge=none wds-ignore-ssid=no

update-stats-interval=disabled default-authentication=yes

default-forwarding=yes default-ap-tx-limit=0 default-client-tx-limit=0

hide-ssid=no security-profile=default disconnect-timeout=3s

on-fail-retry-time=100ms preamble-mode=both

[admin@PPPoE-Server] interface wireless>

现在,配置以太网卡,添加默认IP 地址和设置默认路由:

[admin@PPPoE-Server] ip address> add address=10.1.0.3/24 interface=Local

[admin@PPPoE-Server] ip address> print

Flags: X - disabled, I - invalid, D - dynamic

# ADDRESS NETWORK BROADCAST INTERFACE

0 10.1.0.3/24 10.1.0.0 10.1.0.255 Local

[admin@PPPoE-Server] ip address> /ip route

[admin@PPPoE-Server] ip route> add gateway=10.1.0.1

[admin@PPPoE-Server] ip route> print

Flags: X - disabled, A - active, D - dynamic,

C - connect, S - static, r - rip, b - bgp, o - ospf

# DST-ADDRESS G GATEWAY DISTANCE INTERFACE

0 ADC 10.1.0.0/24 Local

1 A S 0.0.0.0/0 r 10.1.0.1 1 Local

[admin@PPPoE-Server] ip route> /interface ethernet

[admin@PPPoE-Server] interface ethernet> set Local arp=proxy-arp

[admin@PPPoE-Server] interface ethernet> print

Flags: X - disabled, R - running

# NAME MTU MAC-ADDRESS ARP

0 R Local 1500 00:0C:42:03:25:53 proxy-arp

[admin@PPPoE-Server] interface ethernet>

添加PPPoE server 到无线网卡上:

[admin@PPPoE-Server] interface pppoe-server server> add interface=wlan1 \

service-name=mt one-session-per-host=yes disabled=no

[admin@PPPoE-Server] interface pppoe-server server> print

Flags: X - disabled

0 service-name="mt" interface=wlan1 max-mtu=1480 max-mru=1480

authentication=pap,chap,mschap1,mschap2 keepalive-timeout=10

one-session-per-host=yes max-sessions=0 default-profile=default

[admin@PPPoE-Server] interface pppoe-server server>

最后,设置PPPoE clients:

[admin@PPPoE-Server] ip pool> add name=pppoe ranges=10.1.0.100-10.1.0.200

[admin@PPPoE-Server] ip pool> print

# NAME RANGES

0 pppoe 10.1.0.100-10.1.0.200

[admin@PPPoE-Server] ip pool> /ppp profile

[admin@PPPoE-Server] ppp profile> set default use-encryption=yes \

local-address=10.1.0.3 remote-address=pppoe

[admin@PPPoE-Server] ppp profile> print

Flags: * - default

0 * name="default" local-address=10.1.0.3 remote-address=pppoe

use-compression=no use-vj-compression=no use-encryption=yes only-one=no

change-tcp-mss=yes

1 * name="default-encryption" use-compression=default

use-vj-compression=default use-encryption=yes only-one=default

change-tcp-mss=default

[admin@PPPoE-Server] ppp profile> .. secret

[admin@PPPoE-Server] ppp secret> add name=w password=wkst service=pppoe

[admin@PPPoE-Server] ppp secret> add name=l password=ltp service=pppoe

[admin@PPPoE-Server] ppp secret> print

Flags: X - disabled

# NAME SERVICE CALLER-ID PASSWORD PROFILE REMOTE-ADDRESS

0 w pppoe wkst default 0.0.0.0

1 l pppoe ltp default 0.0.0.0

[admin@PPPoE-Server] ppp secret>

注: 在 Windows XP 中的PPoE 客户端内建加密功能,但RASPPPOE 没有。因此,如果计划不在支持比Windows XP 老

的Windows 客户端,推荐在default 规则配置把require-encryption 值选择位yes。在其他一些应用中,可以服务

设置为接受为加密的数据。

23.0 EoIP隧道介绍

EoIP(Ethernet over IP)隧道是一个建立在两个路由器的IP 传输层之间的以太网隧道协议,是MikroTik RouterOS 的

自由协议。EoIP 接口表现的类似以太网传输,当路由器的桥接功能被启用后,所有的以太网数据流量(所有的以太网协议)

将被桥接就如同在两个路由器(启用了桥接功能)之间有物理交换机接口和光纤收发器一样。

有 EoIP 接口的网络设置:

• 可以在因特网上桥接 LAN

• 可以在加密的隧道桥接 LAN

• 可以在 802.11b 'ad-hoc'无线网络上桥接LAN

快速设置向导

在 IP 地址为10.5.8.1 和10.1.0.1 的两个路由器之间做EoIP 隧道:

1. 在 IP 地址为10.5.8.1 的路由器上添加一个EoIP 接口并设置它的MAC 地址:

/interface eoip add remote-address=10.1.0.1 tunnel-id=1 mac-address=00-00-5E-80-00-01

disabled=no

2. 在 IP 地址为10.1.0.1 的路由器上添加一个EoIP 接口并设置它的MAC 地址:

/interface eoip add remote-address=10.5.8.1 tunnel-id=1 mac-address=00-00-5E-80-00-02

disabled=no

现在你可以从同一子网添加 IP 地址以创建EoIP 接口。

规格

功能包要求: system

等级要求: Level3

操作路径: /interface eoip

EoIP 接口应用在有IP 层连接,EoIP 通道可以在IPIP 隧道,PPTP 128bit 加密隧道,PPPoE 连接或任何传输IP 的连接上

运行。

具体属性:

• 每个上运行隧道接口可以与一个有相同“隧道 ID”的相应接口配置的远程路由器相连接

• EoIP 接口就好象接口列表下的以太网接口一样

• 这个接口支持以太网接口的所有特征。IP 地址及其他隧道可以在这个接口上运行

• EoIP 协议封装以太网帧在GRE(IP 协议号47)数据包中,并把它们发送到EoIP 隧道的远程端

• EoIP 隧道的最大计数为65536

注:WDS 在很大程度上比EoIP 快(最多达可达到10-20%,在RouterBOARD 500 系统上),所以推荐在可能时使用

WDS。

2.8 升级RouterBOARD 固件

RouterBOARD 产品启动BOIS 程序都有更新,对RouterBOARD 系列的启动引导和硬件兼容性进行修正和更新。

RouterBOARD 固件后缀名为.fwf,每个系列的RouterBOARD 所使用的估计都不相同,固件下载地址可以到

www.routerboard.com,如下面的列表:

RB 型号固件前缀

RB1000,RB1100 mpc8548

RB800 mpc8343

www.ai800.com        南京智网信息 网络技术支持 软路由器 服务器 防火墙 上网行为管理 VPN
www.softave.net        Mikrotik  RouterBoard RouterOS  论坛 中文 教程 指南 手册
jebomwung.taobao.com        RouterOS、小区宽带、网吧、交换机路由器 在线技术支持

RB600 mpc8343

RB333 mpc8323

RB400 系列(411/A/AH、433/AH、433AH、450/G、493/AH ) : ar7100

RB700 系列(750、750G) ar7100

RB532 rc32434

RB100 系列(112、133/C、150、192) adm5120

每隔一段时间,RouterBOARD 的固件都会更新一次,所以通过在RouterOS 中操作更新最新的RouterBOARD 固件,升级

固件只能在命令行操作,首先我们需要查看RouterBOARD 当前的固件情况如下图:

[admin@Office] /system> routerboard

[admin@Office] /system routerboard> prin

routerboard: yes

model: "450"

serial-number: "188901ED9E57"

current-firmware: "2.16"

upgrade-firmware: "2.18"

[admin@Office] /system routerboard>

如上面看到的,current-firmware 是当前的固件信息:2.16,而我们最新的估计是2.18 所以我们要通过上传固件到RouterOS

的file 目录中(通过拖放的方式放到winbox 中的file list),当前的RouterBOARD 是RB450,所以这里我们上传的ar7100

的固件文件如下图:

z2801

上传完后,然后我们通过 upgrade 命令升级:

[admin@Office] /system routerboard> upgrade

Do you really want to upgrade firmware? [y/n]

y

firmware upgraded successfully, please reboot for changes to take effect!

[admin@Office] /system routerboard>

按照提示升级固件,升级后要求重启设备,才可以更新。

注意:你也可以通过网络更新固件,要求RouterBOARD 能连接到网络,会自动检测最新的固件,如果有新固件发布,也可

以直接通过upgrade 升级。

www.ai800.com        南京智网信息 网络技术支持 软路由器 服务器 防火墙 上网行为管理 VPN
www.softave.net        Mikrotik  RouterBoard RouterOS  论坛 中文 教程 指南 手册
jebomwung.taobao.com        RouterOS、小区宽带、网吧、交换机路由器 在线技术支持

2.7 升级和降级RouterOS

当你通过BT 下载完RouterOS 软件后如“routeros-ALL-3.30”,里面有多个文件,每个文件对应不同的硬件做升级和降级设置,

具体区分如下:

BT 包里有四个文件名:

all_packages_mipsbe 对应所有Atheros 芯片的RB400 系列产品和700 系列产品

all_packages_mipsle 对应RB100 系列和RB500 系列(RB133、RB133c、RB150、RB192、RB532)MIPS 4Kc 芯片

all_packages_ppc 对应RB300、RB600、RB800 和RB1000 系列(RB333、RB600、RB800、RB1000 和RB1100)

www.ai800.com        南京智网信息 网络技术支持 软路由器 服务器 防火墙 上网行为管理 VPN
www.softave.net        Mikrotik  RouterBoard RouterOS  论坛 中文 教程 指南 手册
jebomwung.taobao.com        RouterOS、小区宽带、网吧、交换机路由器 在线技术支持PowerPC

芯片

all_packages_x86 对应所有x86 构架的PC 设备(AMD、Intel、VIA 和其他x86 PC)

其他文件:

mikrotik-x.x.iso 光盘镜像文件,用于x86 安装

如果是2.9 版本的BT 文件区分如下:

all_packages_ns 对应RB100 系列和RB500 系列(RB133、RB133c、RB150、RB192、RB532)MIPS 4Kc 芯片

all_packages_x86 对应所有x86 构架的PC 设备(AMD、Intel、VIA 和其他x86 PC)

2、根据你使用RouterOS 的情况不同,选择上传的升级包(注:system-x.x.x.npk 的升级包是必须要,否则

无法升级)。如何来确定你使用需要的功能,可以通过在system package>的目录中查询对照。建议根据

自己的需求安装或升级功能包(无线选择wireless、PPPoE 认证选择PPP 等等),过多的安装功能会下降路

由器的性能如下图:

z2701

根据你在system package 中的功能包选择一一对应的功能包进行升级,systemg 功能包是必须安装的。

3、选择好对应的RouterOS 功能包后,通过“FTP://路由器IP 地址”上传功能包,或者直接通过打开Winbox

的Files 目录,通过拖放的方式将升级报上传到RouterOS 根目录下:

z2702

4、功能包上传完成后,通过System Reboot 命令正常重启路由器:

z2703

RouterOS 在重启时,同时也在执行功能包的安装,重启后根据路由器性能不同会花费十几秒到1 分钟的升级时

间,如果是PC 或者通过串口连接的RB 设备可以在显示屏上看到安装进度条。重启完路由器后回看到路由器已

经升级为新的版本。

降级选项

在 system package 中可以看的右上角有一个Downgrade 的命令,这个将高版本降级到低版本的选项(需

要同样将低版本的功能包上传到RouterOS 的FTP 的files 中)。

www.ai800.com        南京智网信息 网络技术支持 软路由器 服务器 防火墙 上网行为管理 VPN
www.softave.net        Mikrotik  RouterBoard RouterOS  论坛 中文 教程 指南 手册
jebomwung.taobao.com        RouterOS、小区宽带、网吧、交换机路由器 在线技术支持

2.6 RouterOS 功能包(Packages)

2.6 RouterOS 功能包(Packages)

www.ai800.com        南京智网信息 网络技术支持 软路由器 服务器 防火墙 上网行为管理 VPN
www.softave.net        Mikrotik  RouterBoard RouterOS  论坛 中文 教程 指南 手册
jebomwung.taobao.com        RouterOS、小区宽带、网吧、交换机路由器 在线技术支持

www.ai800.com        南京智网信息 网络技术支持 软路由器 服务器 防火墙 上网行为管理 VPN
www.softave.net        Mikrotik  RouterBoard RouterOS  论坛 中文 教程 指南 手册
jebomwung.taobao.com        RouterOS、小区宽带、网吧、交换机路由器 在线技术支持

2.5 系统监测Watchdog

Watchdog 监测系统运行情况,当系统软件万一出现错误,将会自动重启。

功能包需求: system

等级需求: Level1

操作路径: /system watchdog

当一个 IP 地址没有响应或者系统被锁死,将发出重启指令。软件计时器是用来提供上一次的记录, 但是在特殊

的情况下(由硬件故障引起的) 它能锁定自己. 对于RouterBOARD 的硬件监测设备来说它能在任何异常情况下

重启。

www.ai800.com        南京智网信息 网络技术支持 软路由器 服务器 防火墙 上网行为管理 VPN
www.softave.net        Mikrotik  RouterBoard RouterOS  论坛 中文 教程 指南 手册
jebomwung.taobao.com        RouterOS、小区宽带、网吧、交换机路由器 在线技术支持

属性描述

auto-send-supout (yes | no; 默认: no) –帮助文件是自动产生它能通过邮件发送

automatic-supout (yes | no; 默认: yes) –当软件错误发生时, 有一个文件"autosupout.rif" 是自动产

生. 这个"autosupout.rif" 文件是对"autosupout.old.rif"的重命名

no-ping-delay (时间; 默认: 5m) – 在重启以后多久去测试和ping watch-address. 默认设置是如果

watch-address 被设置为不可达,这时路由器将在每6 分钟的时候重启.

send-email-from (文本; 默认: "") –邮件地址是发送来自于帮助文件. 如果没有设置,可以通过操作路径

/tool e-mail 开启功能

send-email-to (文本; 默认: "") – 邮件地址是向帮助文件发送

send-smtp-server (文本; 默认: "") – SMTP 服务地址是向通过帮助文件发送. 如果没有设置可以通过操

作路径/tool e-mail 开启功能

watch-address (IP 地址; 默认: none) – 如果设置这功能了的话,万一6 次按照顺序ping 指定ip 地址(没

10 秒发送一次)出现错误,系统会重启

none – 不可用的选项

watchdog-timer (yes | no; 默认: no) – 是否重启取决于在一段时间馁系统无法响应

下面是一个系统崩溃的邮件发送配置,万一系统崩溃,自动产生的supout.rif 帮助文件会自动通过192.0.2.1

发送到support@example.com:

[admin@MikroTik] system watchdog> set auto-send-supout=yes \

\... send-to-email=support@example.com send-smtp-server=192.0.2.1

[admin@MikroTik] system watchdog> print

watch-address: none

watchdog-timer: yes

no-ping-delay: 5m

automatic-supout: yes

auto-send-supout: yes

send-smtp-server: 192.0.2.1

send-email-to: support@example.com

[admin@MikroTik] system watchdog>

RouterOS 多CPU 设置

操作路径:/system hardware

如果你使用的是多CPU,可以通过hardware 功能开关多CPU 的支持,这个功能仅在x86 的系统下配置,也可以根据自己

的运行情况改变多CPU 的支持,通过下面的命令启用多CPU 功能:

[admin@MikroTik] > system hardware

[admin@MikroTik] /system hardware>

.. / : edit export get print set

[admin@MikroTik] /system hardware> set multi-cpu=yes ;

[admin@MikroTik] /system hardware> prin

multi-cpu: yes

[admin@MikroTik] /system hardware>

设置完成后,重启路由即可。

z2501

www.ai800.com        南京智网信息 网络技术支持 软路由器 服务器 防火墙 上网行为管理 VPN
www.softave.net        Mikrotik  RouterBoard RouterOS  论坛 中文 教程 指南 手册
jebomwung.taobao.com        RouterOS、小区宽带、网吧、交换机路由器 在线技术支持

2.4 系统资源管理

操作路径:/system resource

查看系统资源可以了解RouterOS 的运行情况

注:通过monitor 命令显示出CPU 占用率、内存和硬盘等使用情况。

查看基本的系统资源情况:

[admin@MikroTik] system resource> print

uptime: 5h26m12s

www.ai800.com        南京智网信息 网络技术支持 软路由器 服务器 防火墙 上网行为管理 VPN
www.softave.net        Mikrotik  RouterBoard RouterOS  论坛 中文 教程 指南 手册
jebomwung.taobao.com        RouterOS、小区宽带、网吧、交换机路由器 在线技术支持

version: "3.0"

free-memory: 17000kB

total-memory: 30200kB

model: "RouterBOARD 500"

cpu: "MIPS 4Kc V0.10"

cpu-count: 1

cpu-frequency: 333MHz

cpu-load: 3

free-hdd-space: 14208kB

total-hdd-space: 61440kB

write-sect-since-reboot: 1047

write-sect-total: 379983

bad-blocks: 0

[admin@MikroTik] system resource>

连续查看系统CPU 和空闲内存使用情况:

[admin@MikroTik] > system resource monitor

cpu-used: 0

free-memory: 115676

[admin@MikroTik] >

使用winbox 查看:

z2401

RouterOS 5.0 后对多CPU 进行了优化,可以查看每个CPU 的占用情况

z2402

在 tool 里还增加了每个功能的CPU占用情况,进入tool profile 下可以查看RouterOS 各个功能CPU使用情况,和windows

资源管理器类似

z2403

IRQ 使用监测

命令路径: /system resource irq print

显示当前IRQ 使用情况

[admin@MikroTik] > system resource irq print

Flags: U - unused

IRQ OWNER

1 keyboard

2 APIC

U 3

4 serial port

5 [Ricoh Co Ltd RL5c476 II (#2)]

U 6

U 7

U 8

U 9

U 10

11 ether1

12 [Ricoh Co Ltd RL5c476 II]

U 13

14 IDE 1

[admin@MikroTik] >

IO 端口监视

操作路径: /system resource io print

显示当前硬件的IO (Input/Output) 端口使用情况

[admin@MikroTik] > system resource io print

PORT-RANGE OWNER

0x20-0x3F APIC

0x40-0x5F timer

0x60-0x6F keyboard

0x80-0x8F DMA

0xA0-0xBF APIC

0xC0-0xDF DMA

0xF0-0xFF FPU

0x1F0-0x1F7 IDE 1

0x2F8-0x2FF serial port

0x3C0-0x3DF VGA

0x3F6-0x3F6 IDE 1

0x3F8-0x3FF serial port

0xCF8-0xCFF [PCI conf1]

0x4000-0x40FF [PCI CardBus #03]

0x4400-0x44FF [PCI CardBus #03]

0x4800-0x48FF [PCI CardBus #04]

0x4C00-0x4CFF [PCI CardBus #04]

0x5000-0x500F [Intel Corp. 82801BA/BAM SMBus]

0xC000-0xC0FF [Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+]

0xC000-0xC0FF [8139too]

0xC400-0xC407 [Cologne Chip Designs GmbH ISDN network controller [HFC-PCI]

0xC800-0xC87F [Cyclades Corporation PC300/TE (1 port)]

0xF000-0xF00F [Intel Corp. 82801BA IDE U100]

[admin@MikroTik] >

USB 端口信息

操作路径: /system resource usb print

显示所有路由器可用的USB 端口。

device (只读: 文本) – 设备编号

name (只读: 文本) – USB 端口名称

speed (只读: 整型) – 该端口工作的带宽速度

vendor (只读: 文本) – USB 设备销售商名称

显示所有可用USB 端口:

[admin@MikroTik] system resource usb> print

# DEVICE VENDOR NAME SPEED

0 1:1 USB OHCI Root Hub 12 Mbps

[admin@MikroTik] system resource usb>

PCI 信息

操作路径: /system resource pci print

category (只读: 文本) – 设备类型

device (只读: 文本) – 设备编号

device-id (只读: 整型) – 十六进制设备ID

irq (只读: 整型) – 该设备使用的IRQ 编号

memory (只读: 整型) – 该设备使用的内存长度

name (只读: 文本) – 设备名称

vendor (只读: 文本) – 设备销售商名称

vendor-id (只读: 整型) – 设备十六进制销售商

查看 PCI 槽相信情况:

[admin@MikroTik] system resource pci> print

# DEVICE VENDOR NAME IRQ

0 00:13.0 Compaq ZFMicro Chipset USB (rev... 12

1 00:12.5 National Semi SC1100 XBus (rev: 0)

2 00:12.4 National Semi SC1100 Video (rev: 1)

3 00:12.3 National Semi SCx200 Audio (rev: 0)

4 00:12.2 National Semi SCx200 IDE (rev: 1)

5 00:12.1 National Semi SC1100 SMI (rev: 0)

6 00:12.0 National Semi SC1100 Bridge (rev: 0)

7 00:0e.0 Atheros Communications AR5212 (rev: 1) 10

8 00:0d.1 Texas Instruments PCI1250 PC card Cardbus ... 11

9 00:0d.0 Texas Instruments PCI1250 PC card Cardbus ... 11

10 00:0c.0 National Semi DP83815 (MacPhyter) Ethe... 10

11 00:0b.0 National Semi DP83815 (MacPhyter) Ethe... 9

12 00:00.0 Cyrix Corporation PCI Master (rev: 0)

[admin@MikroTik] system resource pci>

www.ai800.com        南京智网信息 网络技术支持 软路由器 服务器 防火墙 上网行为管理 VPN
www.softave.net        Mikrotik  RouterBoard RouterOS  论坛 中文 教程 指南 手册
jebomwung.taobao.com        RouterOS、小区宽带、网吧、交换机路由器 在线技术支持

2.3 RouterOS 身份名

操作路径: /system identity

通过命令可以查看路由系统身份名,这个身份名也会被初始化到DHCP 客户端的“主机名(host name)”或

者Wlan 的SSID 名等,下面是查看路由器身份名:

[admin@MikroTik] > system identity print

name: "MikroTik"

[admin@MikroTik] >

www.ai800.com        南京智网信息 网络技术支持 软路由器 服务器 防火墙 上网行为管理 VPN
www.softave.net        Mikrotik  RouterBoard RouterOS  论坛 中文 教程 指南 手册
jebomwung.taobao.com        RouterOS、小区宽带、网吧、交换机路由器 在线技术支持

设置路由器身份名:

[admin@MikroTik] > system identity set name=Gateway

[admin@Gateway] >

www.ai800.com        南京智网信息 网络技术支持 软路由器 服务器 防火墙 上网行为管理 VPN
www.softave.net        Mikrotik  RouterBoard RouterOS  论坛 中文 教程 指南 手册
jebomwung.taobao.com        RouterOS、小区宽带、网吧、交换机路由器 在线技术支持

How PCC works

How PCC works

This article aims to explain in simple terms how PCC works. The definition from the official manual wiki page reads: "PCC takes selected fields from IP header, and with the help of a hashing algorithm converts selected fields into 32-bit value. This value then is divided by a specified Denominator and the remainder then is compared to a specified Remainder, if equal then packet will be captured. You can choose from src-address, dst-address, src-port, dst-port from the header to use in this operation.", with the full number of fields available being: "both-addresses|both-ports|dst-address-and-port|src-address|src-port|both-addresses-and-ports|dst-address|dst-port|src-address-and-port". If you understand that definition, there'll be nothing interesting in this article for you.

First, here are the terms necessary to understand the definition.

IP packets have a header that contains several fields, two of those fields are the IP address of the source of the packet and the IP address of the destination of the packet. TCP and UDP packets also have headers that contain the source port and the destination port.

Denominators and remainders are parts of modulus operations. A modulus operation produces the integer left over when you divide two numbers and only accept the whole number portion of the result. It is represented by a % sign. Here are some examples: 3 % 3 = 0, because 3 divides cleanly by 3. 4 % 3 = 1, because the next smallest number to 4 that cleanly divides by 3 is 3, and 4 - 3 = 1. 5 % 3 is 2, because the next smallest number to 5 that divides cleanly by 3 is 3, and 5 - 3 = 2. 6 % 3 = 0, because 6 divides cleanly by 3.

A hash is a function that is fed input, and produces output. Hashes have many interesting properties, but the only important one for the purpose of this article is that hash functions are deterministic. That means that when you feed a hash function an input that reads 'hello' and it produces the output '1', you can rely on the fact that if you feed it 'hello' a second time it will produce the output '1' again. When you feed a hash function the same input, it will always produce the same output. What exact hashing algorithm is used by PCC is not important, so for this discussion let's assume that when you feed it IP addresses and ports, it just adds up the octets of the IP addresses as decimal numbers as well as the ports, and then takes the last digit and produces it as the output. Here an example:

The hash function is fed 1.1.1.1 as the source IP address, 10000 as the source TCP port, 2.2.2.2 as the destination IP address and 80 as the destination TCP port. The output will be 1+1+1+1+10000+2+2+2+2+80 = 10092, the last digit of that is 2, so the hash output is 2. It will produce 2 every time it is fed that combination of IP addresses and ports.

At this point it's important to note that even though PCC is most often used for spreading load across circuits, PCC itself has absolutely nothing to do with routing, routing marks or spreading load. PCC is simply a way to match packets, and not directly related to the action of then marking those matched packets even if that is its main purpose.

Here are three lines often used for PCC, with their explanation:

/ip firewall mangle add chain=prerouting action=mark-connection \
 new-connection-mark=1st_conn per-connection-classifier=src-address-and-port:3/0
/ip firewall mangle add chain=prerouting action=mark-connection \
  new-connection-mark=2nd_conn per-connection-classifier=src-address-and-port:3/1
/ip firewall mangle add chain=prerouting action=mark-connection \
  new-connection-mark=3rd_conn per-connection-classifier=src-address-and-port:3/2

The first line means "produce the output of the hash function given the packet's source IP address and port, divide it by 3 and if the remainder is 0, perform the action of marking the connection as 1st_conn". The second line means "produce the output of the hash function given the packet's source IP address and port, divide it by 3 and if the remainder is 1, perform the action of marking the connection as 2nd_conn". And correspondingly the third line means "produce the output of the hash function given the packet's source IP address and port, divide it by 3 and if the remainder is 2, perform the action of marking the connection as 3rd_conn".

Here are what the different field options mean for the purpose of packet matching, these are the fields that will be fed into the hashing algorithm (and, for the purpose of spreading load across links, decide what link a packet will be put on). Remember that a hash function will always produce the same input when it's fed the same output:

  • src-address: The source address of a client will always be the same, so all traffic from a particular client will always match the same PCC matcher, and will always be put on the same link.
  • dst-address: The destination address of a specific server will always be the same, so all traffic to that server (say, the Mikrotik Wiki) will always match the same PCC matcher, and will always be put on the same link.
  • both-addresses: The source and destination IP pair between the same client and server will always be the same, so all traffic between one specific client and a specific server (say, your laptop and the Mikrotik Wiki) will always match the same PCC matcher, and will always be put on the same link.
  • src-port: Source ports of clients are usually randomly chosen when the connection is created, so across many connections different source ports will be fed into the hash function, and different PCC matchers will match and traffic will go across different links. However, some client protocols always choose the same source port, and servers behind your router will mostly likely always use the same service port to send traffic back to their clients. A web server behind your router would send most traffic from its HTTP (80) and HTTPS (443) ports, and that traffic would always match the same PCC matcher and would be put on the same link.
  • dst-port: Destination ports of clients are usually well defined service ports, all HTTP (80) traffic between your clients and servers on the Internet would always match the same PCC matcher, and would be put on the same link. However, the same clients doing HTTPS (443) traffic could match a different PCC matcher, and would go across a different link.
  • both-ports: Since the client port is (usually) randomly chosen, the combination of the two ports is (usually) random and will spread load across links.
  • src-address-and-port: Same caveat as src-port.
  • dst-address-and-port: Same caveat as dst-port.
  • both-addresses-and-ports: This is the most random way to spread traffic across links, since it has the most number of variables.

It's important to note that even though the hash function discussed in this article is greatly simplified and not what is used in real life, it nicely demonstrates another property of hash functions: two completely different inputs can produce the same output. In our example, 3 % 3 = 0, and 6 % 3 = 0; we get back 0 when we feed it a 3 as well as when we feed it a 6. The same is true for the actual function used for PCC, even though I don't know what it is we do know from the definition that it produces a 32 bit value as output. IP addresses are 32 bit, and ports are 16 bit, so assuming that we're using both-addresses-and-ports, we'd be feeding it 32+32+16+16 = 96 bits of input and would only receive 32 bits back, so it must be producing the same output for different inputs. This means that two completely unrelated connections could match the same PCC matcher, and would be put on the same line. PCC works better the more connections you put across it so that the hash function has more chances to produce different outputs.

I am not entirely sure how both-addresses-and-ports would behave when it comes across a packet that doesn't have the concept of ports, such as GRE or ESP. I would think it would classify just based on both-addresses in that case, but I don't know for sure. If someone does know, please edit the article.

用户导航

〈本页待美工,每次拨号时弹出〉

公告

修改密码


修改资料


查看记录


查看余额

内部电影(拨号后可访问)

论坛(拨号后可访问)

留言本(拨号可访问)


充值

请登录网络

您还没有登录网络,请下载登录器进行登录,如果已经下载登录器,请直接运行登录器进行登录。

账户申请:18915979529

账户续费:18915979529

网络故障:025-52237163

您的账户即将到期,请及时续费。

您的账户即将到期,请及时续费。

账户申请:18915979529

账户续费:18915979529

网络故障:025-52237163

请安装桌面管理系统客户端,然后即可访问网络!

"桌面管理系统客户端"安装步骤:
1.查看电脑桌面右下脚托盘处,退出所有可以退出的程序(如杀毒软件、安全卫士、视频播放器、QQ等等)。
2.点击下面按钮,下载并安装"桌面管理系统客户端"。

提示:如果点击按钮没有反应,请右键点击按钮,然后点击"目标另存为"进行下载,然后安装。

提示:安装过程不可见,大约2分钟时间,等你可以访问网络即证明安装完毕。

南京VPN

阅读这篇文章Read more

南京上网行为管理

阅读这篇文章Read more

南京VPN

阅读这篇文章Read more

南京上网行为管理系统

阅读这篇文章Read more

文章测试

  阅读这篇文章Read more