Centos7更改网卡名称Eth0

<h1>
    <span class="link_title"><a href="/fanhonooo/article/details/53494100">
    Centos7更改网卡名称Eth0        
       
    </a>
    </span>

     
</h1>
    <div class="article_manage clearfix">
    <div class="article_l">
        <span class="link_categories">
        标签:
          <a href="http://www.csdn.net/tag/Centos7%e6%9b%b4%e6%94%b9%e7%bd%91%e5%8d%a1%e5%90%8d%e7%a7%b0" target="_blank" onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_tag']);">Centos7更改网卡名称</a>
        </span>
    </div>
    <div class="article_r">
        <span class="link_postdate">2016-12-06 21:55</span>
        <span class="link_view" title="阅读次数">8979人阅读</span>
        <span class="link_comments" title="评论次数"> <a href="#comments" onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_pinglun'])">评论</a>(1)</span>
        <span class="link_collect tracking-ad" data-mod="popu_171"> <a href="javascript:void(0);" onclick="javascript:collectArticle('Centos7%e6%9b%b4%e6%94%b9%e7%bd%91%e5%8d%a1%e5%90%8d%e7%a7%b0Eth0','53494100');return false;" title="收藏" target="_blank">收藏</a></span>
         <span class="link_report"> <a href="#report" onclick="javascript:report(53494100,2);return false;" title="举报">举报</a></span>

    </div>
</div>    <style type="text/css">        
        .embody{
            padding:10px 10px 10px;
            margin:0 -20px;
            border-bottom:solid 1px #ededed;                
        }
        .embody_b{
            margin:0 ;
            padding:10px 0;
        }
        .embody .embody_t,.embody .embody_c{
            display: inline-block;
            margin-right:10px;
        }
        .embody_t{
            font-size: 12px;
            color:#999;
        }
        .embody_c{
            font-size: 12px;
        }
        .embody_c img,.embody_c em{
            display: inline-block;
            vertical-align: middle;               
        }
         .embody_c img{               
            width:30px;
            height:30px;
        }
        .embody_c em{
            margin: 0 20px 0 10px;
            color:#333;
            font-style: normal;
        }
</style>
<script type="text/javascript">
    $(function () {
        try
        {
            var lib = eval("("+$("#lib").attr("value")+")");
            var html = "";
            if (lib.err == 0) {
                $.each(lib.data, function (i) {
                    var obj = lib.data[i];
                    //html += '<img src="' + obj.logo + '"/>' + obj.name + "&nbsp;&nbsp;";
                    html += ' <a href="' + obj.url + '" target="_blank">';
                    html += ' <img src="' + obj.logo + '">';
                    html += ' <em><b>' + obj.name + '</b></em>';
                    html += ' </a>';
                });
                if (html != "") {
                    setTimeout(function () {
                        $("#lib").html(html);                      
                        $("#embody").show();
                    }, 100);
                }
            }      
        } catch (err)
        { }
        
    });
</script>
  <div class="category clearfix">
    <div class="category_l">
       <img src="http://static.blog.csdn.net/images/category_icon.jpg">
        <span>分类:</span>
    </div>
    <div class="category_r">
                <label onclick="GetCategoryArticles('6072191','fanhonooo','top','53494100');">
                    <span onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_fenlei']);">linux<em>(6)</em></span>
                  <img class="arrow-down" src="http://static.blog.csdn.net/images/arrow_triangle _down.jpg" style="display:inline;">
                  <img class="arrow-up" src="http://static.blog.csdn.net/images/arrow_triangle_up.jpg" style="display:none;">
                    <div class="subItem">
                        <div class="subItem_t"><a href="http://blog.csdn.net/fanhonooo/article/category/6072191" target="_blank">作者同类文章</a><i class="J_close">X</i></div>
                        <ul class="subItem_l" id="top_6072191">                            
                        </ul>
                    </div>
                </label>                    
    </div>
</div>
    <div class="bog_copyright">         
        <p class="copyright_p">版权声明:本文为博主原创文章,未经博主允许不得转载。</p>
    </div>

安装完Centos7系统,网卡命名跟之前发生了变化,例如!

就是看着不爽也不会影响使用,只是个网卡名称而已。

eno16777736

1.

先编辑网卡的配置文件将里面的NAME DEVICE项修改为eth0

