网关

虚拟机设置静态IP配置

虚拟机的ip设置  vi /etc/sysconfig/network-scripts/ifcfg-eth0

虚拟机设置静态IP配置

重启网卡

service network restart

测试

ping www.baidu.com

 如果不能ping通,可以查看下route命令,多半是网关没生效

route add default gw 192.168.59.2 dev eth0 

 这种只是临时的,要永久修改/etc/sysconfig/network添加GATEWAY =192.168.59.2

相关文章:

  • 2021-11-27
  • 2021-11-27
  • 2021-11-27
  • 2021-10-26
  • 2021-11-16
猜你喜欢
  • 2022-01-05
  • 2022-01-05
  • 2022-01-05
  • 2021-07-22
  • 2021-10-29
相关资源
相似解决方案