1. 关闭selinux 与防火墙
在虚拟机装好之后之后,先关闭selinux与防火墙
关闭selinx,重启生效
vim /etc/selinux/config
修改
SELINUX=disabled
关闭 防火墙,重启生效
暂时关闭防火墙:(立即生效,开机重启,会重新打开) service iptables stop 永久关闭防火墙(关机重启才会生效) chkconfig iptables off
2. 配置ip
DEVICE=eth0 HWADDR=00:0C:29:FE:46:9A TYPE=Ethernet UUID=3e6f2537-034c-4502-83b8-1998f860cfc5 ONBOOT=yes NM_CONTROLLED=yes BOOTPROTO=static IPADDR=192.168.16.236 NETWORK=255.255.255.0 GATEWAY=192.168.16.1 PEERDNS=no DNS1=8.8.8.8 DNS2=8.8.4.4
3. 配置网关
vim /etc/sysconfig/network
NETWORKING=yes HOSTNAME=centos6.8 GATEWAY=192.168.16.1
4. ping waiwang
ping www.baidu.com
5.
https://blog.csdn.net/tzh_linux/article/details/52560107
原文地址:https://www.cnblogs.com/yuqiangli0616/p/9780748.html
时间: 2024-10-20 07:06:52