﻿{"id":1498,"date":"2017-01-17T15:47:04","date_gmt":"2017-01-17T07:47:04","guid":{"rendered":"http:\/\/nick.txtcc.com\/?p=1498"},"modified":"2017-01-17T15:47:04","modified_gmt":"2017-01-17T07:47:04","slug":"ubuntu%e8%a7%a3%e5%86%b3rtnetlink-answers-file-exists","status":"publish","type":"post","link":"http:\/\/nick.txtcc.com\/index.php\/linux\/1498","title":{"rendered":"Ubuntu\u89e3\u51b3RTNETLINK answers: File exists"},"content":{"rendered":"<h2>\u51fa\u73b0\u8fd9\u79cd\u95ee\u9898\u6709\u4e24\u79cd\u539f\u56e0<\/h2>\n<h3>1.\u6709\u4e24\u4e2a\u7f51\u5173\u65f6\u5019<\/h3>\n<p>\u5728ip\u5730\u5740\u914d\u7f6e\u4e2d\u6709\u4e24\u4e2a\u7f51\u5173<\/p>\n<pre class=\"hljs nginx\"><code>    &lt;span class=&quot;hljs-title&quot;&gt;auto&lt;\/span&gt; eth0\n    iface eth0 inet static\n    address &lt;span class=&quot;hljs-number&quot;&gt;192.168.5.21&lt;\/span&gt;\n    netmask &lt;span class=&quot;hljs-number&quot;&gt;255&lt;\/span&gt;.&lt;span class=&quot;hljs-number&quot;&gt;255&lt;\/span&gt;.&lt;span class=&quot;hljs-number&quot;&gt;2550&lt;\/span&gt;\n    gateway &lt;span class=&quot;hljs-number&quot;&gt;192.168.5.1&lt;\/span&gt;\n\n    &lt;span class=&quot;hljs-comment&quot;&gt;# VM traffic interface&lt;\/span&gt;\n    auto eth1\n    iface eth1 inet static\n    address &lt;span class=&quot;hljs-number&quot;&gt;192.168.5.22&lt;\/span&gt;\n    netmask &lt;span class=&quot;hljs-number&quot;&gt;255.255.255.0&lt;\/span&gt;\n    gateway &lt;span class=&quot;hljs-number&quot;&gt;192.168.5.1&lt;\/span&gt;\n<\/code>\n<\/pre>\n<p><code>eth0<\/code>\u548c<code>eth1<\/code>\u6709\u4e0d\u540cip\u4f46\u662f\u6709\u90fd\u914d\u7f6e\u7684\u7f51\u5173,\u8fd9\u65f6\u5019\u4e00\u4e2a\u542f\u52a8\u540e,\u53e6\u4e00\u4e2a\u542f\u52a8\u5931\u8d25<\/p>\n<pre class=\"hljs css\"><code>&lt;span class=&quot;hljs-tag&quot;&gt;RTNETLINK&lt;\/span&gt; &lt;span class=&quot;hljs-rule&quot;&gt;&lt;span class=&quot;hljs-attribute&quot;&gt;answers&lt;\/span&gt;:&lt;span class=&quot;hljs-value&quot;&gt; File exists\nFailed to bring up eth2.\n&lt;\/span&gt;&lt;\/span&gt;<\/code>\n<\/pre>\n<p>\u5982\u679c\u4f60\u4fee\u6539\u540e,\u8fd8\u662f\u51fa\u73b0\u8fd9\u79cd\u60c5\u51b5,\u5c31\u8981\u5bf9<code>eth0<\/code>\u548c<code>eth1<\/code>\u8fdb\u884c\u4e0b\u5237\u65b0<\/p>\n<pre class=\"hljs sql\"><code>    ip addr &lt;span class=&quot;hljs-operator&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;flush&lt;\/span&gt; dev eth0\n    ip addre &lt;span class=&quot;hljs-keyword&quot;&gt;flush&lt;\/span&gt; dev eth1\n    ifdown eth0 &amp;&amp; ifup eth0 &amp;&amp; ifdown eth1 &amp;&amp; ifup eth1\n&lt;\/span&gt;<\/code>\n<\/pre>\n<h3>2.\u5f53\u5220\u9664\u6865\u63a5\u6216\u8005\u5176\u4ed6,\u628a\u7f51\u7edc\u6539\u6b63\u786e,\u8fd8\u662f\u51fa\u73b0\u8fd9\u79cd\u95ee\u9898<\/h3>\n<pre class=\"hljs nginx\"><code>&lt;span class=&quot;hljs-comment&quot;&gt;#\u786e\u4fdd\u7f51\u7edc\u914d\u7f6e\u5df2\u7ecf\u6b63\u786e\u7684\u60c5\u51b5\u4e0b&lt;\/span&gt;\n&lt;span class=&quot;hljs-title&quot;&gt;ip&lt;\/span&gt; addr flush dev eth0\n&lt;span class=&quot;hljs-comment&quot;&gt;#\u91cd\u542f\u7f51\u7edc\u914d\u7f6e&lt;\/span&gt;\n<\/code>\n<\/pre>\n<blockquote><code>ip addr flush<\/code> also dumps all the deleted addresses in the format described in the previous subsection\n\u8fd9\u4e2a\u547d\u4ee4\u5237\u65b0\u5df2\u7ecf\u5220\u9664\u7684\u5148\u524d\u5df2\u7ecf\u9009\u62e9\u7684\u5730\u5740\u683c\u5f0f<\/blockquote>","protected":false},"excerpt":{"rendered":"<p>\u51fa\u73b0\u8fd9\u79cd\u95ee\u9898\u6709\u4e24\u79cd\u539f\u56e0 1.\u6709\u4e24\u4e2a\u7f51\u5173\u65f6\u5019 \u5728ip\u5730\u5740\u914d\u7f6e\u4e2d\u6709\u4e24\u4e2a\u7f51\u5173 <span class=\"hljs-title\">auto<\/span> eth0 &#46;&#46;&#46;<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[466,7],"class_list":["post-1498","post","type-post","status-publish","format-standard","hentry","category-linux","tag-rtnetlink","tag-ubuntu"],"_links":{"self":[{"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts\/1498","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/comments?post=1498"}],"version-history":[{"count":1,"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts\/1498\/revisions"}],"predecessor-version":[{"id":1499,"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts\/1498\/revisions\/1499"}],"wp:attachment":[{"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/media?parent=1498"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/categories?post=1498"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/tags?post=1498"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}