<?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>ポートフォワード  |  塞翁失馬</title>
	<atom:link href="https://hbirds.mydns.jp/tag/%E3%83%9D%E3%83%BC%E3%83%88%E3%83%95%E3%82%A9%E3%83%AF%E3%83%BC%E3%83%89/feed/" rel="self" type="application/rss+xml" />
	<link>https://hbirds.mydns.jp</link>
	<description>禍福は糾える縄の如し</description>
	<lastBuildDate>Sat, 31 Dec 2022 08:29:09 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6</generator>

<image>
	<url>https://hbirds.mydns.jp/wp-content/uploads/2022/12/cropped-akaza-32x32.png</url>
	<title>ポートフォワード  |  塞翁失馬</title>
	<link>https://hbirds.mydns.jp</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>内部からアクセスできるのに外部からできない</title>
		<link>https://hbirds.mydns.jp/%e5%86%85%e9%83%a8%e3%81%8b%e3%82%89%e3%82%a2%e3%82%af%e3%82%bb%e3%82%b9%e3%81%a7%e3%81%8d%e3%82%8b%e3%81%ae%e3%81%ab%e5%a4%96%e9%83%a8%e3%81%8b%e3%82%89%e3%81%a7%e3%81%8d%e3%81%aa%e3%81%84/</link>
		
		<dc:creator><![CDATA[hbirds]]></dc:creator>
		<pubDate>Sat, 24 Dec 2022 19:49:49 +0000</pubDate>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[ポートフォワード]]></category>
		<guid isPermaLink="false">http://hbirds.mydns.jp/?p=98</guid>

					<description><![CDATA[自宅サーバーに内部からアクセスできるということは、サーバー自体の問題ではなく、外(WAN)と内(LAN)をつなぐルーター側の問題。 具体的には、ルーターのポートフォワーディングが設定できていなかったため、外からのアクセス要求が処理できなかったことによる。以下のとおり、転送先（仮想ホストのアドレス）は、以前に稼働させていたサーバーのIP：192.168.0.150のままになっている。今回のWEBサーバーは、hbirds.mydns.jp:192.168.0.200に固定IPをセットしたため到達できないこととなった。両方のIPを合致させればエラーは解消できるはず。今回はルーター側のフォワード先を192.168.0.200に変更する。 以下は、CMANのポートチェックの実行結果。当たり前のように「アクセスできませんでした」となっている。 以下のように変更。 結果、「アクセスできました」となり無事に疎通を確認。 一方で、443のポートチェックをすると以下のようにエラーが出る。もちろん、ルータ側でもサーバー側でもポート開放やフォワーディングはできている。これは、サーバー側のnginxで443を受ける設定（sites-availableのdefaut)をしていないからと思われる。 実際に以下のとおり、certbotの設定をおこなうと無事にアクセスできました。]]></description>
										<content:encoded><![CDATA[
<p>自宅サーバーに内部からアクセスできるということは、サーバー自体の問題ではなく、外(WAN)と内(LAN)をつなぐルーター側の問題。</p>



<p>具体的には、ルーターのポートフォワーディングが設定できていなかったため、外からのアクセス要求が処理できなかったことによる。以下のとおり、転送先（仮想ホストのアドレス）は、以前に稼働させていたサーバーのIP：192.168.0.150のままになっている。今回のWEBサーバーは、hbirds.mydns.jp:192.168.0.200に固定IPをセットしたため到達できないこととなった。両方のIPを合致させればエラーは解消できるはず。今回はルーター側のフォワード先を192.168.0.200に変更する。</p>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="695" height="577" src="https://hbirds.mydns.jp/wp-content/uploads/2022/12/Screenshot-from-2022-12-25-04-37-44.png" alt="" class="wp-image-99" srcset="https://hbirds.mydns.jp/wp-content/uploads/2022/12/Screenshot-from-2022-12-25-04-37-44.png 695w, https://hbirds.mydns.jp/wp-content/uploads/2022/12/Screenshot-from-2022-12-25-04-37-44-300x249.png 300w" sizes="(max-width: 695px) 100vw, 695px" /></figure>



<p>以下は、CMANのポートチェックの実行結果。当たり前のように「アクセスできませんでした」となっている。</p>



<figure class="wp-block-image size-full"><img decoding="async" width="919" height="594" src="https://hbirds.mydns.jp/wp-content/uploads/2022/12/Screenshot-from-2022-12-25-04-51-36.png" alt="" class="wp-image-101" srcset="https://hbirds.mydns.jp/wp-content/uploads/2022/12/Screenshot-from-2022-12-25-04-51-36.png 919w, https://hbirds.mydns.jp/wp-content/uploads/2022/12/Screenshot-from-2022-12-25-04-51-36-300x194.png 300w, https://hbirds.mydns.jp/wp-content/uploads/2022/12/Screenshot-from-2022-12-25-04-51-36-768x496.png 768w" sizes="(max-width: 919px) 100vw, 919px" /></figure>



<p>以下のように変更。</p>



<figure class="wp-block-image size-full"><img decoding="async" width="587" height="408" src="https://hbirds.mydns.jp/wp-content/uploads/2022/12/Screenshot-from-2022-12-25-04-55-13.png" alt="" class="wp-image-104" srcset="https://hbirds.mydns.jp/wp-content/uploads/2022/12/Screenshot-from-2022-12-25-04-55-13.png 587w, https://hbirds.mydns.jp/wp-content/uploads/2022/12/Screenshot-from-2022-12-25-04-55-13-300x209.png 300w" sizes="(max-width: 587px) 100vw, 587px" /></figure>



<p>結果、「アクセスできました」となり無事に疎通を確認。</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="913" height="600" src="https://hbirds.mydns.jp/wp-content/uploads/2022/12/Screenshot-from-2022-12-25-04-58-59.png" alt="" class="wp-image-107" srcset="https://hbirds.mydns.jp/wp-content/uploads/2022/12/Screenshot-from-2022-12-25-04-58-59.png 913w, https://hbirds.mydns.jp/wp-content/uploads/2022/12/Screenshot-from-2022-12-25-04-58-59-300x197.png 300w, https://hbirds.mydns.jp/wp-content/uploads/2022/12/Screenshot-from-2022-12-25-04-58-59-768x505.png 768w" sizes="(max-width: 913px) 100vw, 913px" /></figure>



<p>一方で、443のポートチェックをすると以下のようにエラーが出る。もちろん、ルータ側でもサーバー側でもポート開放やフォワーディングはできている。これは、サーバー側のnginxで443を受ける設定（sites-availableのdefaut)をしていないからと思われる。</p>



<p>実際に以下のとおり、certbotの設定をおこなうと無事にアクセスできました。</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="862" height="524" src="https://hbirds.mydns.jp/wp-content/uploads/2022/12/Screenshot-from-2022-12-25-05-16-45.png" alt="" class="wp-image-111" srcset="https://hbirds.mydns.jp/wp-content/uploads/2022/12/Screenshot-from-2022-12-25-05-16-45.png 862w, https://hbirds.mydns.jp/wp-content/uploads/2022/12/Screenshot-from-2022-12-25-05-16-45-300x182.png 300w, https://hbirds.mydns.jp/wp-content/uploads/2022/12/Screenshot-from-2022-12-25-05-16-45-768x467.png 768w" sizes="(max-width: 862px) 100vw, 862px" /></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="913" height="600" src="https://hbirds.mydns.jp/wp-content/uploads/2022/12/Screenshot-from-2022-12-25-05-14-22.png" alt="" class="wp-image-112" srcset="https://hbirds.mydns.jp/wp-content/uploads/2022/12/Screenshot-from-2022-12-25-05-14-22.png 913w, https://hbirds.mydns.jp/wp-content/uploads/2022/12/Screenshot-from-2022-12-25-05-14-22-300x197.png 300w, https://hbirds.mydns.jp/wp-content/uploads/2022/12/Screenshot-from-2022-12-25-05-14-22-768x505.png 768w" sizes="(max-width: 913px) 100vw, 913px" /></figure>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
