我正在使用 nmcli 版本 0.9.10.0
连接后,如何使用 nmcli 确定默认路由?
为什么我在“连接信息”(nm-applet)下看到的结果与路由的结果不同?
答案1
您的默认网关是
nmcli d show | grep gw
样本输出,
IP4.地址[1]: ip = 192.168.20.61/24, gw =192.168.20.11 IP6.地址[1]: ip = 2a02:8108:2380:2ef0:99f4:8f6d:f30e:c089/64, gw =fe80::3681:c4ff:feaf:8198 IP6.地址[2]: ip = 2a02:8108:2380:2ef0:a00:27ff:fe4f:20ab/64, gw =fe80::3681:c4ff:feaf:8198 IP6.地址[3]: ip = fe80::a00:27ff:fe4f:20ab/64, gw =fe80::3681:c4ff:feaf:8198 IP4.地址[1]: ip = 127.0.0.1/8, gw = 0.0.0.0 IP6.地址[1]: ip = ::1/128, gw = ::
将输出与
$ ip route | grep 默认 默认通过192.168.20.11dev eth0 proto 静态指标 100