搭建1、虚拟机中CentOS指定ip

it2026-04-13  8

1.修改vm上网方式为 host only2.启动虚拟机3.rm -rf /etc/udev/rules.d/70-persistent-net.rules4.修改虚拟机的网络配置:  (1)vi /etc/sysconfig/network-scripts/ifcfg-eth0  (2)修改DEVICE的值为eth0  (3)删掉 HWADDR行  (4)注释掉 BOOTPROTO=dhcp   (5)添加:IPADDR=192.168.0.10X       NETMASK=255.255.255.0       GATEWAY=192.168.0.1

7.vi /etc/resolv.conf ,将nameserver 192.168.0.1  #不配置,ping www.baidu.com时,提示ping: unknown host www.baidu.com

10.关闭防火墙:service iptables stop永久关闭:chkconfig iptables off检查是否关闭:service iptables status11.关闭selinuxvi /etc/selinux/config注释掉 SELINUX=enforcingSELINUX=targeted增加 SELINUX=disabled

5.本机网络配置中 VMware Network Adapter VMnet1,ip改为 192.168.0.1,子网掩码 255.255.255.06.将本机上网网络适配器共享给VMware Network Adapter VMnet18.重启虚拟机、或重启网卡 service network restart9.ping 本机、网络,本机ping 虚拟机

复制去Google翻译 翻译结果  

转载于:https://www.cnblogs.com/stay-sober/p/4157355.html

最新回复(0)