我的托管服务提供商给了我一个额外的 IP 地址,现在我试图将其添加到我的 netplan 中,但不知何故它覆盖了主 IP。这是我的 netplan:
### Hetzner Online GmbH installimage
network:
version: 2
renderer: networkd
ethernets:
enp35s0:
match:
macaddress: 00:50:56:00:F9:3B
addresses:
- 167.235.117.189/32
- 167.235.117.188/24
- 2a01:4f8:2200:21cd::2/64
routes:
- on-link: true
to: 0.0.0.0/0
via: 167.235.117.129
- to: default
via: fe80::1
nameservers:
addresses:
- 185.12.64.1
- 2a01:4ff:ff00::add:2
- 185.12.64.2
- 2a01:4ff:ff00::add:1
以 .189 结尾的 ip 是我的主 ip,以 188 结尾的另一个是我的辅助 ip。macaddress“属于”以 .188 结尾的 ip。有人能帮我吗?非常感谢!
编辑:按照@Terrance 的说明操作后,我的新配置如下所示:
### Hetzner Online GmbH installimage
network:
version: 2
renderer: networkd
ethernets:
enp35s0:
match:
macaddress: 00:50:56:00:F9:3B
addresses:
- 167.235.117.189/32:
label: "enp35s0:0"
- 167.235.117.188/32:
label: "enp35s0:1"
- 2a01:4f8:2200:21cd::2/64
routes:
- on-link: true
to: 0.0.0.0/0
via: 167.235.117.129
- to: default
via: fe80::1
nameservers:
addresses:
- 185.12.64.1
- 2a01:4ff:ff00::add:2
- 185.12.64.2
- 2a01:4ff:ff00::add:1