Debian/Ubuntu 绑定添加 IP 地址


首先,你必须修改 /etc/network/interfaces 文件,你可以选择使用 sftp 登陆找到文件编辑,或是直接使用 vi 进行修改,不过 Debian 下使用 vi 貌似不是很方便,建议你安装 vim,这里就不对 Debian 下的 vi 多做解释。

以下为 interfaces 文件范例,请在最后一行回车添加。

auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 198.xxx.xxx.xxx
netmask 255.255.255.xx
gateway 198.xxx.xxx.xxx

添加的方式如下,autoiface 的后面都是 eth0: 的模式输入,为第几个附加 IP,下面为添加内容范例。

auto eth0:1
iface eth0:1 inet static
address 198.xxx.xxx.xxx
netmask 255.255.255.xx
gateway 198.xxx.xxx.xxx

添加完毕后,重启网络。

service networking restart
Copyright © AoyouHost.com 2019-2020 all right reserved,powered by Gitbook该文件修订时间: 2019-05-24 13:36:39

results matching ""

    No results matching ""