{"id":18367,"date":"2014-07-15T06:49:50","date_gmt":"2014-07-14T22:49:50","guid":{"rendered":"https:\/\/2blog.ilc.edu.tw\/25793\/2014\/07\/15\/%e6%9b%b4%e6%94%b9-centos-7-%e7%9a%84%e7%b6%b2%e8%b7%af%e5%8d%a1%e4%bb%a3%e8%99%9f\/"},"modified":"2021-03-18T17:23:59","modified_gmt":"2021-03-18T09:23:59","slug":"%e6%9b%b4%e6%94%b9-centos-7-%e7%9a%84%e7%b6%b2%e8%b7%af%e5%8d%a1%e4%bb%a3%e8%99%9f","status":"publish","type":"post","link":"https:\/\/2blog.ilc.edu.tw\/25793\/2014\/07\/15\/%e6%9b%b4%e6%94%b9-centos-7-%e7%9a%84%e7%b6%b2%e8%b7%af%e5%8d%a1%e4%bb%a3%e8%99%9f\/","title":{"rendered":"\u66f4\u6539 CentOS 7 \u7684\u7db2\u8def\u5361\u4ee3\u865f"},"content":{"rendered":"<p>CentOS 7 \u7684\u7db2\u8def\u5361\u4ee3\u865f\u6368\u68c4\u4e86\u539f\u672c\u719f\u6089\u7684 ethx <br \/># <span style=\"color: #ff0000\">ls -l \/etc\/sysconfig\/network-scripts\/ifcfg-*<\/span><br \/><span style=\"color: #0000ff\">-rw-r&#8211;r&#8211;. 1 root root 326\u00a0 7\u6708 10 19:24 \/etc\/sysconfig\/network-scripts\/ifcfg-eno16777736<\/span><br \/><span style=\"color: #0000ff\">-rw-r&#8211;r&#8211;. 1 root root 254\u00a0 4\u6708\u00a0 2 23:30 \/etc\/sysconfig\/network-scripts\/ifcfg-lo<\/span><\/p>\n<p>\u7db2\u8def\u5361\u8a2d\u5b9a<br \/># <span style=\"color: #ff0000\">cat \/etc\/sysconfig\/network-scripts\/ifcfg-eno16777736<\/span><br \/><span style=\"color: #0000ff\">HWADDR=&#8221;00:0C:29:A6:22:15&#8243;<\/span><br \/><span style=\"color: #0000ff\">TYPE=&#8221;Ethernet&#8221;<\/span><br \/><span style=\"color: #0000ff\">BOOTPROTO=&#8221;dhcp&#8221;<\/span><br \/><span style=\"color: #0000ff\">DEFROUTE=&#8221;yes&#8221;<\/span><br \/><span style=\"color: #0000ff\">PEERDNS=&#8221;yes&#8221;<\/span><br \/><span style=\"color: #0000ff\">PEERROUTES=&#8221;yes&#8221;<\/span><br \/><span style=\"color: #0000ff\">IPV4_FAILURE_FATAL=&#8221;no&#8221;<\/span><br \/><span style=\"color: #0000ff\">IPV6INIT=&#8221;yes&#8221;<\/span><br \/><span style=\"color: #0000ff\">IPV6_AUTOCONF=&#8221;yes&#8221;<\/span><br \/><span style=\"color: #0000ff\">IPV6_DEFROUTE=&#8221;yes&#8221;<\/span><br \/><span style=\"color: #0000ff\">IPV6_PEERDNS=&#8221;yes&#8221;<\/span><br \/><span style=\"color: #0000ff\">IPV6_PEERROUTES=&#8221;yes&#8221;<\/span><br \/><span style=\"color: #0000ff\">IPV6_FAILURE_FATAL=&#8221;no&#8221;<\/span><br \/><span style=\"color: #0000ff\">NAME=&#8221;eno16777736&#8243;<\/span><br \/><span style=\"color: #0000ff\">UUID=&#8221;7e2c54c0-a09d-45ca-a074-7ed5d5d8ed32&#8243;<\/span><br \/><span style=\"color: #0000ff\">ONBOOT=&#8221;yes&#8221;<\/span>[@more@]\u4fee\u6539\u65b9\u5f0f\uff1a\u53c3\u8003 <a href=\"http:\/\/esuareznotes.wordpress.com\/2014\/07\/11\/change-default-network-name-to-old-eth0-on-rhel-7-fedora-19-above\/\" target=\"_blank\" rel=\"noopener noreferrer\">Change default network name to old \u201ceth0\u2033 on RHEL 7 \/ Fedora 19 above | eSuarez Notes<\/a><br \/>\u4fee\u6539<span style=\"color: #0000ff\"> \/etc\/default\/grub<\/span><br \/>\u5728<span style=\"color: #0000ff\"> GRUB_CMDLINE_LINUX<\/span> \u5f8c\u52a0\u4e0a <span style=\"color: #ff0000\">net.ifnames=0 biosdevname=0<\/span><br \/># <span style=\"color: #ff0000\">vim \/etc\/default\/grub<\/span><br \/><span style=\"color: #0000ff\">GRUB_TIMEOUT=5<\/span><br \/><span style=\"color: #0000ff\">GRUB_DISTRIBUTOR=&#8221;$(sed &#8216;s, release .*$,,g&#8217; \/etc\/system-release)&#8221;<\/span><br \/><span style=\"color: #0000ff\">GRUB_DEFAULT=saved<\/span><br \/><span style=\"color: #0000ff\">GRUB_DISABLE_SUBMENU=true<\/span><br \/><span style=\"color: #0000ff\">GRUB_TERMINAL_OUTPUT=&#8221;console&#8221;<\/span><br \/><span style=\"color: #0000ff\">GRUB_CMDLINE_LINUX=&#8221;rd.lvm.lv=centos\/swap vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos\/root crashkernel=auto\u00a0 vconsole.keymap=us rhgb quiet <span style=\"color: #ff0000\">net.ifnames=0 biosdevname=0<\/span>&#8220;<\/span><br \/><span style=\"color: #0000ff\">GRUB_DISABLE_RECOVERY=&#8221;true&#8221;<\/span><\/p>\n<p>\u7522\u751f\u65b0\u7684 grub \u8a2d\u5b9a\u6a94<br \/># <span style=\"color: #ff0000\">grub2-mkconfig -o \/boot\/grub2\/grub.cfg<\/span><br \/><span style=\"color: #0000ff\">Generating grub configuration file &#8230;<\/span><br \/><span style=\"color: #0000ff\">Found linux image: \/boot\/vmlinuz-3.10.0-123.el7.x86_64<\/span><br \/><span style=\"color: #0000ff\">Found initrd image: \/boot\/initramfs-3.10.0-123.el7.x86_64.img<\/span><br \/><span style=\"color: #0000ff\">Warning: Please don&#8217;t use old title `CentOS Linux, with Linux 3.10.0-123.el7.x86_64&#8242; for GRUB_DEFAULT, use `Advanced options for CentOS Linux&gt;CentOS Linux, with Linux 3.10.0-123.el7.x86_64&#8242; (for versions before 2.00) or `gnulinux-advanced-caeda11c-71b9-4cc4-961b-b4541b247804&gt;gnulinux-3.10.0-123.el7.x86_64-advanced-caeda11c-71b9-4cc4-961b-b4541b247804&#8242; (for 2.00 or later)<\/span><br \/><span style=\"color: #0000ff\">Found linux image: \/boot\/vmlinuz-0-rescue-07f9be0c0fc843ce885a7539150c8e55<\/span><br \/><span style=\"color: #0000ff\">Found initrd image: \/boot\/initramfs-0-rescue-07f9be0c0fc843ce885a7539150c8e55.img<\/span><br \/><span style=\"color: #0000ff\">done<\/span><\/p>\n<p>\u76f4\u63a5\u628a ifcfg-enoxxx \u6539\u6210 ifcfg-eth0<br \/># <span style=\"color: #ff0000\">mv \/etc\/sysconfig\/network-scripts\/ifcfg-eno16777736 \/etc\/sysconfig\/network-scripts\/ifcfg-eth0<\/span><\/p>\n<p>\u4fee\u6539\u7db2\u8def\u5361\u4ee3\u865f<br \/># <span style=\"color: #ff0000\">sed -i &#8216;s\/eno16777736\/eth0\/g&#8217; \/etc\/sysconfig\/network-scripts\/ifcfg-eth0<\/span><\/p>\n<pre class=\"prettyprint\"><span style=\"color: #0000ff\">NAME=eth0 \nDEVICE=eth0<\/span><\/pre>\n<p>\u91cd\u65b0\u958b\u6a5f<br \/># <span style=\"color: #ff0000\">sync;sync;sync;sync;shutdown -r<\/span><\/p>\n<p>\u7db2\u8def\u5361\u4ee3\u865f\u5df2\u66f4\u6539<br \/># <span style=\"color: #ff0000\">ifconfig eth0<\/span><br \/><span style=\"color: #0000ff\"><span style=\"color: #ff0000\">eth0<\/span>: flags=4163&lt;UP,BROADCAST,RUNNING,MULTICAST&gt;\u00a0 mtu 1500<\/span><br \/><span style=\"color: #0000ff\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 inet 192.168.1.109\u00a0 netmask 255.255.255.0\u00a0 broadcast 192.168.1.255<\/span><br \/><span style=\"color: #0000ff\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 inet6 fe80::20c:29ff:fea6:2215\u00a0 prefixlen 64\u00a0 scopeid 0x20&lt;link&gt;<\/span><br \/><span style=\"color: #0000ff\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ether 00:0c:29:a6:22:15\u00a0 txqueuelen 1000\u00a0 (Ethernet)<\/span><br \/><span style=\"color: #0000ff\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 RX packets 128\u00a0 bytes 12595 (12.2 KiB)<\/span><br \/><span style=\"color: #0000ff\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 RX errors 0\u00a0 dropped 0\u00a0 overruns 0\u00a0 frame 0<\/span><br \/><span style=\"color: #0000ff\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 TX packets 125\u00a0 bytes 16864 (16.4 KiB)<\/span><br \/><span style=\"color: #0000ff\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 TX errors 0\u00a0 dropped 0 overruns 0\u00a0 carrier 0\u00a0 collisions 0<\/span><\/p>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>CentOS 7 \u7684\u7db2\u8def\u5361\u4ee3\u865f\u6368\u68c4\u4e86\u539f\u672c\u719f\u6089\u7684 ethx # ls -l \/etc\/sysconfig\/net &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/2blog.ilc.edu.tw\/25793\/2014\/07\/15\/%e6%9b%b4%e6%94%b9-centos-7-%e7%9a%84%e7%b6%b2%e8%b7%af%e5%8d%a1%e4%bb%a3%e8%99%9f\/\" class=\"more-link\">\u95b1\u8b80\u5168\u6587<span class=\"screen-reader-text\">\u3008\u66f4\u6539 CentOS 7 \u7684\u7db2\u8def\u5361\u4ee3\u865f\u3009<\/span><\/a><\/p>\n","protected":false},"author":55,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[117],"tags":[],"class_list":["post-18367","post","type-post","status-publish","format-standard","hentry","category-c-78462"],"meta_key":{"_pingme":["1"],"_encloseme":["1"],"lt_post_id":["511822"]},"_links":{"self":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts\/18367"}],"collection":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/users\/55"}],"replies":[{"embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/comments?post=18367"}],"version-history":[{"count":1,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts\/18367\/revisions"}],"predecessor-version":[{"id":20018,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts\/18367\/revisions\/20018"}],"wp:attachment":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/media?parent=18367"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/categories?post=18367"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/tags?post=18367"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}