<?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>網路 &#8211; 備忘程式碼</title>
	<atom:link href="https://www.weblink.idv.tw/tag/%E7%B6%B2%E8%B7%AF/feed" rel="self" type="application/rss+xml" />
	<link>https://www.weblink.idv.tw</link>
	<description>Javascript, PHP, HTML5 &#38; CSS3 coding memos</description>
	<lastBuildDate>Tue, 26 Mar 2024 03:15:38 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>
	<item>
		<title>一條網路線如何部屬2台（或以上的）MOD？</title>
		<link>https://www.weblink.idv.tw/2024/512</link>
					<comments>https://www.weblink.idv.tw/2024/512#respond</comments>
		
		<dc:creator><![CDATA[Steven LIU]]></dc:creator>
		<pubDate>Tue, 16 Jan 2024 06:38:50 +0000</pubDate>
				<category><![CDATA[etc]]></category>
		<category><![CDATA[gs1200-5]]></category>
		<category><![CDATA[MOD]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[switch]]></category>
		<category><![CDATA[VLAN]]></category>
		<category><![CDATA[zyxel]]></category>
		<category><![CDATA[中華電信]]></category>
		<category><![CDATA[網路]]></category>
		<category><![CDATA[網頁管理式switch]]></category>
		<guid isPermaLink="false">https://www.weblink.idv.tw/?p=512</guid>

					<description><![CDATA[如同先前在＜玩泥巴玩到openWrt去＞提到的，設備升級後汰換下來的2台ASUS RT-N18U，本來是打算刷 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>如同先前在<a href="https://www.weblink.idv.tw/2023/348" data-type="link" data-id="https://www.weblink.idv.tw/2023/348" target="_blank" rel="noreferrer noopener">＜玩泥巴玩到openWrt去＞</a>提到的，設備升級後汰換下來的2台ASUS RT-N18U，本來是打算刷機用VLAN來串連咱家樓上增設的兩台MOD；不過計畫還沒啟動RT-N18U就被徵召去別處服勤，尋找替代方案時，又剛好看到某電商平台正在優惠兩台<a href="https://www.momoshop.com.tw/goods/GoodsDetail.jsp?i_code=12024728" data-type="link" data-id="https://www.momoshop.com.tw/goods/GoodsDetail.jsp?i_code=12024728" target="_blank" rel="noreferrer noopener">Zyxel網管型5埠switch</a>特價不到1,600，一台800有找不買的話我還算是個人嗎？當然二話不說立馬下單把機器請回家，於是RT-N18U沒順利上機，倒是拉了兩台網管switch來填這個坑。</p>


<div class="wp-block-image">
<figure class="aligncenter size-medium"><img fetchpriority="high" decoding="async" width="300" height="300" src="https://www.weblink.idv.tw/wp-content/uploads/2024/01/gs1200-5_cover-300x300.jpg" alt="" class="wp-image-516" srcset="https://www.weblink.idv.tw/wp-content/uploads/2024/01/gs1200-5_cover-300x300.jpg 300w, https://www.weblink.idv.tw/wp-content/uploads/2024/01/gs1200-5_cover-150x150.jpg 150w, https://www.weblink.idv.tw/wp-content/uploads/2024/01/gs1200-5_cover-768x768.jpg 768w, https://www.weblink.idv.tw/wp-content/uploads/2024/01/gs1200-5_cover.jpg 1000w" sizes="(max-width: 300px) 100vw, 300px" /><figcaption class="wp-element-caption">▲對Zyxel品牌印象向來不錯，<a href="https://www.momoshop.com.tw/goods/GoodsDetail.jsp?i_code=12024728" data-type="link" data-id="https://www.momoshop.com.tw/goods/GoodsDetail.jsp?i_code=12024728" target="_blank" rel="noreferrer noopener">5埠網管型switch</a>只賣800有找實在超佛心</figcaption></figure>
</div>


<p>因為VLAN的佈線、設定什麼的老早就規劃好，所以機器拿回來先花兩分鐘調整設定值、網路線接上，驗證事前的規劃觀念正確就直接上線服役了。比較意外的是，中華電信小烏龜並沒有綁定網路孔與MOD設備需要一對一連接，所以樓下原有的那台MOD我從小烏龜直連一條網路線沒問題，新增的樓上兩台MOD倒是只需要再從小烏龜接一條網路線出來，VLAN到樓上再拆成兩個孔分別塞給MOD即可。</p>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-9940075534877533"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-9940075534877533"
     data-ad-slot="4891658629"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>
<br>



<p>以下就先圖解一下咱家線路狀況：原本夯不啷噹近三十台設備的連網環境，新增兩台MOD與兩台switch之後狀況變得又更複雜了，所幸只是設備多，線路規劃還蠻單純。另外碎嘴一下，這次把MOD連上switch才發現原來他走的是100Mbps，雖然知道就算4K也跑不滿這個速度，但，switch上閃著橘燈就是讓人非常不爽啊！（強迫症發作）</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" width="1024" height="664" src="https://www.weblink.idv.tw/wp-content/uploads/2024/01/截圖-2024-01-15-晚上8.56.16-1024x664.png" alt="" class="wp-image-532" srcset="https://www.weblink.idv.tw/wp-content/uploads/2024/01/截圖-2024-01-15-晚上8.56.16-1024x664.png 1024w, https://www.weblink.idv.tw/wp-content/uploads/2024/01/截圖-2024-01-15-晚上8.56.16-300x195.png 300w, https://www.weblink.idv.tw/wp-content/uploads/2024/01/截圖-2024-01-15-晚上8.56.16-768x498.png 768w, https://www.weblink.idv.tw/wp-content/uploads/2024/01/截圖-2024-01-15-晚上8.56.16.png 1371w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">▲「看看我，我家裡的線路圖已經長得這麼大了！」（唉不是）</figcaption></figure>
</div>


<p>在我的使用情境下，VLAN的設定其實不複雜，主要就是把VLAN ID、PVID兩個部分對應好；相較之下，事前把線路規劃想清楚反而比較重要。對我這種土炮初學者來說，如果沒把線路老老實實仔細畫出來，常常配置想一想不小心就在自己腦海裡迷路了，很不方便很恐怖。</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" width="656" height="254" src="https://www.weblink.idv.tw/wp-content/uploads/2024/01/螢幕擷取畫面-2024-01-11-120509.png" alt="" class="wp-image-517" srcset="https://www.weblink.idv.tw/wp-content/uploads/2024/01/螢幕擷取畫面-2024-01-11-120509.png 656w, https://www.weblink.idv.tw/wp-content/uploads/2024/01/螢幕擷取畫面-2024-01-11-120509-300x116.png 300w" sizes="(max-width: 656px) 100vw, 656px" /><figcaption class="wp-element-caption">▲網路上做功課時，看到這張圖很清楚的展示VLAN如何用一條網路線切出兩個群組（圖片來源：<a href="https://pse.is/5j7fm2">https://pse.is/5j7fm2</a>）</figcaption></figure>
</div>

<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="952" height="658" src="https://www.weblink.idv.tw/wp-content/uploads/2024/01/full.png" alt="" class="wp-image-518" srcset="https://www.weblink.idv.tw/wp-content/uploads/2024/01/full.png 952w, https://www.weblink.idv.tw/wp-content/uploads/2024/01/full-300x207.png 300w, https://www.weblink.idv.tw/wp-content/uploads/2024/01/full-768x531.png 768w" sizes="auto, (max-width: 952px) 100vw, 952px" /><figcaption class="wp-element-caption">▲把簡易的孔位對應關係畫出來，VLAN的規畫應該就很一目瞭然了</figcaption></figure>
</div>

<div class="wp-block-image">
<figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="737" src="https://www.weblink.idv.tw/wp-content/uploads/2024/01/截圖-2024-01-10-晚上9.45.10-1024x737.png" alt="" class="wp-image-533" srcset="https://www.weblink.idv.tw/wp-content/uploads/2024/01/截圖-2024-01-10-晚上9.45.10-1024x737.png 1024w, https://www.weblink.idv.tw/wp-content/uploads/2024/01/截圖-2024-01-10-晚上9.45.10-300x216.png 300w, https://www.weblink.idv.tw/wp-content/uploads/2024/01/截圖-2024-01-10-晚上9.45.10-768x553.png 768w, https://www.weblink.idv.tw/wp-content/uploads/2024/01/截圖-2024-01-10-晚上9.45.10.png 1152w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">▲樓下<a href="https://www.momoshop.com.tw/goods/GoodsDetail.jsp?i_code=12024728" data-type="link" data-id="https://www.momoshop.com.tw/goods/GoodsDetail.jsp?i_code=12024728" target="_blank" rel="noreferrer noopener">Zyxel GS1200-5</a>（上圖左）的設置，原則上只開第5 port出來接小烏龜，第1 port則是串聯樓上樓下的主幹道</figcaption></figure>
</div>

<div class="wp-block-image">
<figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="737" src="https://www.weblink.idv.tw/wp-content/uploads/2024/01/截圖-2024-01-10-晚上9.40.44-1024x737.png" alt="" class="wp-image-534" srcset="https://www.weblink.idv.tw/wp-content/uploads/2024/01/截圖-2024-01-10-晚上9.40.44-1024x737.png 1024w, https://www.weblink.idv.tw/wp-content/uploads/2024/01/截圖-2024-01-10-晚上9.40.44-300x216.png 300w, https://www.weblink.idv.tw/wp-content/uploads/2024/01/截圖-2024-01-10-晚上9.40.44-768x553.png 768w, https://www.weblink.idv.tw/wp-content/uploads/2024/01/截圖-2024-01-10-晚上9.40.44.png 1152w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">▲樓上<a href="https://www.momoshop.com.tw/goods/GoodsDetail.jsp?i_code=12024728" data-type="link" data-id="https://www.momoshop.com.tw/goods/GoodsDetail.jsp?i_code=12024728" target="_blank" rel="noreferrer noopener">Zyxel GS1200-5</a>（上圖右）的設置，MOD數據從第1 port上來後，分別從第4、5 port接去兩台MOD機上盒就大功告成</figcaption></figure>
</div>


<p>如果把「MOD」跟「非MOD」兩組路徑highlight出來，應該能更清楚呈現數據的走向：</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="973" height="628" src="https://www.weblink.idv.tw/wp-content/uploads/2024/01/MOD.png" alt="" class="wp-image-520" srcset="https://www.weblink.idv.tw/wp-content/uploads/2024/01/MOD.png 973w, https://www.weblink.idv.tw/wp-content/uploads/2024/01/MOD-300x194.png 300w, https://www.weblink.idv.tw/wp-content/uploads/2024/01/MOD-768x496.png 768w" sizes="auto, (max-width: 973px) 100vw, 973px" /><figcaption class="wp-element-caption">▲MOD組</figcaption></figure>
</div>

<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="939" height="647" src="https://www.weblink.idv.tw/wp-content/uploads/2024/01/info.png" alt="" class="wp-image-519" srcset="https://www.weblink.idv.tw/wp-content/uploads/2024/01/info.png 939w, https://www.weblink.idv.tw/wp-content/uploads/2024/01/info-300x207.png 300w, https://www.weblink.idv.tw/wp-content/uploads/2024/01/info-768x529.png 768w" sizes="auto, (max-width: 939px) 100vw, 939px" /><figcaption class="wp-element-caption">▲非MOD組</figcaption></figure>
</div>


<p>好啦關於一條網路線如何部屬2台（或以上的）MOD的 VLAN設置就備註在這裡，前後歷時將近一年（未免也太久）的網路總體檢暫告一段落，以後應該是不會讓家裡的網路配置更複雜了，頂多就是設備升升級這類的小打小鬧。之前有段時間一直在研究KVM over IP的應用，不過仔細評估後覺得有點在自找麻煩，本著東西沒壞就不要修的原則，目前一切安好就先這樣順順跑吧！</p>



<p><strong>後記：</strong>規劃時本來以為要從小烏龜拉獨立的兩條網路線到switch的第4、5 port上，然後各自設定一組PVID（就是總共切出三組PVID的意思），但實際測試時發現這樣反而會造成loop，雖然我是反正設定可以正常跑這題就過了（不負責任貌），但實在好希望專業人士來幫忙解答為什麼會這樣啊！！！！（再次抱頭）</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="944" height="602" src="https://www.weblink.idv.tw/wp-content/uploads/2024/01/takeaway_ok.png" alt="" class="wp-image-527" srcset="https://www.weblink.idv.tw/wp-content/uploads/2024/01/takeaway_ok.png 944w, https://www.weblink.idv.tw/wp-content/uploads/2024/01/takeaway_ok-300x191.png 300w, https://www.weblink.idv.tw/wp-content/uploads/2024/01/takeaway_ok-768x490.png 768w" sizes="auto, (max-width: 944px) 100vw, 944px" /><figcaption class="wp-element-caption">▲這樣正常</figcaption></figure>
</div>

<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="954" height="599" src="https://www.weblink.idv.tw/wp-content/uploads/2024/01/takeaway_error01.png" alt="" class="wp-image-528" srcset="https://www.weblink.idv.tw/wp-content/uploads/2024/01/takeaway_error01.png 954w, https://www.weblink.idv.tw/wp-content/uploads/2024/01/takeaway_error01-300x188.png 300w, https://www.weblink.idv.tw/wp-content/uploads/2024/01/takeaway_error01-768x482.png 768w, https://www.weblink.idv.tw/wp-content/uploads/2024/01/takeaway_error01-200x125.png 200w" sizes="auto, (max-width: 954px) 100vw, 954px" /><figcaption class="wp-element-caption">▲這樣左邊switch的第5 port會變loop</figcaption></figure>
</div>

<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="960" height="613" src="https://www.weblink.idv.tw/wp-content/uploads/2024/01/takeaway_error02.png" alt="" class="wp-image-529" srcset="https://www.weblink.idv.tw/wp-content/uploads/2024/01/takeaway_error02.png 960w, https://www.weblink.idv.tw/wp-content/uploads/2024/01/takeaway_error02-300x192.png 300w, https://www.weblink.idv.tw/wp-content/uploads/2024/01/takeaway_error02-768x490.png 768w" sizes="auto, (max-width: 960px) 100vw, 960px" /><figcaption class="wp-element-caption">▲這樣也是loop，なぜ？（抓頭）</figcaption></figure>
</div>]]></content:encoded>
					
					<wfw:commentRss>https://www.weblink.idv.tw/2024/512/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>玩泥巴玩到openWrt去</title>
		<link>https://www.weblink.idv.tw/2023/348</link>
					<comments>https://www.weblink.idv.tw/2023/348#comments</comments>
		
		<dc:creator><![CDATA[Steven LIU]]></dc:creator>
		<pubDate>Sat, 18 Mar 2023 08:39:55 +0000</pubDate>
				<category><![CDATA[etc]]></category>
		<category><![CDATA[AdGuard]]></category>
		<category><![CDATA[openwrt]]></category>
		<category><![CDATA[port forward]]></category>
		<category><![CDATA[pppoe]]></category>
		<category><![CDATA[router]]></category>
		<category><![CDATA[網路]]></category>
		<category><![CDATA[設定]]></category>
		<category><![CDATA[路由]]></category>
		<guid isPermaLink="false">https://www.weblink.idv.tw/?p=348</guid>

					<description><![CDATA[家裡網路早在8、9年前就用了光纖到府的100/40Mbps，不過說來慚愧，雖然明知跑不到全速，但這些年主Rou [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>家裡網路早在8、9年前就用了光纖到府的100/40Mbps，不過說來慚愧，雖然明知跑不到全速，但這些年主Router一直都是由Asus RT-N18U硬扛，最大的原因，就是我總覺得這類家用機器的預算不該超過兩千。可是這幾年不只網路技術突飛猛進，上網設備也是越來越多，從手機、平板、筆電、桌機、NAS、Web Server到智慧手錶，一家大大小小超過20台設備全都擠著RT-N18U進出抽插，就算咱家不掛網下BT，光是幾個設備同時串流看影片，也是真夠RT-N18U瞧的了。</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="1837" height="1102" src="https://www.weblink.idv.tw/wp-content/uploads/2023/12/pic1.png" alt="" class="wp-image-413" srcset="https://www.weblink.idv.tw/wp-content/uploads/2023/12/pic1.png 1837w, https://www.weblink.idv.tw/wp-content/uploads/2023/12/pic1-300x180.png 300w, https://www.weblink.idv.tw/wp-content/uploads/2023/12/pic1-1024x614.png 1024w, https://www.weblink.idv.tw/wp-content/uploads/2023/12/pic1-768x461.png 768w, https://www.weblink.idv.tw/wp-content/uploads/2023/12/pic1-1536x921.png 1536w" sizes="auto, (max-width: 1837px) 100vw, 1837px" /><figcaption class="wp-element-caption">▲要RT-N18U扛這麼多設備連線，著實難為人家了。</figcaption></figure>
</div>


<p>農曆年前做孝子，牙一咬幫爸媽換上兩台性能滿出來的高階筆電，網路也趁中華電信特價升級到了500/250Mbps（前陣子中華還佛心免費升成500/500Mbps）；只是這麼一來，網路速度就更被RT-N18U掐著脖子跑不上去，看來也的確是時候請這位老兄讓讓位了。</p>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-9940075534877533"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-9940075534877533"
     data-ad-slot="4891658629"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>
<br>



<p>剛好，看到Asus在PC家大特價，便順勢讓兩台RT-N18U除役，換上性能三級跳的TUF-AX5400，一來AX5400可以兩台串Mesh，二來也想看看Wifi 6到底有多香。</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="1837" height="1102" src="https://www.weblink.idv.tw/wp-content/uploads/2023/12/pic2.png" alt="" class="wp-image-414" srcset="https://www.weblink.idv.tw/wp-content/uploads/2023/12/pic2.png 1837w, https://www.weblink.idv.tw/wp-content/uploads/2023/12/pic2-300x180.png 300w, https://www.weblink.idv.tw/wp-content/uploads/2023/12/pic2-1024x614.png 1024w, https://www.weblink.idv.tw/wp-content/uploads/2023/12/pic2-768x461.png 768w, https://www.weblink.idv.tw/wp-content/uploads/2023/12/pic2-1536x921.png 1536w" sizes="auto, (max-width: 1837px) 100vw, 1837px" /><figcaption class="wp-element-caption">▲TUF-AX5400前陣子特價台票4,000有找，換來體驗一下Mesh與Wifi 6到底有多香，整體效能也是RT-N18U三級跳。</figcaption></figure>
</div>


<p>上機用了個兒把月，5GHz頻率確實順，SSID無縫切換也的確方便，Wifi 6速度提升更是暴力直接；但不知怎麼的，雖然AX5400的CPU與RAM使用率始終不高，無論是手機還是筆電，卻始終達不到即點即開的滑順體驗。</p>



<p>是我對滑順的期待太不切實際嗎？</p>



<p>或許是近十萬都開下去了，不試著把網路速度榨到一滴不剩就是不甘心。剛好筆電汰換下來的i5-5200U迷你桌機帶雙網孔（當年淘寶買的占美，機殼銳角超割手，也忘了當初為什麼買雙網孔機型），反正拿上網賣也換不了幾個錢，不如死馬當活馬醫（其實也沒那麼死馬，AX5400很夠用的），灌個openWrt跑Router，再掛個AdGuard Home還能順便擋廣告，一兼二顧何樂不為？</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2560" height="1238" src="https://www.weblink.idv.tw/wp-content/uploads/2023/03/IMG_1025-scaled.jpg" alt="" class="wp-image-364" srcset="https://www.weblink.idv.tw/wp-content/uploads/2023/03/IMG_1025-scaled.jpg 2560w, https://www.weblink.idv.tw/wp-content/uploads/2023/03/IMG_1025-300x145.jpg 300w, https://www.weblink.idv.tw/wp-content/uploads/2023/03/IMG_1025-1024x495.jpg 1024w, https://www.weblink.idv.tw/wp-content/uploads/2023/03/IMG_1025-768x371.jpg 768w, https://www.weblink.idv.tw/wp-content/uploads/2023/03/IMG_1025-1536x743.jpg 1536w, https://www.weblink.idv.tw/wp-content/uploads/2023/03/IMG_1025-2048x991.jpg 2048w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /><figcaption class="wp-element-caption">▲這台PC老歸老，i5-5200U / 8GB拿來跑Router一樣效能滿到天邊去，加上剛好有雙網孔，一定是老天爺要我拿來灌openWrt的sign。</figcaption></figure>



<p>網路上中英文資訊查了一堆，確定openWrt就算掛在隨身碟也不太會影響速度，就把桌機SSD拆下來、便宜搞了一隻SanDisk 32GB，花個百來塊開始動手瞎搞。</p>



<p>首先，因為小弟天性多疑，就算Lean、ImmortalWrt這些現成固件都開源放上gitHub了，不用擔心被開後門捅屁股，不過看到一堆對岸應用就是不舒坦；而且咱家Router很乖巧很單純的，PPPoE、DHCP這些基本設置外，多個Port forwarding、再掛個AdGuard Home就拍拍屁股結案了事。想了一下，還是從官方系統上老老實實裸奔吧！</p>



<h2 class="wp-block-heading">1. 下載與機器對應的img映像檔</h2>



<p>搞openWrt大致分兩路，一路是直接把手上的Wifi路由器刷上openWrt韌體，另一路就是像我這種秉持客家精神拿x86舊電腦來灌系統。Wifi路由器要刷openWrt比較麻煩，你要先找到<a rel="noreferrer noopener" href="https://openwrt.org/toh/start" data-type="URL" data-id="https://openwrt.org/toh/start" target="_blank">對應的型號或CPU</a>、下載到對的系統、用奇技淫巧把韌體刷進去，有些機子弄不好還會變磚。記得早期神機RT-N16刷DD-WRT時，總是戰戰兢兢，搞得跟拆炸彈似的……</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="768" height="576" src="https://www.weblink.idv.tw/wp-content/uploads/2023/03/33855398_OVR_2_1333x1000.webp" alt="" class="wp-image-351" srcset="https://www.weblink.idv.tw/wp-content/uploads/2023/03/33855398_OVR_2_1333x1000.webp 768w, https://www.weblink.idv.tw/wp-content/uploads/2023/03/33855398_OVR_2_1333x1000-300x225.webp 300w" sizes="auto, (max-width: 768px) 100vw, 768px" /><figcaption class="wp-element-caption">▲RT-N16身為一代神機，別說你沒有刷過他！（網路圖片）</figcaption></figure>
</div>


<p>咳，扯遠了。</p>



<p>總之，x86電腦選擇單純得多，我是因為根本不懂squash姓啥名誰，所以直接用ext4版本。如果你也跟我一樣是用老電腦裝，選「<a rel="noreferrer noopener" href="https://downloads.openwrt.org/releases/22.03.3/targets/x86/64/openwrt-22.03.3-x86-64-generic-ext4-combined.img.gz" data-type="URL" data-id="https://downloads.openwrt.org/releases/22.03.3/targets/x86/64/openwrt-22.03.3-x86-64-generic-ext4-combined.img.gz" target="_blank">generic-ext4-combined.img.gz</a>」應該適用大部分情況。</p>



<h2 class="wp-block-heading">2. 解壓縮、刷進隨身碟</h2>



<p>在Mac OS我是用<a rel="noreferrer noopener" href="https://apps.apple.com/tw/app/the-unarchiver/id425424353?mt=12" data-type="URL" data-id="https://apps.apple.com/tw/app/the-unarchiver/id425424353?mt=12" target="_blank">Unarchiver</a>解壓縮、<a rel="noreferrer noopener" href="https://www.balena.io/etcher#download-etcher" data-type="URL" data-id="https://www.balena.io/etcher#download-etcher" target="_blank">BalenaEtcher</a>把openWrt寫進隨身碟；如果是windows應該就7.zip解壓縮、Rufus寫系統吧！？</p>



<h2 class="wp-block-heading">3. 改BIOS、重開機</h2>



<p>沒什麼新鮮事，進電腦改BIOS開機順序，插上隨身碟，重開機。</p>



<h2 class="wp-block-heading">4. Voila！openWrt安裝完成</h2>



<p>是的，安裝openWrt就是這麼樸實無華且粗暴。</p>



<h2 class="wp-block-heading">5. 基本設定：PPPoE、DHCP、關IPv6</h2>



<p>如果你跟我一樣，是在原本的架構下置換Router，那建議把所有設定都在openWrt上搞定了再移機比較好。</p>



<p>基本上Router最重要的功能，對外就是PPPoE撥號，對內就是DHCP讓設備取得IP上網，IPv6雖然先進但我不懂用、開著又礙眼，關掉！（唉對，root密碼進系統就先改掉了是常識，對吧？！）</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="911" height="626" src="https://www.weblink.idv.tw/wp-content/uploads/2023/03/PPPoE-redacted_dot_app.png" alt="" class="wp-image-353" srcset="https://www.weblink.idv.tw/wp-content/uploads/2023/03/PPPoE-redacted_dot_app.png 911w, https://www.weblink.idv.tw/wp-content/uploads/2023/03/PPPoE-redacted_dot_app-300x206.png 300w, https://www.weblink.idv.tw/wp-content/uploads/2023/03/PPPoE-redacted_dot_app-768x528.png 768w" sizes="auto, (max-width: 911px) 100vw, 911px" /><figcaption class="wp-element-caption">▲PPPoE設定簡單明瞭。</figcaption></figure>
</div>

<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="917" height="879" src="https://www.weblink.idv.tw/wp-content/uploads/2023/03/IPv6.png" alt="" class="wp-image-352" srcset="https://www.weblink.idv.tw/wp-content/uploads/2023/03/IPv6.png 917w, https://www.weblink.idv.tw/wp-content/uploads/2023/03/IPv6-300x288.png 300w, https://www.weblink.idv.tw/wp-content/uploads/2023/03/IPv6-768x736.png 768w" sizes="auto, (max-width: 917px) 100vw, 917px" /><figcaption class="wp-element-caption">▲IPv6停用參考設置。</figcaption></figure>
</div>


<h2 class="wp-block-heading">6. Firewall與Port Forwards</h2>



<p>接著因為架站，所以另外需要在Firewall裡設定Port Forwards，把https的埠號443指向內部的Web Server。我的IP編號習慣是，連接實體網路線的Web Server、NAS、桌機……這些設備走固定IP，無腦從192.168.1.2照順序往後排；至於走無線Wifi的手機、平板等就吃DHCP，編號從100起跳。這樣我很容易就能從IP位址快速判斷設備來源。（這樣分類只是我自己方便，如果有缺點還請大家不吝分享原因。）</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="983" height="827" src="https://www.weblink.idv.tw/wp-content/uploads/2023/03/firewall.png" alt="" class="wp-image-354" srcset="https://www.weblink.idv.tw/wp-content/uploads/2023/03/firewall.png 983w, https://www.weblink.idv.tw/wp-content/uploads/2023/03/firewall-300x252.png 300w, https://www.weblink.idv.tw/wp-content/uploads/2023/03/firewall-768x646.png 768w" sizes="auto, (max-width: 983px) 100vw, 983px" /><figcaption class="wp-element-caption">▲Drop Invalid Packets建議勾起來。</figcaption></figure>
</div>

<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="967" height="815" src="https://www.weblink.idv.tw/wp-content/uploads/2023/03/portforwards-redacted_dot_app.png" alt="" class="wp-image-356" srcset="https://www.weblink.idv.tw/wp-content/uploads/2023/03/portforwards-redacted_dot_app.png 967w, https://www.weblink.idv.tw/wp-content/uploads/2023/03/portforwards-redacted_dot_app-300x253.png 300w, https://www.weblink.idv.tw/wp-content/uploads/2023/03/portforwards-redacted_dot_app-768x647.png 768w" sizes="auto, (max-width: 967px) 100vw, 967px" /><figcaption class="wp-element-caption">▲Port Forwards可以個別選擇開或關很方便。</figcaption></figure>
</div>


<h2 class="wp-block-heading">7. 安裝AdGuard Home</h2>



<p>openWrt安裝軟體套件是用opkg而不是apt-get，一開始沒注意還嚇了一跳，想說apt怎麼openWrt看不懂。安裝AdGuard Home沒什麼稀奇，就是opkg install adguardhome按下去就幫你裝妥妥了。比較麻煩的是openWrt的設定，因為你還要告訴系統「以後DNS出去前還要多經過AdGuard Home這一關」，所以DNS forwardings要另外設定AdGurad Home埠號。</p>



<p>爬文看到網友說不建議AdGuard Home把原本系統的dnsmasq服務取代，所以53埠不去動他，讓AdGuard Home拿54埠。</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="999" height="631" src="https://www.weblink.idv.tw/wp-content/uploads/2023/03/DNS.png" alt="" class="wp-image-357" srcset="https://www.weblink.idv.tw/wp-content/uploads/2023/03/DNS.png 999w, https://www.weblink.idv.tw/wp-content/uploads/2023/03/DNS-300x189.png 300w, https://www.weblink.idv.tw/wp-content/uploads/2023/03/DNS-768x485.png 768w, https://www.weblink.idv.tw/wp-content/uploads/2023/03/DNS-200x125.png 200w" sizes="auto, (max-width: 999px) 100vw, 999px" /><figcaption class="wp-element-caption">▲DNS forwardings需要指定給AdGuard Home的埠號才有作用。</figcaption></figure>
</div>

<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="1339" height="775" src="https://www.weblink.idv.tw/wp-content/uploads/2023/03/截圖-2023-03-18-下午4.16.59.png" alt="" class="wp-image-358" srcset="https://www.weblink.idv.tw/wp-content/uploads/2023/03/截圖-2023-03-18-下午4.16.59.png 1339w, https://www.weblink.idv.tw/wp-content/uploads/2023/03/截圖-2023-03-18-下午4.16.59-300x174.png 300w, https://www.weblink.idv.tw/wp-content/uploads/2023/03/截圖-2023-03-18-下午4.16.59-1024x593.png 1024w, https://www.weblink.idv.tw/wp-content/uploads/2023/03/截圖-2023-03-18-下午4.16.59-768x445.png 768w" sizes="auto, (max-width: 1339px) 100vw, 1339px" /><figcaption class="wp-element-caption">▲看到AdGuard Home的數字在跳就是舒坦。</figcaption></figure>
</div>

<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="949" height="851" src="https://www.weblink.idv.tw/wp-content/uploads/2023/03/startup.png" alt="" class="wp-image-360" srcset="https://www.weblink.idv.tw/wp-content/uploads/2023/03/startup.png 949w, https://www.weblink.idv.tw/wp-content/uploads/2023/03/startup-300x269.png 300w, https://www.weblink.idv.tw/wp-content/uploads/2023/03/startup-768x689.png 768w" sizes="auto, (max-width: 949px) 100vw, 949px" /><figcaption class="wp-element-caption">▲看到網友說不建議AdGuard Home把原本系統的dnsmasq服務取代，所以53埠不去動他，讓AdGuard Home拿54埠。</figcaption></figure>
</div>


<h2 class="wp-block-heading">8. 測試、上機</h2>



<p>測試時我先直連小烏龜撥動態IP上網，等到所有設定都搞定，重開機確認一切正常後，我才用最快速度把openWrt換成主Router、改撥固定IP；至於AX5400，則是由路由器模式改成AP模式，另一台Mesh節點完全不用動。</p>



<p>實體操作上，只需要把原本小烏龜連AX5400 Wan孔的網路線改接到openWrt Wan孔上，然後openWrt Lan孔多牽一條網路線到Switch上而已，其他線路與設備的設定都完全一樣，家人甚至感覺不到有任何區別。（這應該是最理想的升級狀態吧？！）</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="1837" height="1102" src="https://www.weblink.idv.tw/wp-content/uploads/2023/12/pic3.png" alt="" class="wp-image-416" srcset="https://www.weblink.idv.tw/wp-content/uploads/2023/12/pic3.png 1837w, https://www.weblink.idv.tw/wp-content/uploads/2023/12/pic3-300x180.png 300w, https://www.weblink.idv.tw/wp-content/uploads/2023/12/pic3-1024x614.png 1024w, https://www.weblink.idv.tw/wp-content/uploads/2023/12/pic3-768x461.png 768w, https://www.weblink.idv.tw/wp-content/uploads/2023/12/pic3-1536x921.png 1536w" sizes="auto, (max-width: 1837px) 100vw, 1837px" /><figcaption class="wp-element-caption">▲整體架構與個別設備的設定不用動，抽換個Router網路效能就有感提升，整個素喜！</figcaption></figure>
</div>


<h2 class="wp-block-heading">9. 心得</h2>



<p>實際跑了幾個禮拜下來，這台Router幫我把煩人廣告擋掉一堆不說，即點即開的滑順感確實有達到我的預期。專業的學理或數據我不懂，純就體感上主觀覺得有再順上那麼一咪咪，而且i5 5200U / 8GB的配置輕鬆輾壓咱家不到30個設備上網的需求，負載從來沒超過10%；把Router功能從AX5400身上拔掉，讓他單純作為AP與Mesh節點來用，也釋放了大約50MB的記憶體用量出來。雖然原本AX5400效能就沒吃滿，不過分工更確實、工作量又降低，相信大夥兒也是非常滿意這樣的安排吧！嗯嗯！（點頭）</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="1097" height="1096" src="https://www.weblink.idv.tw/wp-content/uploads/2023/03/截圖-2023-03-18-下午4.28.35-redacted_dot_app.png" alt="" class="wp-image-361" srcset="https://www.weblink.idv.tw/wp-content/uploads/2023/03/截圖-2023-03-18-下午4.28.35-redacted_dot_app.png 1097w, https://www.weblink.idv.tw/wp-content/uploads/2023/03/截圖-2023-03-18-下午4.28.35-redacted_dot_app-300x300.png 300w, https://www.weblink.idv.tw/wp-content/uploads/2023/03/截圖-2023-03-18-下午4.28.35-redacted_dot_app-1024x1024.png 1024w, https://www.weblink.idv.tw/wp-content/uploads/2023/03/截圖-2023-03-18-下午4.28.35-redacted_dot_app-150x150.png 150w, https://www.weblink.idv.tw/wp-content/uploads/2023/03/截圖-2023-03-18-下午4.28.35-redacted_dot_app-768x767.png 768w" sizes="auto, (max-width: 1097px) 100vw, 1097px" /><figcaption class="wp-element-caption">▲用路由器模式運作時，AX5400的記憶體使用量大約70%（350MB），改成AP模式後掉到60%（300MB），實際感受倒是沒差別。</figcaption></figure>
</div>


<p>至於用退役的兩台RT-N18U刷機做VLAN，讓單條網路線上樓的配置，能收看第二台MOD、設備又在同個區網內，那又是另一個故事了……（菸）。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.weblink.idv.tw/2023/348/feed</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
