{"id":2507,"date":"2017-07-26T21:39:50","date_gmt":"2017-07-26T13:39:50","guid":{"rendered":"http:\/\/cn.hostease.com\/xueyuan\/?p=2507"},"modified":"2017-07-26T21:40:03","modified_gmt":"2017-07-26T13:40:03","slug":"%e8%a7%a3%e5%86%b3centos7-%e5%ae%89%e8%a3%85%e8%bf%b7%e4%bd%a0%e7%89%88%e5%90%8e%ef%bc%8c%e6%b2%a1%e6%9c%89ifconfig%e5%91%bd%e4%bb%a4%e7%9a%84%e5%8a%9e%e6%b3%95","status":"publish","type":"post","link":"https:\/\/cn.hostease.com\/xueyuan\/jishu\/linux\/%e8%a7%a3%e5%86%b3centos7-%e5%ae%89%e8%a3%85%e8%bf%b7%e4%bd%a0%e7%89%88%e5%90%8e%ef%bc%8c%e6%b2%a1%e6%9c%89ifconfig%e5%91%bd%e4%bb%a4%e7%9a%84%e5%8a%9e%e6%b3%95\/","title":{"rendered":"\u89e3\u51b3CentOS7 \u5b89\u88c5\u8ff7\u4f60\u7248\u540e\uff0c\u6ca1\u6709ifconfig\u547d\u4ee4\u7684\u529e\u6cd5"},"content":{"rendered":"<ul>\n<li>\u914d\u7f6eyum\u6e90\uff08\u672c\u5730\uff09\n<ol>\n<li>\u6302\u8f7d\u7cfb\u7edf\u5b89\u88c5\u5149\u76d8<code>mount \/dev\/cdrom \/mnt\/cdrom\/<\/code><\/li>\n<li>\u5728linux \u8f93\u5165\u5982\u4e0b\u547d\u4ee4\uff1a<code>cd \/etc\/yum.repos.d\/<\/code>\uff0c\u7136\u540e<code>ls<\/code>\u663e\u793ayum.repos.d\u6587\u4ef6\u91cc\u9762\u7684\u6587\u4ef6\u6709\uff1a<code>CentOS-Base.repo CentOS-CR.repo CentOS-Debuginfo.repo<\/code><br \/>\n<code>CentOS-fasttrack.repo CentOS-Media.repo CentOS-Sources.repo CentOS-Vault.repo<\/code>\u00a0\u51717\u4e2a\u6587\u4ef6\u3002<\/li>\n<li>\u6253\u5f00<code>CentOS-Media.repo<\/code>\u6587\u4ef6\uff0c\u547d\u4ee4\uff1a<code>vi CentOS-Media.repo<\/code><\/li>\n<li>\u628a<code>CentOS-Media.repo<\/code>\u6587\u4ef6\u6539\u6210\uff1a<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<pre class=\"prettyprint\"><code class=\"hljs cs has-numbering\">        <span class=\"hljs-preprocessor\"># CentOS-Media.repo<\/span>\r\n        <span class=\"hljs-preprocessor\">#<\/span>\r\n        <span class=\"hljs-preprocessor\"># This repo can be used with mounted DVD media, verify the mount point for<\/span>\r\n        <span class=\"hljs-preprocessor\"># CentOS-7.  You can use this repo and yum to install items directly off the<\/span>\r\n        <span class=\"hljs-preprocessor\"># DVD ISO that we release.<\/span>\r\n        <span class=\"hljs-preprocessor\">#<\/span>\r\n        <span class=\"hljs-preprocessor\"># To use this repo, put in your DVD and use it with the other repos too:<\/span>\r\n        <span class=\"hljs-preprocessor\"># yum --enablerepo=c7-media [command]<\/span>\r\n        <span class=\"hljs-preprocessor\">#<\/span>\r\n        <span class=\"hljs-preprocessor\"># or for ONLY the media repo, do this:<\/span>\r\n        <span class=\"hljs-preprocessor\">#<\/span>\r\n        <span class=\"hljs-preprocessor\"># yum --disablerepo=\\* --enablerepo=c7-media [command]<\/span>\r\n        [c7-media]                       <span class=\"hljs-preprocessor\">#\u5e93\u540d\u79f0<\/span>\r\n        name=CentOS-$releasever - Media  <span class=\"hljs-preprocessor\">#\u5e93\u540d\u79f0\u53d9\u8ff0<\/span>\r\n        baseurl= file:<span class=\"hljs-comment\"><span class=\"hljs-xmlDocTag\">\/\/\/<\/span>mnt\/cdrom       #yum\u6e90\u76ee\u5f55\uff0c\u6e90\u5730\u5740<\/span>\r\n        gpgcheck=<span class=\"hljs-number\">1<\/span>                       <span class=\"hljs-preprocessor\">#\u68c0\u67e5GPG-KEY\uff0c0,1\u5206\u522b\u4e3a\u4e0d\u68c0\u67e5\uff0c\u68c0\u67e5<\/span>\r\n        enabled=<span class=\"hljs-number\">1<\/span>                        <span class=\"hljs-preprocessor\">#\u662f\u5426\u7528\u8be5\u6e90<\/span>\r\n        gpgkey=file:<span class=\"hljs-comment\"><span class=\"hljs-xmlDocTag\">\/\/\/<\/span>etc\/pki\/rpm-gpg\/RPM-GPG-KEY-CentOS-7<\/span><\/code><\/pre>\n<p><strong>\u7136\u540e<\/strong><code>:wq<\/code>\u4fdd\u5b58\u9000\u51fa\uff0c\u8bb0\u4f4f\u8981\u628a\u5176\u4ed6\u76846\u4e2a\u6587\u4ef6\u5220\u9664\uff0c\u4f46\u662f\u6700\u597d\u4fdd\u7559\u4e00\u4e0b\uff0c\u4ee5\u9632\u4ee5\u540e\u7528\u7684\u65f6\u5019\u597d\u627e\uff0c\u6211\u7684\u5904\u7406\u65b9\u5f0f\u662f\u628a\u5176\u4ed6\u516d\u4e2a\u6587\u4ef6\u7684\u540e\u7f00\u540d\u6539\u6210\u4e86<code>.bak<\/code>\u6539\u540e\u5982\u4e0b\uff1a\u00a0 <code>CentOS-Base.bak CentOS-CR.bak CentOS-Debuginfo.bak<\/code>\u00a0 <code>CentOS-fasttrack.bak CentOS-Media.repo CentOS-Sources.bak CentOS-Vault.bak<\/code>\u00a0 5.<code>baseurl= file:\/\/\/mnt\/cdrom #\u8fd9\u4e2a\u5f88\u91cd\u8981\uff0c\u8fd9\u4e2a\u662f\u6307\u5b9a\u8def\u5f84\uff0c\u53ef\u4ee5\u7528file\uff0cftp\uff0chttp \u7528\u540e\u9762\u4e24\u4e2a\u5fc5\u987b\u5f00\u542f\u76f8\u5e94\u7684\u670d\u52a1\u3002File\u53ef\u4ee5\u7528\u6765\u505a\u672c\u5730\u4ed3\u5e93\u3002\u4e00\u5b9a\u8981\u4fdd\u8bc1\u8def\u5f84\u53ef\u8fbe)<\/code> 6.<code>gpgkey=file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-CentOS-7#\u5f00\u542fgpgcheck\u540e\uff0c\u901a\u8fc7gpgkey\u6765\u6307\u5b9a\uff0c\u76f8\u5e94\u7684gpg\u6587\u4ef6,\u5982\u679c\u4e0d\u6307\u5b9agpgkey\u6587\u4ef6\uff0c\u90a3\u4e48\u5c31\u5fc5\u987b\u624b\u52a8\u7684\u5bfc\u5165\u76f8\u5e94\u7684gpg\u6587\u4ef6<\/code> 7. \u6267\u884c\u547d\u4ee4\uff1a<code>yum install net-tools<\/code>\uff0c\u56e0\u4e3aifconfig\u5728net-tools\u91cc\u9762\uff0c\u6240\u4ee5\u9700\u8981\u5b89\u88c5\u8fd9\u4e2a\u5305\u3002\u00a0 8. \u597d\u4e86\uff0c\u81f3\u6b64\u5b8c\u6210\u89e3\u51b3\u4e86\uff01\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u914d\u7f6eyum\u6e90\uff08\u672c\u5730\uff09 \u6302\u8f7d\u7cfb\u7edf\u5b89\u88c5\u5149\u76d8mount \/dev\/cdrom \/mnt\/cdrom\/ \u5728linux  &#8230; <a title=\"\u89e3\u51b3CentOS7 \u5b89\u88c5\u8ff7\u4f60\u7248\u540e\uff0c\u6ca1\u6709ifconfig\u547d\u4ee4\u7684\u529e\u6cd5\" class=\"read-more\" href=\"https:\/\/cn.hostease.com\/xueyuan\/jishu\/linux\/%e8%a7%a3%e5%86%b3centos7-%e5%ae%89%e8%a3%85%e8%bf%b7%e4%bd%a0%e7%89%88%e5%90%8e%ef%bc%8c%e6%b2%a1%e6%9c%89ifconfig%e5%91%bd%e4%bb%a4%e7%9a%84%e5%8a%9e%e6%b3%95\/\" aria-label=\"\u9605\u8bfb \u89e3\u51b3CentOS7 \u5b89\u88c5\u8ff7\u4f60\u7248\u540e\uff0c\u6ca1\u6709ifconfig\u547d\u4ee4\u7684\u529e\u6cd5\">\u9605\u8bfb\u66f4\u591a<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[49],"tags":[734],"class_list":["post-2507","post","type-post","status-publish","format-standard","hentry","category-linux","tag-yumifconfig"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts\/2507","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/comments?post=2507"}],"version-history":[{"count":2,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts\/2507\/revisions"}],"predecessor-version":[{"id":2509,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts\/2507\/revisions\/2509"}],"wp:attachment":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/media?parent=2507"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/categories?post=2507"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/tags?post=2507"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}