您的位置 首页 主机教程

virmach DD后设置双IP教程

用系统后台面板重装的系统,2个IP都能正常使用,但是自己DD系统后,只有一个IP,我们需要修改/etc/net…

用系统后台面板重装的系统,2个IP都能正常使用,但是自己DD系统后,只有一个IP,我们需要修改/etc/network/interfaces的内容,让系统能够正常识别到2个IP

后台面板重装 interfaces 参数

# Generated by SolusVM

 auto lo
  iface lo inet loopback

 auto eth0
  iface eth0 inet static
   address 194.33.39.1
   gateway 194.33.39.1
   netmask 255.255.255.0
   dns-nameservers 8.8.8.8 8.8.4.4

 auto eth0:0
  iface eth0:0 inet static
   address 194.33.39.2
   gateway 194.33.39.1
   netmask 255.255.255.0
   dns-nameservers 8.8.8.8 8.8.4.4

自己DD系统 interfaces 参数

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug ens3
iface ens3 inet static
    address 194.33.39.1/24
    gateway 194.33.39.1
    # dns-* options are implemented by the resolvconf package, if installed
    dns-nameservers 8.8.8.8
    dns-search skulljargon.com

我们只需要把allow-hotplug改成auto,并新增加一个网卡:0就可以。

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto ens3
iface ens3 inet static
    address 194.33.39.1/24
    gateway 194.33.39.1
    # dns-* options are implemented by the resolvconf package, if installed
    dns-nameservers 8.8.8.8
    dns-search skulljargon.com

auto ens3:0
iface ens3:0 inet static
    address 194.33.39.2/24
    gateway 194.33.39.1
    # dns-* options are implemented by the resolvconf package, if installed
    dns-nameservers 8.8.8.8
    dns-search skulljargon.com

本文来自网络,不代表45主机测评立场,转载请注明出处:https://45sp.com/2116.html

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

联系我们

联系我们

邮箱: reduu@foxmail.com

工作时间:周一至周五,9:00-17:30,节假日休息

返回顶部