坚韧的小草 發表於 2024-3-24 00:00:00

Oracle VM Virtual中CentOS自动获取IP地址设置方法

<p>
        在CentOS配置网卡开机自动获取IP地址:</p>
<p>
        vi /etc/sysconfig/network-scripts/ifcfg-eth0</p>
<p>
        将 ONBOOT="no" 改为 ONBOOT="yes"</p>
<p>
        保存后: service network restart</p>
<p>
        查看IP:ifconfig eth0</p>
<p>
        然后利用 Oracle VM VirtualBox 的端口转发功能(port forwarding),通过虚拟机的虚拟网卡实现主机与客户机的通信。</p>
<p>
        打开virtualbox的设置窗口 -&gt;网络-&gt;网卡1 启用网络连接-&gt; 连接方式:NAT-&gt;接入网线-&gt;端口转发,设置如下</p>
<p align="center">
        <img style="max-width:100%!important;height:auto!important;"title="Oracle VM Virtual中CentOS自动获取IP地址设置方法" alt="Oracle VM Virtual中CentOS自动获取IP地址设置方法" align="" border="0" src="https://zhuji.jb51.net/uploads/img/20230519/e83ca46e4079a9ce555c33833ea10580.jpg" width="774"></p>
<p>
        然后配置虚拟网卡IP地址与客户机IP映射: 端口为22,图中客户机主机端口设置为2200</p>
<p align="center">
        <img style="max-width:100%!important;height:auto!important;"title="Oracle VM Virtual中CentOS自动获取IP地址设置方法" alt="Oracle VM Virtual中CentOS自动获取IP地址设置方法" align="" border="0" src="https://zhuji.jb51.net/uploads/img/20230519/98e575a70163d5f34730c619317c8b5b.jpg" width="774"></p>
<p>
        接下来通过putty客户端工具就能连接上虚拟机上的系统了,注意 Port设置为2200</p>
<p align="center">
        <img style="max-width:100%!important;height:auto!important;"title="Oracle VM Virtual中CentOS自动获取IP地址设置方法" alt="Oracle VM Virtual中CentOS自动获取IP地址设置方法" align="" border="0" src="https://zhuji.jb51.net/uploads/img/20230519/1df4c69dd30f6bb61e5be6d4d05098d9.jpg" width="455"></p>
頁: [1]
查看完整版本: Oracle VM Virtual中CentOS自动获取IP地址设置方法