花儿红 發表於 2021-12-26 12:21:00

debian(linux)系统网络配置

<p>虚拟机下载地址下载 VMware Workstation Pro - VMware Customer Connect,需先登录。选择resource,搜索product,vmware workstation pro。</p>
<p>注意虚拟机如果升级,可能会连不上网,需要重启一下主机的网卡</p>
<p>就debian10为例,</p>
<p>1.桌面环境下网络设置有线网络进行四项配置</p>
<p>新建以太网</p>
<p>桌面可以选择GNOM经典模式</p>
<p>debian10 手动有线网络配置IP192.168.8.xxx;子网掩码255.255.255.0;网关192.168.8.1;DNS114.114.114.114</p>
<p>win7虚拟机网络配置对IPV4属性进行IP四项配置192.168.8.xxx</p>
<p>2.有无桌面环境都可用vi系统文件进行配置</p>
<p>配置静态ip:</p>
<p>1.编辑网络配置文件</p>
<p>vi /etc/network/interfaces</p>
<p>添加:</p>
<p>auto eth0</p>
<p>iface eth0 inet static</p>
<p>address 192.168.8.xxx</p>
<p>netmask 255.255.255.0</p>
<p>gateway 192.168.8.1</p>
<p>2.设置DNS</p>
<p>vi /etc/resolv.conf</p>
<p>添加:</p>
<p>nameserver 114.114.114.114</p>
<p>3.重启网卡</p>
<p>ifdown eth0</p>
<p>ifup eth0</p>
<p>或ifconfig eth0 down<br>ifconfig eth0 up</p>
<p>4.重启网络</p>
<p>/etc/init.d/network restart</p>
<p>service network restart</p>
<p>凝思网络配置</p>
<p>vi&nbsp;/etc/network/interfaces</p>
<p>添加:</p>
<p>allow-hotplug eth0<br>iface eth0 inet static<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; address 192.168.1.100<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; netmask 255.255.255.0<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; network 192.168.100.1<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; gateway 192.168.1.254<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dns 8.8.8.8</p>
<p>1)未加allow-hotplug eth0&nbsp; &nbsp; &nbsp;ip不生效;</p>
<p>2)这句可以不加:gateway 193.168.100.1&nbsp;&nbsp;</p>
<p>网络连不上注意:1.虚拟机设置是否为桥接模式(自动)</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2.设备是否托管</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;查看托管状态</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nmcli n</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;显示 disabled 则存在未托管问题<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;开启 托管<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nmcli n on</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3.是否设置DNS</p>
<p>PS:虚拟机配置网络显示有线线缆被拔出</p>
<p><img src="https://img2023.cnblogs.com/blog/2686891/202212/2686891-20221204154357357-1934499734.png"></p>
<p>&nbsp;</p>
<p>解决方法:</p>
<p>此虚拟机设置--设备状态已连接按钮点击勾选即可</p>
<p><img src="https://img2023.cnblogs.com/blog/2686891/202212/2686891-20221204154514558-1664489880.png"></p>
<p>此时虚拟机网络编辑器显示如下</p>
<p><img src="https://img2023.cnblogs.com/blog/2686891/202212/2686891-20221204154720666-718700149.png"></p>
<p>&nbsp;</p>
<p>&nbsp;如果没有桥接模式或者不小心删除桥接模式,可以手动添加VMnet0,选择桥接模式--自动;</p>
<p>&nbsp;<img src="https://img2023.cnblogs.com/blog/2686891/202212/2686891-20221204160137787-852704547.png"></p>
<p>&nbsp;</p>
<p>如果添加除了VMnet0的其他网卡如 VMnet2,选择桥接模式--网卡realtek pcie gbe family controller,此时虚拟机设置要自定义桥接VMnet2。虚拟机设置第一个桥接模式只有当虚拟机网络编辑器添加VMnet0选择自动才可以设置生效。</p>
<p>&nbsp;<img src="https://img2023.cnblogs.com/blog/2686891/202212/2686891-20221204160222830-547658478.png"></p>
<p>&nbsp;</p>
<p>&nbsp;<img src="https://img2023.cnblogs.com/blog/2686891/202212/2686891-20221204160704540-1974471526.png"></p>
<p>&nbsp;</p><br><br>
来源:https://www.cnblogs.com/xuweiqibky/p/15732644.html
頁: [1]
查看完整版本: debian(linux)系统网络配置