我试图获取特定 IP 的路由规则,但该ip rule
命令抛出错误。这不应该像add
/del
等那样工作吗?至少从文档中我看来是这样。
$ ip rule list 192.168.1.100
"ip rule show" does not take any arguments.
文档:
$ ip rule help
Usage: ip rule [ list | add | del | flush ] SELECTOR ACTION
SELECTOR := [ not ] [ from PREFIX ] [ to PREFIX ] [ tos TOS ] [ fwmark FWMARK[/MASK] ]
[ iif STRING ] [ oif STRING ] [ pref NUMBER ]
ACTION := [ table TABLE_ID ]
[ prohibit | reject | unreachable ]
[ realms [SRCREALM/]DSTREALM ]
[ goto NUMBER ]
SUPPRESSOR
SUPPRESSOR := [ suppress_prefixlength NUMBER ]
[ suppress_ifgroup DEVGROUP ]
TABLE_ID := [ local | main | default | NUMBER ]
答案1
显然这不需要争论。明确记录在联机帮助页。
ip 规则显示 - 列出规则
该命令没有参数。选项
list
或lst
是 的同义词show
。