我正在尝试将以下别名从 移植/etc/network/interfaces
到/etc/systemd/network/eth0.network
。
auto eth0:1
iface eth0:1 inet static
address 10.0.2.1/24
答案1
正如迈克尔指出的那样,你不需要。
相反,您可以在界面中添加额外的线条Address=
。Gateway=
例子:
$ cat /etc/systemd/network/eth0.network
[Match]
Name=eth0
[Network]
Address=2a0a:3840:1337:126::b9c1:7ecb:1337/64
Gateway=2a0a:3840:1337:126::1
IPv6AcceptRA=no
Address=185.193.126.203/24
Gateway=185.193.126.1
DNS=95.215.19.53
[DHCP]
UseDNS=false