network:
ethernets:
ens160:
addresses: [172.16.1.181/24]
dhcp4: no
gateway4: 172.16.1.254
nameservers:
addresses: [172.16.1.241]
ens192:
addresses: [192.168.1.126/24]
dhcp4: no
routes:
- to: 192.168.1.0
via: 192.168.1.254
on-link: true
- to: 233.0.0.0/8
via: 192.168.1.254
on-link: true
version: 2
答案1
此处的使用on-link: true
不正确;这些是通过网关的路由,而不是本地网段上的路由。删除此项可能足以让您的配置正常工作。