Noeio Daemon
管理子网路由
在运行中的 daemon 上通告、撤销和查看子网路由
noeio route 用于在运行中的 daemon 上管理子网路由,不需要重启。功能本身的说明见子网路由。
用法
Manage subnet routes on the running daemon
Usage: noeio route <COMMAND>
Commands:
advertise Start routing for one or more subnets (Linux only), e.g. noeio route advertise 192.168.10.0/24 172.20.0.0/16
withdraw Stop routing for one or more subnets
list Show advertised and learned subnet routes with their state
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help参数说明
advertise:开始为一个或多个网段提供路由,见通告网段。withdraw:停止为一个或多个网段提供路由,见撤销网段。list:查看已通告和已学习到的子网路由及其状态,见查看路由状态。help:打印帮助信息,或打印某个子命令的帮助信息。-h, --help:打印帮助信息。
这些子命令都通过 RPC socket(/var/run/noeio.sock)与 daemon 通信,所以执行前 noeio boot 必须已经在运行,否则会报 failed to connect to daemon。
通告网段
把本节点变成指定网段的子网路由器,其他节点访问这些网段的流量会经由本节点转发。
仅 Linux 可用。 在 macOS 和 Windows 上执行会返回 FAILED_PRECONDITION,daemon 继续运行,该网段不会进入广播。
用法
Start routing for one or more subnets (Linux only), e.g. noeio route advertise 192.168.10.0/24 172.20.0.0/16
Usage: noeio route advertise <CIDR>...
Arguments:
<CIDR>...
Options:
-h, --help Print help参数说明
<CIDR>...:要通告的网段,CIDR 格式,可以一次传入多个,用空格分隔。前缀长度必须在/8到/32之间;带主机位的写法(如192.168.10.7/24)会被规范化成网络地址并打印一条警告。哪些网段不能通告见不能通告的网段。-h, --help:打印帮助信息。
示例
通告本机所在的局域网网段:
noeio route advertise 192.168.10.0/24一次通告多个网段:
noeio route advertise 192.168.10.0/24 172.20.0.0/16撤销网段
停止为指定网段提供路由。撤销后其他节点会移除对应的路由表项,具体机制见撤销是怎么生效的。
用法
Stop routing for one or more subnets
Usage: noeio route withdraw <CIDR>...
Arguments:
<CIDR>...
Options:
-h, --help Print help参数说明
<CIDR>...:要撤销的网段,CIDR 格式,可以一次传入多个,用空格分隔。-h, --help:打印帮助信息。
示例
撤销一个网段:
noeio route withdraw 192.168.10.0/24一次撤销多个网段:
noeio route withdraw 192.168.10.0/24 172.20.0.0/16查看路由状态
列出本节点通告的以及从其他节点学习到的所有子网路由及其状态,可用于确认通告是否生效、某个网段当前走的是哪个节点。
用法
Show advertised and learned subnet routes with their state
Usage: noeio route list
Options:
-h, --help Print help参数说明
-h, --help:打印帮助信息。
此命令没有其他参数。
示例
noeio route list输出中每一条网段会给出它来自哪个节点、当前走的路径(直连地址或中继)、状态以及被拒绝的原因。状态有三种:
| 状态 | 含义 |
|---|---|
active | 路由已安装并在使用中 |
standby | 有多个节点通告同一网段,本条是备用,active 的节点消失后接替 |
rejected | 未安装,同一行会给出原因,常见于与本地物理网卡网段冲突或命中黑名单 |
在 macOS / Windows 上会打印 consumer-only,表示该节点只能作为消费端。