如何设置虚拟 IP 地址?

发布于 2024-07-05 09:55:55 字数 23 浏览 7 评论 0原文

...对于 CentOS 来说?

... say for CentOS?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

仄言 2024-07-12 09:55:55

据我了解,虚拟 IP 可以让您从流量实际经过的物理接口中提取地址。 如果您的服务器有两个网卡,它可以有一个虚拟 IP,并使流量通过任一网络物理接口。 如果两个网卡之一发生硬件故障,流量可以继续,第二个网卡作为备份。 我认为这在这些部件可以热插拔的服务器上更相关。

From what I understand a virtul IP can let you abstract the address from the physical interface(s) the traffic actually goes through. If your server has two network cards it can have a single virtual IP and have the traffic go through either network physical interface. If hardware failure occurs on one of the two network cards, the traffic can keep going with the second one as a backup. I assume that this is more relevant on servers where such parts can be hotswapped.

是你 2024-07-12 09:55:55

请查看这篇关于虚拟 IP 地址的文章。 如前所述,它通常在机器之间浮动,有时用于将服务从一台设备故障转移到另一台设备。 您是否正在考虑虚拟接口?

/艾伦

Check out this article on Virtual IP address. As indicated it usually floats between machines, and is sometimes used to fail-over a service from one device to another. Are you thinking of a virtual interface instead perhaps?

/Allan

野の 2024-07-12 09:55:55

虚拟 IP 地址是主机上设置的辅助 IP,它只是绑定到适配器的另一个 IP(适配器,如果绑定的话)。 此 IP 有很多用途,但最常用于网络服务器为多个站点运行多个 SSL 证书。

在 CentOS 中,您几乎将 /etc/sysconfig/network-scripts/ifcfg-eth0 (无论您想要的适配器)复制到 /etc/sysconfig/network-scripts/ifcfg-eth0:1,在那里更改 devicename=eth0到 devicename=eth0:1 并将 IP 更改为您想要的新“虚拟 IP”。

A Virtual IP address is a secondary IP set on a host, it's just another IP bound to an adapter (adapters if bonded). This IP is useful for many things but most commonly used for webservers to run multiple SSL certificates for multiple sites.

In CentOS you pretty much copy the /etc/sysconfig/network-scripts/ifcfg-eth0 (whichever for the adapter you want) to /etc/sysconfig/network-scripts/ifcfg-eth0:1, In there change the devicename=eth0 to devicename=eth0:1 and change the IP for the new "virtual IP" you want.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文