Vultr 上 CentOS 7使用snapshot功能创建实例,出现网络异常解决办法

遇到的问题:

创建新实例后,vps能ping通谷歌,但我用ssh等访问vps时,tcp状态始终是SYN_RECV;

 

最简单的方法:

在snapshot前安装 yum install  cloud-init

 

-----------------------------------------------------------------------------------------------------------------------------------

以下是官方提供的解决方式

 

Correcting Network Configuration After Snapshot Restore

Published on: Mon, Sep 22, 2014 at 11:47 am EST

CentOS FAQ Linux Guides Ubuntu

After restoring a snapshot to a new machine, you may encounter issues caused by the MAC address of the network adapter changing. Usually, when the network adapter changes the operating system will create a new network adapter for it. You'd typically see the network adapter on 'eth1' (or eth2 if you had private networking enabled).

CentOS

  • Log in to your server via the KVM in your control panel
  • Remove the contents of /etc/udev/rules.d/70-persistent-net.rules
  • Open /etc/sysconfig/network-scripts/ifcfg-eth0, and change the contents to the following:

    DEVICE=eth0
    TYPE=Ethernet
    ONBOOT=yes
    NM_CONTROLLED=yes
    BOOTPROTO=dhcp
    DNS1=8.8.8.8
    NAME="System eth0"
    
  • Reboot your server
  • Once you have network connectivity again, you can permanently fix these issues by installing the cloud-init package from EPEL. This software will take care of adjusting your network adapter configuration whenever a snapshot is restored.

Debian/Ubuntu

  • Log into your server via the KVM in your control panel.
  • Remove the contents of /etc/udev/rules.d/70-persistent-net.rules
  • Review the contents of /etc/network/interfaces and update any IP addresses to match the current server.
  • Reboot your server
  • Once you have network connectivity again, you can permanently fix these issues by installing the cloud-init package. This software will take care of adjusting your network adapter configuration whenever a snapshot is restored.

Windows

  • No changes are necessary for Windows. It will automatically start using the new network adapter.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值