路由调试工

路由状态

/routing/stats/origin

/routing/stats/process

此菜单允许监控所有路由进程的调试信息。

[admin@rack1_b35_CCR1036] /routing/stats/process> print interval=1
Columns: TASKS, PRIVATE-MEM-BLOCKS, SHARED-MEM-BLOCKS, PSS, RSS, VMS, RETIRED, ID, PID, RPID, PROCESS-TIME, KERNEL-TIME, CUR-BUSY, MAX-BUSY, CUR-CALC, MAX-CALC
 # TASKS                         PRIVATE-  SHARED-ME  PSS        RSS     VMS      RETIRED  ID       PID  RPID  PROCESS  KERNEL-TIME  CUR-BUSY  MAX-BUSY  CUR-CALC  MAX-CALC
 0 routing tables                768.0KiB  1792.0KiB  2399.0KiB  6.4MiB  22.1MiB       34  main     317     0  2s260ms  1s940ms      10ms      170ms     20ms      1s210ms
   rib
 1 fib                           0         0          2263.0KiB  6.2MiB  22.3MiB           fib      351     1  250ms    1s720ms                1s210ms             1s210ms
 2 ospf                          256.0KiB  256.0KiB   2559.0KiB  6.6MiB  22.3MiB           ospf     384     1  4s710ms  5s210ms                20ms                20ms
 3 pimsm                         256.0KiB  0          2252.0KiB  5.8MiB  22.3MiB           pim      386     1  200ms    450ms                  10ms                10ms
 4 fantasy                       0         0          2031.0KiB  5.1MiB  22.3MiB           fantasy  388     1  270ms    390ms                  10ms                10ms
 5 configuration and reporting   0         512.0KiB   2351.0KiB  6.4MiB  22.3MiB           static   389     1  310ms    430ms                  10ms                10ms
 6 ldp                           256.0KiB  256.0KiB   2455.0KiB  6.4MiB  22.3MiB           mpls     387     1  340ms    350ms                  40ms                40ms
   Copy
 7 rip                           256.0KiB  0          2230.0KiB  5.7MiB  22.3MiB           rip      377     1  230ms    380ms                  10ms                10ms
 8 routing policy configuration  512.0KiB  512.0KiB   2355.0KiB  5.6MiB  22.3MiB           policy   358     1  240ms    390ms                  10ms                10ms
 9 BGP service                   512.0KiB  0          2592.0KiB  6.3MiB  22.3MiB           bgp      364     1  360ms    600ms                  10ms                10ms
10 BFD service                   256.0KiB  0          2206.0KiB  5.7MiB  22.3MiB           12       371     1  230ms    370ms                  10ms                10ms
11 BGP Input 111.11.0.1          512.0KiB  512.0KiB   2560.0KiB  6.4MiB  22.3MiB        1  22       679     1  140ms    350ms                  10ms                10ms
   BGP Output 111.11.0.1
12 Global memory                           256.0KiB                                        global     0     0

/routing/stats/step

/routing/fantasy

Fantasy菜单是一种为测试目的生成大量路线的奇特方式。与脚本相比,这种方法的主要优点是生成速度和简单性。只需禁用Fantasy规则,就可以很容易地删除所有Fantasy生成的路由。

Fantasy使用随机生成器从哈希路由序列号,种子和其他参数。

配置选项

属性 说明
comment (string)
count (integer:[0..4294967295]) 生成多少条路由。
dealer-id (start-[end]:: integer:[0..4294967295])
disabled (yes| no) ID reference is not used.
dst-address(Prefix) 生成路由的前缀。
gateway (string)
instance-id (start-[end]:: integer:[0..4294967295])
name (string) 引用名称
offset (integer:[0..4294967295]) 路由序号偏移量
prefix-length (start-[end]:: integer:[0..4294967295] ) 生成路由的前缀长度(可指定为整数范围)。例如,dst-address 192.168.0.0/16和prefix-length 24将从192.168.0.0/16子网生成/24路由。
priv-offset (start-[end]:: integer: [0..4294967295])
priv-size (start-[end]:: integer: [0..100000])
scope (start-[end]:: integer: [0..255]) 范围可设定,可设定为一个范围
seed (string) 随机发生器种子
target-scope (start-[end]:: integer: [0..255]) 目标范围可设定,可设定为范围
use-hold (yes| no)

