大网数据广告活动
服务器运维问答

Debian 9 - additional IP

· 52CE 我爱测

I have a server with Debian 9.2. (Soyoustart) I want to add 2 additional IP addresses. Is it correct to add them in that way ? In the file "/etc/systemd/network/50-default.network", to these lines : [Address] Address=22.33.44.55/…

问题原文

原帖链接 · Christophe · CC BY-SA 3.0

I have a server with Debian 9.2. (Soyoustart)

I want to add 2 additional IP addresses.

Is it correct to add them in that way ?

In the file "/etc/systemd/network/50-default.network", to these lines :

[Address]
Address=22.33.44.55/32 #for the IP1
Label=failover1 # optional
Address=66.77.88.99/32 #for the IP2
Label=failover2 # optional

And then to restart the system.

Thank you.

已采纳解答

原帖链接 · Keijo D Putt · CC BY-SA 3.0

Overall it's the correct way to do it as per the recently updated instructions in https://docs.ovh.com/gb/en/dedicated/network-ipaliasing/#debian-9-ubuntu-17-fedora-26-and-arch-linux because the document says to backup then edit /etc/systemd/network/50-default.network with the following:

[Address]
Address=22.33.44.55/32
Label=failover1 # Optional

But it states that a reboot is not needed, since you can issue systemctl restart systemd-networkd and you're good to go...

EDIT: Adding more failovers requires each IP to be declared in its own [Address] section, as the example below: [Address] Address=22.33.44.55/32 Label=failover1 # Optional

[Address]
Address=23.34.45.56/32
Label=failover2 # Optional
.
.
.
[Address]
Address=99.98.76.54/32
Label=failover-n # Optional

Issue systemctl restart systemd-networkd and voilà.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-11-25)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。