vim /etc/sysconfig/network-scripts/ifcfg-eno16777736 


2.

重命名该配置文件。

[root@localhost yum.repos.d]#  cd /etc/sysconfig/network-scripts/
[root@localhost network-scripts]# mv ifcfg-eno16777736 ifcfg-eth0

3.
禁用该可预测命名规则。对于这一点,你可以在启动时传递“net.ifnames=0 biosdevname=0 ”的内核参数。这是通过编辑/etc/default/grub并加入“net.ifnames=0 biosdevname=0 ”到GRUBCMDLINELINUX变量来实现的。

[root@localhost network-scripts]# vim /etc/default/grub 


4.

运行命令grub2-mkconfig -o /boot/grub2/grub.cfg 来重新生成GRUB配置并更新内核参数。

[root@localhost network-scripts]# grub2-mkconfig -o /boot/grub2/grub.cfg 


5.重新启动机器,启动完之后网卡名称就变成了Eth0

[root@localhost network-scripts]# init 6




重启完之后,验证!


重启系统,验证!
技术一般 水平有限 还望以后大家多多指点! 

    <div id="digg" articleid="53494100">
        <dl id="btnDigg" class="digg digg_disable" onclick="btndigga();">
           
             <dt>顶</dt>
            <dd>2</dd>
        </dl>
       
          
        <dl id="btnBury" class="digg digg_disable" onclick="btnburya();">
          
              <dt>踩</dt>
            <dd>0</dd>               
        </dl>
        
    </div>
 <div class="tracking-ad" data-mod="popu_222"><a href="javascript:void(0);" target="_blank">&nbsp;</a>   </div>
<div class="tracking-ad" data-mod="popu_223"> <a href="javascript:void(0);" target="_blank">&nbsp;</a></div>
<script type="text/javascript">
    function btndigga() {
        $(".tracking-ad[data-mod='popu_222'] a").click();
    }
    function btnburya() {
        $(".tracking-ad[data-mod='popu_223'] a").click();
    }
        </script>