一个只读表,列出了所有地址族的路由,以及所有可能的路由属性的过滤路由。

表中各种路由类型的默认输出示例:

[admin@MikroTik] /routing/route> print
Flags: A - ACTIVE; c, s, a, l, y - COPY; H - HW-OFFLOADED
Columns: DST-ADDRESS, GATEWAY, AFI, DISTANCE, SCOPE, TARGET-SCOPE, IMMEDIATE-GW
    DST-ADDRESS                 GATEWAY           AFI   D  SCOPE  TA  IMMEDIATE-GW
 lH 10.0.0.0/8                                    ip4   0
;;; defconf
As  10.0.0.0/8                  10.155.130.1      ip4   1     30  10  10.155.130.1%ether1
 lH 10.155.130.0/25                               ip4   0
Ac  10.155.130.0/25             ether1            ip4   0     10      ether1
 aH 10.155.130.12/32                              ip4   0
 lH 111.13.0.0/24                                 ip4   0
Ac  111.13.0.0/24               ether2            ip4   0     10      ether2
 aH 111.13.0.1/32                                 ip4   0
Ac  111.111.111.2/32            loopback@vrfTest  ip4   0     10      loopback
Ac  2111:4::/64                 ether2            ip6   0     10      ether2
Ac  fe80::%ether1/64            ether1            ip6   0     10      ether1
Ac  fe80::%ether2/64            ether2            ip6   0     10      ether2
Ac  fe80::%ether3/64            ether3            ip6   0     10      ether3
Ac  fe80::%ether4/64            ether4            ip6   0     10      ether4
Ac  3333::2/128                 loopback@vrfTest  ip6   0     10      loopback
Ac  fe80::%loopback/64          loopback@vrfTest  ip6   0     10      loopback
Ay  111.111.111.2/32&65530:100  loopback@vrfTest  vpn4  0     10   5  loopback
Ay  3333::2/128&65530:100       loopback@vrfTest  vpn6  0     10   5  loopback
A H ether1                                        link  0
A H ether2                                        link  0
A H ether3                                        link  0
A H ether4                                        link  0
A H loopback                                      link  0

一些BGP、OSPF和其他路由的详细示例输出:

[admin@MikroTik] /routing/route> print detail
Flags: X - disabled, F - filtered, U - unreachable, A - active;
c - connect, s - static, r - rip, b - bgp, o - ospf, d - dhcp, v - vpn, m - modem, a - ldp-address, l - ldp-mapping, y - copy; H - hw-offloaded;
+ - ecmp, B - blackhole
  o   afi=ip4 contribution=best-candidate dst-address=0.0.0.0/0 routing-table=main gateway=10.155.101.1%ether1 immediate-gw=10.155.101.1%ether1
       distance=110 scope=20 target-scope=10 belongs-to="OSPF route"
       ospf.metric=2 .tag=111 .type=ext-type-1
       debug.fwp-ptr=0x203425A0

 Ad + afi=ip4 contribution=active dst-address=0.0.0.0/0 routing-table=main pref-src="" gateway=10.155.101.1 immediate-gw=10.155.101.1%ether1
       distance=1 scope=30 target-scope=10 vrf-interface=ether1 belongs-to="DHCP route"
       debug.fwp-ptr=0x20342060

 As + afi=ip4 contribution=active dst-address=0.0.0.0/0 routing-table=main pref-src="" gateway=10.155.101.1 immediate-gw=10.155.101.1%ether1
       distance=1 scope=30 target-scope=10 belongs-to="Static route"
       debug.fwp-ptr=0x20342060

 Fb   afi=ip4 contribution=filtered dst-address=1.0.0.0/24 routing-table=main gateway=10.155.101.1 immediate-gw=10.155.101.1%ether1 distance=20
       scope=40 target-scope=10 belongs-to="BGP IP routes from 10.155.101.217" rpki=valid
       bgp.peer-cache-id=*B000002 .aggregator="13335:172.68.180.1" .as-path="65530,100,9002,13335" .atomic-aggregate=yes .origin=igp
       debug.fwp-ptr=0x20342960

属性

说明

active (yes | no)

标志表示该路由是否被选为Active,有资格加入FIB

afi (ip4 | ip6 | link)

此路由所属的地址族。

belongs-to (string)

显示从何处接收路由的描述性信息。

bgp (yes | no)

标志表示该路由是否是BGP协议添加的。

