新买的服务器,centos7.5的系统

cd /etc/sysconfig/network-scripts/

vi ifcfg-em1

i

 

设置静态ip,centos7.5

 

service network restart

ip link set em1 up

 

ping ip

 

ping www.baidu.com

 

如果ping域名的时候出现ping:unknown host  xxx.xxx

 

查看一下配置文件/etc/resolv.conf,里面是否有nameserver xxx.xxx.xxx.xxx,比如使用dns服务器 nameserver 8.8.8.8,如果有,修改一个可用的dns服务器,如8.8.8.8或者4.4.4.4,保存退出即可!

 

如果设置的是静态ip,需要把dns也配置在ifcfg-em1里

 

 

 

相关文章:

  • 2022-01-08
  • 2021-12-04
  • 2021-11-29
  • 2021-11-19
  • 2022-01-05
  • 2022-01-07
  • 2021-09-24
猜你喜欢
  • 2022-12-23
  • 2021-05-09
  • 2021-04-03
  • 2021-08-06
  • 2022-12-23
  • 2021-08-08
相关资源
相似解决方案