<div style="clear:both; height:10px;"></div>


        <div class="similar_article">
                <h4></h4>
                <div class="similar_c" style="margin:20px 0px 0px 0px">
                    <div class="similar_c_t">
                      &nbsp;&nbsp;相关文章推荐
                    </div>
               
                    <div class="similar_wrap tracking-ad" data-mod="popu_36" style="max-height:250px">                       
                        <ul class="similar_list fl">    
                               <li>
                                   <em>•</em>
                                   <a href="http://blog.csdn.net/cmqwan/article/details/61250037" title="linux--centos7更改网卡名称eth0" strategy="BlogCommendFromBaidu_0" target="_blank">linux--centos7更改网卡名称eth0</a>
                               </li>
                               <li>
                                   <em>•</em>
                                   <a href="http://edu.csdn.net/huiyiCourse/detail/590?utm_source=blog7" title="【免费】搜狗机器翻译技术分享" strategy="undefined" target="_blank">【免费】搜狗机器翻译技术分享</a>
                               </li>
                               <li>
                                   <em>•</em>
                                   <a href="http://blog.csdn.net/superbfly/article/details/51003071" title="Centos7更改网卡设备名称为eth0,eth1等" strategy="BlogCommendFromBaidu_1" target="_blank">Centos7更改网卡设备名称为eth0,eth1等</a>
                               </li>
                               <li>
                                   <em>•</em>
                                   <a href="http://edu.csdn.net/huiyiCourse/series_detail/68?utm_sorce=blog7" title="深度学习在推荐领域的应用和实践--吴岸城" strategy="undefined" target="_blank">深度学习在推荐领域的应用和实践--吴岸城</a>
                               </li>
                               <li>
                                   <em>•</em>
                                   <a href="http://blog.csdn.net/K_Zombie/article/details/50764581" title="Linux修改网卡名字(CentOS)" strategy="BlogCommendFromBaidu_2" target="_blank">Linux修改网卡名字(CentOS)</a>
                               </li>
                               <li>
                                   <em>•</em>
                                   <a href="http://edu.csdn.net/course/detail/5728?utm_source=blog7" title="Git和Github快速上手指南" strategy="undefined" target="_blank">Git和Github快速上手指南</a>
                               </li>
                               <li>
                                   <em>•</em>
                                   <a href="http://blog.csdn.net/henulwj/article/details/47061023" title="centos7修改网卡名" strategy="BlogCommendFromBaidu_3" target="_blank">centos7修改网卡名</a>
                               </li>
                               <li>
                                   <em>•</em>
                                   <a href="http://edu.csdn.net/course/detail/4965?utm_source=blog7" title="JFinal专题之模板引擎知识集锦" strategy="undefined" target="_blank">JFinal专题之模板引擎知识集锦</a>
                               </li>
                        </ul>
                          <ul class="similar_list fr">      
                               <li>
                                   <em>•</em>
                                   <a href="http://blog.csdn.net/StrideBin/article/details/74971208" title="Linux下安装Mysql5.7.18" strategy="BlogCommendFromBaidu_4" target="_blank">Linux下安装Mysql5.7.18</a>
                               </li>
                               <li>
                                   <em>•</em>
                                   <a href="http://edu.csdn.net/course/detail/5840?utm_source=blog7" title="Spring Cloud 微服务实战 " strategy="undefined" target="_blank">Spring Cloud 微服务实战 </a>
                               </li>
                               <li>
                                   <em>•</em>
                                   <a href="http://blog.csdn.net/crazycoder8848/article/details/43054887" title="Linux网卡名称的生成规则" strategy="BlogCommendFromBaidu_5" target="_blank">Linux网卡名称的生成规则</a>
                               </li>
                               <li>
                                   <em>•</em>
                                   <a href="" title=" JDK9新特性解答" strategy="undefined" target="_blank"> JDK9新特性解答</a>
                               </li>
                               <li>
                                   <em>•</em>
                                   <a href="http://blog.csdn.net/henulwj/article/details/45586843" title="centos6.x修改网卡名称em1、2...为eth0、1..." strategy="BlogCommendFromBaidu_6" target="_blank">centos6.x修改网卡名称em1、2...为eth0、1...</a>
                               </li>
                               <li>
                                   <em>•</em>
                                   <a href="http://blog.csdn.net/zxdfc/article/details/53448020" title="linux下安装mysql5.7" strategy="BlogCommendFromBaidu_7" target="_blank">linux下安装mysql5.7</a>
                               </li>
                               <li>
                                   <em>•</em>
                                   <a href="http://blog.csdn.net/xiegh2014/article/details/51526411" title="CentOS7修改网卡为eth0" strategy="BlogCommendFromBaidu_8" target="_blank">CentOS7修改网卡为eth0</a>
                               </li>
                               <li>
                                   <em>•</em>
                                   <a href="http://blog.csdn.net/tantexian/article/details/44678495" title="centos 7.0 网卡配置及重命名教程(转)" strategy="BlogCommendFromBaidu_9" target="_blank">centos 7.0 网卡配置及重命名教程(转)</a>
                               </li>
                        </ul>
                    </div>
                </div>
            </div>   
 <div>
       

   
                       
        <!-- 广告位:PC端-博客内容页-banner1-960*90 --> 
       
     <!-- 广告位:PC端-博客详情页底部banner-960*90 -->
        <script>
            (function() {
                var s = "_" + Math.random().toString(36).slice(2);
                document.write('<div id="' + s + '"></div>');
                (window.slotbydup=window.slotbydup || []).push({
                    id: '4770928',
                    container: s,
                    size: '960,90',
                    display: 'inlay-fix'
                });
            })();
        </script><div id="_3ckv1ubunemab8ykebve2buik9"></div>
</div>
    <!-- 广告位开始 -->
    <!-- 广告位结束 -->
查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
<div id="ad_bot">
</div>
    <a id="quick-reply" class="btn btn-top q-reply" title="快速回复" style="display:none;">
        <img src="http://static.blog.csdn.net/images/blog-icon-reply.png" alt="快速回复">
    </a>    
<a id="d-top-a" class="btn btn-top backtop" style="display: none;" title="返回顶部" onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_huidaodingbu'])">         
     <img src="http://static.blog.csdn.net/images/top.png" alt="TOP">
</a>
                    <div class="clear">
                    </div>
                </div>
posted @ 2017-10-27 11:38  jobs-lgy  阅读(222)  评论(0编辑  收藏  举报