{"id":389,"date":"2018-03-14T15:07:47","date_gmt":"2018-03-14T07:07:47","guid":{"rendered":"http:\/\/www.max-shu.com\/blog\/?p=389"},"modified":"2018-03-14T15:07:47","modified_gmt":"2018-03-14T07:07:47","slug":"centos%e6%b0%b8%e4%b9%85%e4%bf%9d%e5%ad%98%e5%a4%9a%e4%b8%aa%e9%9d%99%e6%80%81%e8%b7%af%e7%94%b1%ef%bc%8c%e9%87%8d%e5%90%afnetwork%e6%9c%8d%e5%8a%a1%e4%b8%8d%e4%b8%a2%e5%a4%b1","status":"publish","type":"post","link":"http:\/\/www.max-shu.com\/blog\/?p=389","title":{"rendered":"CentOS\u6c38\u4e45\u4fdd\u5b58\u591a\u4e2a\u9759\u6001\u8def\u7531\uff0c\u91cd\u542fnetwork\u670d\u52a1\u4e0d\u4e22\u5931"},"content":{"rendered":"<div>\u65b0\u5efa\u4e00\u4e2a\u6587\u4ef6\uff0c\u628a\u8def\u7531\u5199\u5230\u8fd9\u4e2a\u6587\u4ef6\u91cc\u5373\u53ef\uff1a<\/div>\n<div><\/div>\n<div><span style=\"color: #ff0000;\"># vi \/etc\/sysconfig\/static-routes<br \/>\nany net 10.11.0.0 netmask 255.255.0.0 gw 10.11.101.254<\/span><\/div>\n<div><\/div>\n<div><\/div>\n<div>\n<p><span style=\"color: #000102; font-family: Arial;\">static-routes\u5176\u5b9e\u5728\u88abnetwork\u8fd9\u4e2a\u811a\u672c\u8c03\u7528\u7684\uff0c\u6253\u5f00\u8fd9\u4e2a\u811a\u672c\uff1a<\/span><\/p>\n<p><span style=\"color: #000102; font-family: Arial;\">\/etc\/rc.d\/init.d\/network\u00a0<\/span><\/p>\n<p><span style=\"color: #000102; font-family: Arial;\">\u91cc\u9762\u6709\u5199\u5230\uff1a<\/span><\/p>\n<p># Add non interface-specific static-routes.<br \/>\nif [ -f \/etc\/sysconfig\/static-routes ]; then<br \/>\ngrep\u00a0&#8220;^any&#8221; \/etc\/sysconfig\/static-routes | while read ignore args ; do<br \/>\n\/sbin\/route add -$args<br \/>\ndone<br \/>\nfi<\/p>\n<p><span style=\"color: #333333; font-family: Arial;\">network\u5728\u6267\u884c\u7684\u65f6\u5019\u5230<\/span>static-routes\u91cc\u9762\u5bfb\u627eany\u5f00\u5934\u7684\u884c\uff0c\u7136\u540e\u6267\u884c<\/p>\n<p>\/sbin\/route add -$args \u76f8\u5f53\u4e8e\u624b\u52a8\u6267\u884c\u4e86route add\u811a\u672c\uff0c\u90a3\u540e\u9762\u4e8b\u60c5\u5c31\u7b80\u5355\u4e86\uff0c\u56de\u5230\u4e86\u624b\u52a8\u6267\u884c\u7684\u65b9\u5f0f\uff0c\u6839\u636e\u524d\u9762\u7684\u8bf4\u660e\uff0c\u6b63\u786e\u7684\u811a\u672c\u5c31\u662f\uff1a<\/p>\n<p>any host 10.0.0.10 gw 192.168.1.1<\/p>\n<p>network\u6267\u884c\u7684\u65f6\u5019\u628aany\u53bb\u6389\uff0c\u83b7\u53d6\u540e\u9762\u7684\u53c2\u6570\uff1ahost 10.0.0.10 gw 192.168.1.1<\/p>\n<p>\u7136\u540e\u6267\u884c<span style=\"color: #ff0102;\">route add &#8211;<\/span>host 10.0.0.10 gw 192.168.1.1<\/p>\n<p><span style=\"color: #333333; font-family: Arial;\">\u6ce8\u610f\u8fd9\u91cchost\u524d\u9762\u7684-\u662fnetwork\u81ea\u5e26\u7684\uff0c\u4e0d\u9700\u8981\u914d\u7f6e\u5230static-routes\u6587\u4ef6\u4e2d\u3002<\/span><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u65b0\u5efa\u4e00\u4e2a\u6587\u4ef6\uff0c\u628a\u8def\u7531\u5199\u5230\u8fd9\u4e2a\u6587\u4ef6\u91cc\u5373\u53ef\uff1a # vi \/etc\/sysconfig\/static-routes  &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15,186],"tags":[9,315,313,314],"class_list":["post-389","post","type-post","status-publish","format-standard","hentry","category-linuxandroid","category-186","tag-linux","tag-315","tag-313","tag-314"],"views":2219,"_links":{"self":[{"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/389","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=389"}],"version-history":[{"count":1,"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/389\/revisions"}],"predecessor-version":[{"id":390,"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/389\/revisions\/390"}],"wp:attachment":[{"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=389"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=389"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=389"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}