首页 > Uncategorized > Linode VPS添加多独立IP方法

Linode VPS添加多独立IP方法

2018年7月31日

众所周知,Linode的VPS主机默认只有一个IP地址,那么如何为Linode VPS绑定多个独立IP地址?这里小编简单介绍下Linode的CentOS VPS添加新的IP方法,仅供大家参考(新的IP需要自己购买)。

一、查看默认网卡设置
假设Lindoe VPS默认IP地址是:1.0.0.0,新购买的IP地址是2.0.0.0,那么需要编辑ifcfg-eth0看到:

vi /etc/sysconfig/network-scripts/ifcfg-eth0

# Configuration for eth0

DEVICE=eth0

BOOTPROTO=none

# This line ensures that the interface will be brought up during boot.

ONBOOT=yes

# eth0 – This is the main IP address that will be used for most outbound connections.

# The address, netmask and gateway are all necessary.

IPADDR=1.0.0.0

NETMASK=255.255.255.0

GATEWAY=2.0.0.0

注意,添加多个独立IP都可以安装上述方法进行添加。

二、配置新的网卡配置文件ifcfg-eth0:0

将ifcfg-eth0拷贝一份,另存为ifcgf-eth0:0:

cp ifcfg-eth0 ifcfg-eth0:0

然后编辑ifcfg-eth0:0文件

vi /etc/sysconfig/network-scripts/ifcfg-eth0:0

# Configuration for eth0:0

DEVICE=eth0:0

BOOTPROTO=none

# This line ensures that the interface will be brought up during boot.

ONBOOT=yes

# eth0:0

IPADDR=2.0.0.0

NETMASK=255.255.255.0

三、配置完成后重启网络

#/etc/init.d/networking restart

使新IP地址生效,这时通过ifconfig可以看到eth0和eth0:0都显示出来了。

这样通过以上简单方法就可以在Linode VPS当中添加多个独立IP了,当然以上方法是在Centos系统中设置的,希望对大家有所帮助。





分类: Uncategorized 标签:
本文的评论功能被关闭了.