{"id":260,"date":"2013-09-11T22:58:54","date_gmt":"2013-09-11T13:58:54","guid":{"rendered":"http:\/\/www.chihayafuru.jp\/tech\/?p=260"},"modified":"2017-02-13T14:24:05","modified_gmt":"2017-02-13T05:24:05","slug":"macos-x-%e9%9d%99%e7%9a%84%e3%83%ab%e3%83%bc%e3%83%86%e3%82%a3%e3%83%b3%e3%82%b0%e8%a8%ad%e5%ae%9a","status":"publish","type":"post","link":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/archives\/260","title":{"rendered":"MacOS X : \u9759\u7684\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u8a2d\u5b9a"},"content":{"rendered":"<h2>A. \u4e00\u6642\u7684\u306a\u9759\u7684\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u8a2d\u5b9a<\/h2>\n<h3>\u66f8\u5f0f<\/h3>\n<pre class=\"lang:sh decode:true \" >$ sudo route add -net [network] [gateway]<\/pre>\n<h3>\u4f8b<\/h3>\n<pre class=\"lang:sh decode:true \" >$ sudo route add -net 10.0.1.0\/24 192.168.0.1<\/pre>\n<p><!--more--><br \/>\n<\/p>\n<h2>B. \u6052\u5e38\u7684\u306a\u9759\u7684\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u8a2d\u5b9a<\/h2>\n<h3>1. StartupItems \u306b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3059\u308b<\/h3>\n<pre class=\"lang:sh decode:true \" >$ sudo mkdir \/Library\/StartupItems\/AddRoute<\/pre>\n<h3>2. \u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f5c\u6210\u3059\u308b<\/h3>\n<pre class=\"lang:sh decode:true \" >$ sudo vi \/Library\/StartupItems\/AddRoute\/AddRoute<\/pre>\n<pre class=\"lang:sh decode:true \" >#!\/bin\/sh\r\n# set up static routing tables \r\n\r\n. \/etc\/rc.common\r\n\r\nStartService () {\r\n  ConsoleMessage \"Adding Static Routing Tables\"\r\n  route add -net 10.0.50.0\/24 10.8.196.1\r\n}\r\n\r\nStopService () {\r\n  return 0\r\n}\r\n\r\nRestartService () {\r\n  return 0\r\n}\r\n\r\nRunService \"$1\"<\/pre>\n<h3>3. plist\u3092\u4f5c\u6210\u3059\u308b<\/h3>\n<pre class=\"lang:sh decode:true \" >$ sudo vi \/Library\/StartupItems\/AddRoute\/StartupParameters.plist<\/pre>\n<pre class=\"lang:default decode:true \" ><?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<!DOCTYPE plist PUBLIC \"-\/\/Apple\/\/DTD PLIST 1.0\/\/EN\" \"http:\/\/www.apple.com\/DTDs\/PropertyList-1.0.dtd\">\r\n<plist version=\"1.0\">\r\n  <dict>\r\n    <key>Description<\/key>\r\n    <string>Adding routes to external Services<\/string>\r\n    <key>OrderPreference<\/key>\r\n    <string>Last<\/string>\r\n    <key>Provides<\/key>\r\n    <array>\r\n      <string>AddRoutes<\/string>\r\n    <\/array>\r\n    <key>Uses<\/key>\r\n    <array>\r\n      <string>Network<\/string>\r\n    <\/array>\r\n  <\/dict>\r\n<\/plist>\r\n<\/pre>\n<h3>4. \u30d5\u30a1\u30a4\u30eb\u30a2\u30af\u30bb\u30b9\u6a29\u3092\u5909\u66f4\u3059\u308b<\/h3>\n<pre class=\"lang:sh decode:true \" >$ chmod 755 \/Library\/StartupItems\/AddRoute\r\n$ chmod 755 \/Library\/StartupItems\/AddRoute\/AddRoute\r\n$ chmod 644 \/Library\/StartupItems\/AddRoute\/StartupParameters.plist<\/pre>\n<p><\/p>\n<h2>C. \u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u30a2\u30c9\u30ec\u30b9\u78ba\u8a8d<\/h2>\n<pre class=\"lang:sh decode:true \" >$ netstat -rn<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>A. \u4e00\u6642\u7684\u306a\u9759\u7684\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u8a2d\u5b9a \u66f8\u5f0f $ sudo route add -net [network] [gateway] \u4f8b $ sudo route add -net 10.0.1.0\/24 192.168.0.1<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[5],"class_list":["post-260","post","type-post","status-publish","format-standard","hentry","category-memo","tag-mac"],"_links":{"self":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/260","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/comments?post=260"}],"version-history":[{"count":18,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/260\/revisions"}],"predecessor-version":[{"id":282,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/260\/revisions\/282"}],"wp:attachment":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/media?parent=260"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/categories?post=260"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/tags?post=260"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}