bgp - BGP 协议相关的一组参数

    

.as-path(string)

AS_PATH BGP 属性的值

 

.aggregator (string)

 

 

.atomic-aggregate (yes | no)

 

 

.cluster-list (string)

 

 

.communities (string)

设置COMMUNITIES BGP属性的值

 

.ext-communities (string)

EXTENDED_COMMUNITIES BGP属性的值

 

.igp-metric(string)

IGP_METRIC BGP属性的值

 

.large-communities (string)

LARGE_COMMUNITIES BGP属性的值

 

.local-pref (string)

LOCAL_PREF BGP属性的值

 

.med (string)

MED BGP属性的值

 

.nexthop (string)

 

 

.origin (string)

 

 

.originator-id (string)

 

 

.out-nexthop(string)

 

 

.peer-cache-id (string)

安装该路由的BGP会话ID。参见/routing/bgp/session菜单。

 

.unknown (string)

未知BGP属性的十六进制blob

 

.weight (string)

 

blackhole (yes | no)

标志表示是否为黑洞路由

check-gateway (ping | arp | bfd)

当前使用的check-gateway选项

comment (string)

 

connect (yes | no)

标志表示该路由是否为已连接的网络路由。

contribution (string)

显示对选举过程有贡献的路由状态,例如已过滤、活动、候选”。

copy (yes | no)

标志表示要作为L3VPN路由重新分发的路由副本。VPNv4/6相关属性被附加到这个“拷贝”路由上。

create-time (string)

 

debug - 一组调试参数

 

 

 

dhcp (yes | no)

标志表示该路由是否被DHCP服务添加。

disabled (yes | no)

标志表示路由是否被禁用。

distance (integer)

 

dst-address (prefix)

路线的目的地。

ecmp (yes | no)

标志表示该路由是否在FIB中被添加为等价多路径路由。[阅读更多](https://help.mikrotik.com/docs/display/ROS/How+Packets+Are+Routed#HowPacketsAreRouted-Multipath(ECMP)routes)

filtered (yes | no)

标志表示该路由是否被路由过滤器过滤,并被排除在最佳路由之外。

gateway (string)

配置的网关,实际解析的网关请参见immediate-gw parameter

hw-offloaded (yes | no)

指示该路由是否符合在支持的硬件上进行硬件卸载的条件。

immediate-gw (string)

显示将用于数据包转发的实际(已解析)网关和接口。格式为 [ip%interface]

label (integer)

 

ldp-address (yes | no)

标志表示路由表项是否为LDP地址。

ldp-mapping (yes | no)

标志表示路由表项是否为LDP映射

ldp - LDP协议相关的一组参数

 

.label (integer)

LDP映射的MPLS标签。

 

.peer-id ()

 

local-address (IP)

所连接网络的本地IP地址。

modem (yes | no)

标志表示该路由是由LTE还是3g调制解调器添加的。

mpls - MPLS相关的一组通用参数

 

.in-label ()

映射的MPLS入站标签

 

.labels ()

 

 

.out-label ()

映射的MPLS出站标签

nexthop-id ()

 

ospf (yes | no)

标志表示该路由是否被OSPF路由协议添加。

ospf - OSPF协议相关的一组参数

 

.metric (integer)

 

 

.type (string)

 

pref-src ()

 

received-from ()

 

rip (yes | no)

标志表示该路由是否被RIP路由协议添加

rip - RIP协议相关的一组参数

 

.metric ()

 

 

.route-tag ()

 

route-cost ()

 

routing-table ()

该路由所属的路由表。

rpki (valid | invalid | unknown)

来自 RPKI验证过程的前缀的当前状态。

scope (integer)

下一跳查找过程中使用的作用域。阅读更多

static (yes | no)

标志表示静态添加的路由。

target-scope (integer)

下一跳查找过程中使用的目标作用域。阅读更多

te-tunnel-id ()

交通工程隧道ID

total-cost ()

 

unreachable (yes | no)

标志表示路由的下一跳是否不可达。

update-time ()

 

 

ve-block-offset

 

 

ve-block-size

 

 

ve-id

 

vpn (yes | no)

标志表示该路由是否是由VPN协议(PPPoEL2TPSSTP)添加的。

vrf-interface ()

内部使用参数,用于标识应该添加到哪条VRF路由。用于动态添加路由的业务,如DHCP client。显示用于调试目的。