在Debian中批量添加多个IP地址的方法
在使用VPS过程中,或多或少都会遇到需要使用多IP的时候这里我将向大家演示Debian添加多IP的方法
我们VPS的主IP为
IP地址:119.80.24.236
子网掩码:255.255.255.248
网关:119.81.24.233
需要添加的IP段为:
IP地址:119.80.14.15~18
子网掩码:255.255.255.255
网关:119.81.24.233
1:编辑interfaces网络配置文件
vi /etc/network/interfaces
在最后加上
# eth1
auto eth1
allow-hotplug eth1
iface eth1 inet static
address 119.80.24.236
netmask 255.255.255.248
gateway 119.81.24.233
auto eth1:0
iface eth1:0 inet static
address 119.81.14.15
netmask 255.255.255.255
auto eth1:1
iface eth1:1 inet static
address 119.81.14.16
netmask 255.255.255.255
auto eth1:2
iface eth1:2 inet static
address 119.81.14.17
netmask 255.255.255.255
auto eth1:3
iface eth1:3 inet static
address 119.81.14.18
netmask 255.255.255.255
2:最后重启网络服务即可生效:
/etc/init.d/networking restart
页:
[1]