Liunx网络配置
NAT模式下的网络配置:
首先打开网络配置文件:vi /etc/sysconfig/network-scripts/ifcfg-ens33
修改网卡信息,配置动态Ip过程中,只需要下面四行的信息配置正确。ONBOOT=yes ,BOOTPROTO=dhcp



然后重启网络:systemctl restart network
虚拟机的网络配置就成功了。
第二步xshell中连接此虚拟机,需要填写的IP就是你在虚拟机里执行命令ip a 所查询到的ip地址,填入xshell连接地址中就可以连接了。


虚拟街中网络配置三种模式的IP配置




桥接模式下,Xshell连接虚拟机时候,会出现比较慢的情况,那是因为用户DNS一直检测。
只要进入/etc/ssh/sshd_config文件,然后进入编辑,搜索UseDNS,找到#UseDNS yes改为UseDNS no,也就是将注释符号删除,让这个命令生效。
随后启动sshd,即systemctl restart sshd