vultr 修改IP

 果农   2020-01-01 13:01   765 人阅读  0 条评论

CentOS 6, CentOS 7

Populate the /etc/sysconfig/network-scripts/ifcfg-eth0 file with the following text.

DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=108.160.131.43
NETMASK=255.255.254.0
GATEWAY=108.160.130.1
DNS1=108.61.10.10

Populate the /etc/sysconfig/network-scripts/route-eth0 file with the following text.

169.254.0.0/16 dev eth0

Populate the /etc/sysconfig/network-scripts/ifcfg-eth0:1 file with the following text.

DEVICE=eth0:1
BOOTPROTO=static
IPADDR=45.32.16.204
NETMASK=255.255.254.0
ONBOOT=yes

Populate the /etc/sysconfig/network-scripts/ifcfg-eth0:2 file with the following text.

DEVICE=eth0:2
BOOTPROTO=static
IPADDR=45.32.36.185
NETMASK=255.255.252.0
ONBOOT=yes

Restart networking or reboot.

service network restart
ip addr flush dev eth0
本文地址:https://haolie.net/post/726.html
版权声明:本文为原创文章,版权归 果农 所有,欢迎分享本文,转载请保留出处!

 发表评论


表情

还没有留言,还不快点抢沙发?