vmware-centos7网络配置

第一步:网络连接模式的选择
在这里插入图片描述
第二步
在这里插入图片描述
第三步
在这里插入图片描述
第四步(点击VMnet8)
在这里插入图片描述
第五步(点击第四步的"NAT设置",得到网关地址)
在这里插入图片描述
第六步(点击第四步的"DHCP设置",得到子网掩码和能配置ip地址的范围,之后点击"确定")
在这里插入图片描述

第七步

[root@localhost ~]# cd /etc/sysconfig/network-scripts/
[root@localhost network-scripts]# vim ifcfg-ens33
修改或添加如下代码:1)
BOOTPROTO=static
ONBOOT=yes
(2)第六步得到的ip范围中选一个,子网掩码照抄
IPADDR=192.168.11.200 
NETMASK=255.255.255.0
(3)5步得到的网关
GATEWAY=192.168.11.2
(4)暂时固定(如果不行,将其改为网关的数据,如上192.168.11.2)
DNS1=192.168.11.2
或DNS1=144.144.144.144

第8步

1)重启网络服务
service network restart或
systemctl restart network
(2)关闭window和centos防火墙
centos:1)查看centos防火墙的状态: systemctl status firewalld
	输出的结果中如果有:
	 Active: active (running)表示防火墙开启了
	(2)关闭防火墙:  service firewalld stop
	在输出的结果中可以看到:
		Active: inactive (dead)	

第9步
可能是dns的配置

[root@localhost ~]# cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 8.8.8.8
nameserver 114.114.114.114

第10步

(1)虚拟机与主机之间ping:
	[root@localhost network-scripts]# ping 192.168.99.199
PING 192.168.99.199 (192.168.99.199) 56(84) bytes of data.
64 bytes from 192.168.99.199: icmp_seq=1 ttl=128 time=0.568 ms
64 bytes from 192.168.99.199: icmp_seq=2 ttl=128 time=1.12 ms
64 bytes from 192.168.99.199: icmp_seq=3 ttl=128 time=1.08 ms
64 bytes from 192.168.99.199: icmp_seq=4 ttl=128 time=0.915 ms
64 bytes from 192.168.99.199: icmp_seq=5 ttl=128 time=0.897 ms
64 bytes from 192.168.99.199: icmp_seq=6 ttl=128 time=1.12 ms

(2)主机ping虚拟机
 ping 192.168.11.200

正在 Ping 192.168.11.200 具有 32 字节的数据:
来自 192.168.11.200 的回复: 字节=32 时间<1ms TTL=64
来自 192.168.11.200 的回复: 字节=32 时间<1ms TTL=64
来自 192.168.11.200 的回复: 字节=32 时间<1ms TTL=64
来自 192.168.11.200 的回复: 字节=32 时间<1ms TTL=64

192.168.11.200 的 Ping 统计信息:
    数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
    最短 = 0ms,最长 = 0ms,平均 = 0ms

(3)虚拟机ping百度
[root@localhost network-scripts]# ping www.baidu.com
PING www.a.shifen.com (61.135.169.125) 56(84) bytes of data.
64 bytes from 61.135.169.125 (61.135.169.125): icmp_seq=1 ttl=128 time=4.42 ms
64 bytes from 61.135.169.125 (61.135.169.125): icmp_seq=2 ttl=128 time=4.37 ms
64 bytes from 61.135.169.125 (61.135.169.125): icmp_seq=3 ttl=128 time=5.45 ms
64 bytes from 61.135.169.125 (61.135.169.125): icmp_seq=4 ttl=128 time=4.79 ms
64 bytes from 61.135.169.125 (61.135.169.125): icmp_seq=5 ttl=128 time=5.10 ms
64 bytes from 61.135.169.125 (61.135.169.125): icmp_seq=6 ttl=128 time=5.58 ms

第九步(ssl连接需要勾选下图)
在这里插入图片描述

添加ifconfig命令

yum install net-tools.x86_64

修改主机名和ip绑定

[root@n2 ~]# cat /etc/hosts
#127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
#::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.5.201 n1
192.168.5.202 n2
192.168.5.203 n3
192.168.5.204 n4
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值