为了能够使用XShell来管理我们安装好的CentOS7系统,所以我们要先设置CentOS7的网络使其能够联网。
1.选择vmware的编辑,然后点击虚拟网络编辑器
![](https://i-blog.csdnimg.cn/blog_migrate/171814e73f157039cf09369a852eee6a.png)
2.点击更改设置(需要有管理员权限)
![](https://i-blog.csdnimg.cn/blog_migrate/36f709b2ed2f170408c42d9f3895795c.png)
3.选择VMnet0为桥接模式,选择自动或者网卡
![](https://i-blog.csdnimg.cn/blog_migrate/a86010d925e1d077e5d9fd443118cdb8.png)
4.打开“网络和共享中心”选择“VMware Virtual Ethernet Adapter for VMnet8”网卡,右键选择属性,勾选VMware Bridge Protocol,同时设置ip为自动获取
![](https://i-blog.csdnimg.cn/blog_migrate/716c43c323103ac36e4d0235c27720d8.png)
![](https://i-blog.csdnimg.cn/blog_migrate/c1f1aa03a23af09c4628c6dc8509c6f8.png)
![](https://i-blog.csdnimg.cn/blog_migrate/c8fb8377bd7b50fbb5cf08627cab61e5.png)
![](https://i-blog.csdnimg.cn/blog_migrate/1d0be4d652272071844ce16714709d09.png)
5.设置虚拟机的网络设置,选择NAT方式
![](https://i-blog.csdnimg.cn/blog_migrate/833602d0d2f987c792723ce897960456.png)
![](https://i-blog.csdnimg.cn/blog_migrate/79f2f6c9fae5f4b736240574f6f17a35.png)
6.输入命令cd /etc/sysconfig/network-scripts,到达该目录,并输入ls,查看所有文件,vi打开编辑ifcfg-ens33文件。
![](https://i-blog.csdnimg.cn/blog_migrate/e91938d1f3b08a36c576d8b6dab96c77.png)
7.修改BOOTPROTO=dhcp,ONBOOT=yes。
输入i进入编辑模式,修改好后,点击ESC,输入:wq保存退出
![](https://i-blog.csdnimg.cn/blog_migrate/bceef91c96257a5135607cb82579b0aa.png)
8.输入service network restart重启网络
![](https://i-blog.csdnimg.cn/blog_migrate/5afed41e944a1e838f3f83aa4cb8e9c3.png)
9.输入ifconfig查看是否设置网络成功,有了ip号就表示设置成功了
![](https://i-blog.csdnimg.cn/blog_migrate/9dc2fd9d79b6cae568e80ba58bcf4182.png)
10.使用安装好XShell链接CentOS
![](https://i-blog.csdnimg.cn/blog_migrate/8584fc8f3a4956b501bf997b48147b4c.png)
![](https://i-blog.csdnimg.cn/blog_migrate/1c0a867fc1012fe445278e1c7d23640a.png)
![](https://i-blog.csdnimg.cn/blog_migrate/6fe89dc19929d179d2ec83f0f8bd70b3.png)
![](https://i-blog.csdnimg.cn/blog_migrate/cfb80372178b1d754e97a55634064f82.png)
11.链接成功
![](https://i-blog.csdnimg.cn/blog_migrate/314324669229357574e437aa76a00fa7.png)