<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>NTP &#8211; 不知火ねっとわーくらぼ</title>
	<atom:link href="https://shiranui-nw-lab.com/tag/ntp/feed/" rel="self" type="application/rss+xml" />
	<link>https://shiranui-nw-lab.com</link>
	<description>フリーランスネットワークエンジニアのポートフォリオ兼ブログです。</description>
	<lastBuildDate>Wed, 17 Jul 2019 01:53:28 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.5</generator>

<image>
	<url>https://shiranui-nw-lab.com/wp-content/uploads/2019/08/cropped-favicon-2-32x32.png</url>
	<title>NTP &#8211; 不知火ねっとわーくらぼ</title>
	<link>https://shiranui-nw-lab.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Ciscoルータ PAT(NAT)環境でのNTPのポート変換について</title>
		<link>https://shiranui-nw-lab.com/cisco%e3%83%ab%e3%83%bc%e3%82%bf-patnat%e7%92%b0%e5%a2%83%e3%81%a7%e3%81%aentp%e3%81%ae%e3%83%9d%e3%83%bc%e3%83%88%e5%a4%89%e6%8f%9b%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6/</link>
					<comments>https://shiranui-nw-lab.com/cisco%e3%83%ab%e3%83%bc%e3%82%bf-patnat%e7%92%b0%e5%a2%83%e3%81%a7%e3%81%aentp%e3%81%ae%e3%83%9d%e3%83%bc%e3%83%88%e5%a4%89%e6%8f%9b%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Wed, 17 Jul 2019 01:50:33 +0000</pubDate>
				<category><![CDATA[Cisco]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[NTP]]></category>
		<guid isPermaLink="false">https://shiranui-nw-lab.com/?p=313</guid>

					<description><![CDATA[<p><img src="https://shiranui-nw-lab.com/wp-content/uploads/2019/05/background-3228704_1920-1024x435.jpg" class="webfeedsFeaturedVisual" /></p>CiscoルータでのPAT(NAT)環境で配下のPCからNTPを使おうとしたらハマったのでそのメモです。 PAT(NAT)環境でのポート変換でなぜかウェルノウンポートにして外に通信してしまう事象が発生しました。 構成 N [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><img src="https://shiranui-nw-lab.com/wp-content/uploads/2019/05/background-3228704_1920-1024x435.jpg" class="webfeedsFeaturedVisual" /></p><p>CiscoルータでのPAT(NAT)環境で配下のPCからNTPを使おうとしたらハマったのでそのメモです。</p>
<p>PAT(NAT)環境でのポート変換でなぜかウェルノウンポートにして外に通信してしまう事象が発生しました。</p>
<h2>構成</h2>
<p>NTPサーバ(NICTやmfeedなど)ーーインターネットーーCiscoルーターーーークライアント(PCなど)複数台</p>
<ul>
<li>NTPサーバのIP : 1.1.1.1(仮)</li>
<li>GlobalIP(NAT後のIP) : 2.2.2.2(仮)</li>
<li>クライアントのIP : 10.0.0.1-100</li>
</ul>
<p>グローバルIPは1つしかないのでクライアントからNTPサーバ宛のアクセスは全てマスカレードしています。</p>
<h2>普通のPAT(NAT)の挙動</h2>
<p>show ip nat translationsで確認</p>
<table>
<thead>
<tr>
<th>Inside global</th>
<th>Inside local</th>
<th>備考</th>
</tr>
</thead>
<tbody>
<tr>
<td>1.1.1.1:47289</td>
<td>10.0.0.1:47289</td>
<td>ポートが空いていれば内部ローカルと同じポート番号で外に出ていく</td>
</tr>
<tr>
<td>1.1.1.1:47290</td>
<td>10.0.0.2:47289</td>
<td>ポートが埋まっている場合は別のポート番号(ウェルノウンポート以外)で出ていく</td>
</tr>
</tbody>
</table>
<h2>NTPアクセス時の挙動</h2>
<p>show ip nat translationsで確認</p>
<table>
<thead>
<tr>
<th>Inside global</th>
<th>Inside local</th>
<th>備考</th>
</tr>
</thead>
<tbody>
<tr>
<td>1.1.1.1:123</td>
<td>10.0.0.1:123</td>
<td>ポートが空いていれば内部ローカルと同じポート番号で外に出ていく</td>
</tr>
<tr>
<td>1.1.1.1:20</td>
<td>10.0.0.2:123</td>
<td>ポートが埋まっている場合は別のポート番号(ウェルノウンポート)で出ていってしまう</td>
</tr>
</tbody>
</table>
<h2>問題点</h2>
<p>クライアントの送信元ポートが123(NTP)の場合なぜかウェルノウンポートに変換されます。<br />
このウェルノウンポートを使って出ていくのが結構やっかいで、場所によっては時間を取らせてくれません。<br />
今回の例で20番ポートに変換されてしまったクライアントはNATテーブルが空くまでひたすらエラーを繰り返します。</p>
<h2>結論</h2>
<p>Ciscoルータの動作仕様とのことです。<br />
これの対策はStatic NATを使用するしかないため、PAT環境では対処ができません。</p>
<h2><a class="keyword" href="http://d.hatena.ne.jp/keyword/%A5%EF%A1%BC%A5%AF%A5%A2%A5%E9%A5%A6%A5%F3%A5%C9">ワークアラウンド</a></h2>
<p>NATテーブルの保持時間がデフォルトで10分(6000秒)なので、これを10秒など極端に短くすることでクライアント同士のNTP取得タイミングがかぶる確率を減らすくらいしかなさそうです。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://shiranui-nw-lab.com/cisco%e3%83%ab%e3%83%bc%e3%82%bf-patnat%e7%92%b0%e5%a2%83%e3%81%a7%e3%81%aentp%e3%81%ae%e3%83%9d%e3%83%bc%e3%83%88%e5%a4%89%e6%8f%9b%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
