<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
	<id>https://ja.wikiducca.org/w/index.php?action=history&amp;feed=atom&amp;title=Mac_%E3%81%AE_VPN%28L2TP%29_%E6%8E%A5%E7%B6%9A%E6%99%82%E3%81%AB%E8%87%AA%E5%8B%95%E3%81%A7_route_%E3%82%92%E5%AE%9F%E8%A1%8C%E3%81%95%E3%81%9B%E3%82%8B%E6%96%B9%E6%B3%95</id>
	<title>Mac の VPN(L2TP) 接続時に自動で route を実行させる方法 - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://ja.wikiducca.org/w/index.php?action=history&amp;feed=atom&amp;title=Mac_%E3%81%AE_VPN%28L2TP%29_%E6%8E%A5%E7%B6%9A%E6%99%82%E3%81%AB%E8%87%AA%E5%8B%95%E3%81%A7_route_%E3%82%92%E5%AE%9F%E8%A1%8C%E3%81%95%E3%81%9B%E3%82%8B%E6%96%B9%E6%B3%95"/>
	<link rel="alternate" type="text/html" href="https://ja.wikiducca.org/w/index.php?title=Mac_%E3%81%AE_VPN(L2TP)_%E6%8E%A5%E7%B6%9A%E6%99%82%E3%81%AB%E8%87%AA%E5%8B%95%E3%81%A7_route_%E3%82%92%E5%AE%9F%E8%A1%8C%E3%81%95%E3%81%9B%E3%82%8B%E6%96%B9%E6%B3%95&amp;action=history"/>
	<updated>2026-09-20T23:39:42Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://ja.wikiducca.org/w/index.php?title=Mac_%E3%81%AE_VPN(L2TP)_%E6%8E%A5%E7%B6%9A%E6%99%82%E3%81%AB%E8%87%AA%E5%8B%95%E3%81%A7_route_%E3%82%92%E5%AE%9F%E8%A1%8C%E3%81%95%E3%81%9B%E3%82%8B%E6%96%B9%E6%B3%95&amp;diff=17038&amp;oldid=prev</id>
		<title>Yosuke: リンク修正</title>
		<link rel="alternate" type="text/html" href="https://ja.wikiducca.org/w/index.php?title=Mac_%E3%81%AE_VPN(L2TP)_%E6%8E%A5%E7%B6%9A%E6%99%82%E3%81%AB%E8%87%AA%E5%8B%95%E3%81%A7_route_%E3%82%92%E5%AE%9F%E8%A1%8C%E3%81%95%E3%81%9B%E3%82%8B%E6%96%B9%E6%B3%95&amp;diff=17038&amp;oldid=prev"/>
		<updated>2020-09-15T01:27:26Z</updated>

		<summary type="html">&lt;p&gt;リンク修正&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ja&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← 古い版&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2020年9月15日 (火) 10:27時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l49&quot;&gt;49行目:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;49行目:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== 参考・引用 ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== 参考・引用 ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;- https://discussionsjapan.apple.com/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;message&lt;/del&gt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;100557269&lt;/del&gt;#&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;100557269&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;- https://discussionsjapan.apple.com/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;thread&lt;/ins&gt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;10088702?answerId=100557269122&lt;/ins&gt;#&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;100557269122&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Mac]][[Category:シェルスクリプト]][[Category:ネットワーク]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Mac]][[Category:シェルスクリプト]][[Category:ネットワーク]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key mw_db-mw_:diff:1.41:old-17037:rev-17038:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Yosuke</name></author>
	</entry>
	<entry>
		<id>https://ja.wikiducca.org/w/index.php?title=Mac_%E3%81%AE_VPN(L2TP)_%E6%8E%A5%E7%B6%9A%E6%99%82%E3%81%AB%E8%87%AA%E5%8B%95%E3%81%A7_route_%E3%82%92%E5%AE%9F%E8%A1%8C%E3%81%95%E3%81%9B%E3%82%8B%E6%96%B9%E6%B3%95&amp;diff=17037&amp;oldid=prev</id>
		<title>Yosuke: ページの作成:「 == 概要 == iPhone のテザリング（各キャリア共通？） &amp; Mac という環境で、特定の VPN 環境に接続するためには、毎回 route コマン...」</title>
		<link rel="alternate" type="text/html" href="https://ja.wikiducca.org/w/index.php?title=Mac_%E3%81%AE_VPN(L2TP)_%E6%8E%A5%E7%B6%9A%E6%99%82%E3%81%AB%E8%87%AA%E5%8B%95%E3%81%A7_route_%E3%82%92%E5%AE%9F%E8%A1%8C%E3%81%95%E3%81%9B%E3%82%8B%E6%96%B9%E6%B3%95&amp;diff=17037&amp;oldid=prev"/>
		<updated>2020-09-15T01:23:39Z</updated>

		<summary type="html">&lt;p&gt;ページの作成:「 == 概要 == iPhone のテザリング（各キャリア共通？） &amp;amp; Mac という環境で、特定の VPN 環境に接続するためには、毎回 route コマン...」&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
== 概要 ==&lt;br /&gt;
iPhone のテザリング（各キャリア共通？） &amp;amp; Mac という環境で、特定の VPN 環境に接続するためには、毎回 route コマンドで、各セグメントへの経路を追加してやる必要がある。  &lt;br /&gt;
&lt;br /&gt;
この作業を自動化するための手順。&lt;br /&gt;
&lt;br /&gt;
=== 特定のVPNの例 ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
172.20.100.0/24&lt;br /&gt;
172.20.101.0/24&lt;br /&gt;
172.20.102.0/24&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== シェルスクリプトを作成 ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo vi /etc/ppp/ip-up&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ip-up の中身 ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
#&lt;br /&gt;
# $1 interface-name&lt;br /&gt;
# $2 tty-device&lt;br /&gt;
# $3 speed&lt;br /&gt;
# $4 local-IP-address&lt;br /&gt;
# $5 remote-IP-address&lt;br /&gt;
# $6 ipparam&lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;$1&amp;quot; = &amp;quot;ppp0&amp;quot; ]; then&lt;br /&gt;
    /sbin/route add 172.20.100.0/24 -interface ppp0&lt;br /&gt;
    /sbin/route add 172.20.101.0/24 -interface ppp0&lt;br /&gt;
    /sbin/route add 172.20.102.0/24 -interface ppp0&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 実行権限をつける ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo chmod +x /etc/ppp/ip-up&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
以上で、ppp0 インターフェイスが起動した際、上記のスクリプトが実行され、 route add されるようになる。&lt;br /&gt;
&lt;br /&gt;
== その他・メモ ==&lt;br /&gt;
VPN を切断する(ppp0 インターフェイスが落ちる)と、自動的に設定は消えるため、後片付けは不要。&lt;br /&gt;
&lt;br /&gt;
== 参考・引用 ==&lt;br /&gt;
- https://discussionsjapan.apple.com/message/100557269#100557269&lt;br /&gt;
&lt;br /&gt;
[[Category:Mac]][[Category:シェルスクリプト]][[Category:ネットワーク]]&lt;/div&gt;</summary>
		<author><name>Yosuke</name></author>
	</entry>
</feed>