叶离 發表於 2024-6-28 00:00:00

Linux系统网卡设置教程

<p>
        由于做了虚拟机的克隆,发现克隆机和被克隆机的MAC地址相同了,下面我将要介绍一下linux中网卡的配置步骤,我使用的linux是CentOS release 6.9 (Final)</p><p>
        1、root用户编辑/etc/udev/rules.d/70-persistent-net.rules文件,找到mac地址重复的那个网卡并删除(这里是eth0),记住新生成的网卡eth1的mac地址,后面会用到,保存并退出</p><pre class="brush:bash;toolbar:false">#&nbsp;vi&nbsp;/etc/udev/rules.d/70-persistent-net.rules</pre><p><img style="max-width:100%!important;height:auto!important;" title="Linux系统网卡设置教程" alt="Linux系统网卡设置教程" src="https://zhuji.jb51.net/uploads/img/202305/706dee6dfcfa5240bb6269e3b0215784.jpg"/></p><p>
        2、编辑/etc/sysconfig/network-scripts/ifcfg-eth0,将HWADDR地址改为步骤1中新生成的mac地址00:50:56:36:16:72</p><pre class="brush:bash;toolbar:false">#&nbsp;vi&nbsp;/etc/sysconfig/network-scripts/ifcfg-eth0</pre><p><img style="max-width:100%!important;height:auto!important;" title="Linux系统网卡设置教程" alt="Linux系统网卡设置教程" src="https://zhuji.jb51.net/uploads/img/202305/fbbff237cd303ba4ddb92db2f6ccdc5b.jpg"/></p><p>
        3、重启系统,使前面的修改生效</p><pre class="brush:bash;toolbar:false">#&nbsp;reboot</pre><p>以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。</p>
頁: [1]
查看完整版本: Linux系统网卡设置教程