<?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>IPv6 &#8211; richliu&#039;s blog</title>
	<atom:link href="https://blog.richliu.com/tag/ipv6y/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.richliu.com</link>
	<description>Linux, 工作, 生活, 家人</description>
	<lastBuildDate>Mon, 07 Oct 2019 15:22:03 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.2</generator>
	<item>
		<title>[Gentoo][Linux] Hinet PPPoE IPv6 Dual Stack 設定</title>
		<link>https://blog.richliu.com/2016/03/07/1930/hinet-pppoe-ipv6-dual-stack-%e8%a8%ad%e5%ae%9a/</link>
					<comments>https://blog.richliu.com/2016/03/07/1930/hinet-pppoe-ipv6-dual-stack-%e8%a8%ad%e5%ae%9a/#comments</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Mon, 07 Mar 2016 06:19:46 +0000</pubDate>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[dhcpv6]]></category>
		<category><![CDATA[dual stack]]></category>
		<category><![CDATA[hinet]]></category>
		<category><![CDATA[IPv6]]></category>
		<category><![CDATA[routing]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=1930</guid>

					<description><![CDATA[<p>自從中研院 Tunnel Broker 因為硬碟壞掉終止服務, Hinet Tunnel Broker 一直斷 [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2016/03/07/1930/hinet-pppoe-ipv6-dual-stack-%e8%a8%ad%e5%ae%9a/">[Gentoo][Linux] Hinet PPPoE IPv6 Dual Stack 設定</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>自從中研院 Tunnel Broker 因為硬碟壞掉終止服務, Hinet Tunnel Broker 一直斷線根本不能用.<br />
己經很久沒有使用 IPv6 的服務.<br />
前二天聽到 Kenduest Lee 說到 Hinet 光世代 PPPoE 有 IPv6 的服務, 立馬就跑去申請.<br />
<span id="more-1930"></span>第一件事, 請到中華電信營業所申請 IPv6 的服務, 這邊特別提醒,<br />
不是每個服務人員都熟悉什麼叫 IPv6, 你碰到的服務人員可能不懂, 這也表示 IPv6 這個服務非常少人使用.<br />
所以如果他們不知道你在說什麼, 請查資料並多些耐心<br />
希望我今天這篇文章可以吸引更多人來用 IPv6 的服務 (目前好像也沒有什麼好處 XD)</p>
<p>剛剛長輩提示, Hinet 也可以線上申請 IPv6</p>
<p>到 <a href="https://123.cht.com.tw/ecas/B09" target="_blank" rel="noopener">中華電信網路客服中心</a> , 選更多線上服務.<br />
找到 IPv6 , 登入之後再申請即可</p>
<p>&nbsp;</p>
<p>開通之後, 快的話數個小時就會開通, 如果沒有開通, 過幾天工程人員也會打電話通知你.</p>
<p>如何知道有沒有開通, PPPoE 設定完之後, 重新撥接可以用 PPPoE or DHCP 取得 IPv6 IP.</p>
<p>如果是 ubuntu 預設套件, 請編輯 /etc/ppp/option<br />
並且加上</p>
<blockquote><p>ipv6 ,</p></blockquote>
<p>請注意有逗號, 中間有空白. 然後再重新撥接 PPPoE 就可以.</p>
<p>如果是用 Gentoo/rp-pppoe, 請編輯 /etc/ppp/option 加上這一行</p>
<blockquote><p>+ipv6 ipv6cp-use-ipaddr</p></blockquote>
<p>這樣就可以取得 IPv6 IP.</p>
<p>如果不能取得 IP, 請檢查有沒有執行 radvd<br />
Gentoo 執行 /etc/init.d/net.ppp0 restart 之後, 會自動帶起來 radvd, 這時候會造成 radvd 影響取得 IPv6 的 IP<br />
所以在 /etc/rc.conf 下將 rc_depend_strict 設 &#8220;NO&#8221; 就不會自動呼叫 radvd (其他 service dependency 也會受影響, 請注意)</p>
<p>另外還在 /etc/conf.d/net 加上 code 確保 radvd 一定沒有執行</p>
<blockquote><p>postdown() {<br />
if [ ${IFVAR} == &#8220;ppp0&#8221; ] ; then<br />
/etc/init.d/radvd stop<br />
sleep 2<br />
killall -9 radvd<br />
fi<br />
return 0<br />
}</p></blockquote>
<p>如果 Linux 這一台是 Router 時, 從 Hinet 那邊取得的 IPv6 Routing 要稍稍修改一下才能正確傳遞到內網<br />
因為預設的 Interface 是 /64 的 IP, 在 route table 那邊會多一行 /64 的 routing table, 這個 record 會讓 IPv6 Forwarding 不正常<br />
像是這樣,</p>
<blockquote><p>2001:b011:3810:cc9::/64 :: UA 256 0 0 ppp0</p></blockquote>
<p>這時候就要重新設定 ppp interface 的 IP 和 routing table.</p>
<p>所以我做了如下的設定<br />
1) 取得 IPv6/default gateway IP<br />
2) 將 ppp0 的 interface 改成 /128<br />
3) 寫入資訊到 radvd<br />
4) 啟動 radvd<br />
5) 加入原來 hinet 的 default gateway IP</p>
<p>這樣就大功告成了, 內網也可以順利的透過 Linux 連到外部去.<br />
這邊就不解釋各步驟要下什麼指令, 直接看 script 比較快</p>
<blockquote><p>WANIF=ppp0<br />
LANIF=eth1<br />
WANIP=`ifconfig ppp0 | grep inet6 | grep global | awk &#8216;{print $2}&#8217;`</p>
<p>if [ x${WANIP} == &#8220;x&#8221; ] ; then<br />
echo &#8220;NO IPv6 Address !!!!!!!&#8221;<br />
exit 0<br />
fi</p>
<p>GATEWAY=`route -n6 | grep ppp0 | grep &#8220;::\/0&#8243; | awk &#8216;{print $2}&#8217;| head -1`<br />
RADVDCFG=&#8221;/etc/radvd.conf&#8221;<br />
PREFIX=`echo ${WANIP}| cut -d &#8216;:&#8217; -f1`&#8221;:&#8221;`echo ${WANIP}| cut -d &#8216;:&#8217; -f2`&#8221;:&#8221;`echo ${WANIP}| cut -d &#8216;:&#8217; -f3`&#8221;:&#8221;`echo ${WANIP}| cut -d &#8216;:&#8217; -f4`<br />
echo &#8220;WANIP : ${WANIP}&#8221;<br />
echo &#8220;GATEWAY : ${GATEWAY}&#8221;<br />
echo ${PREFIX}<br />
# Create RADVD configuration file<br />
cat&gt;${RADVDCFG}&lt;&lt;EOL<br />
interface ${LANIF}<br />
{<br />
AdvSendAdvert on;<br />
prefix ${PREFIX}::/64<br />
{<br />
AdvOnLink on;<br />
AdvRouterAddr on;<br />
AdvAutonomous on;<br />
};<br />
};<br />
EOL</p>
<p>ifconfig ${WANIF} inet6 del ${WANIP}/64<br />
ifconfig ${WANIF} inet6 add ${WANIP}/128<br />
# assign one for LAN to avoid routing problem<br />
ifconfig $(LANIF) inet6 add ${PREFIX}::1/64</p>
<p>ip -6 route del ${PREFIX}::/64 dev ppp0<br />
sleep 1<br />
/etc/init.d/radvd start<br />
sleep 1</p>
<p>route -A inet6 add default gw ${GATEWAY} dev ${WANIF}</p></blockquote>
<p>有防火牆也可以參考這個 script 取得目前的 IP .</p>
<p>在 /etc/conf.d/net 加上一些 code 讓他呼叫這個 scrip.</p>
<blockquote><p>postup() {</p>
<p>if [ ${IFVAR} == &#8220;ppp0&#8221; ] ; then<br />
echo test<br />
sleep 3<br />
bash /usr/local/script/ipv6.sh<br />
fi<br />
return 0<br />
}</p></blockquote>
<p>如果是用 dhcpcd 這個套件取得 IP, 並且要設定另一個介面的 Interface , 可以參考這個設定</p>
<blockquote><p>duid<br />
noipv6rs<br />
waitip 6<br />
# Uncomment this line if you are running dhcpcd for IPv6 only.<br />
ipv6only</p>
<p># use the interface connected to WAN<br />
interface ppp0<br />
ipv6rs<br />
iaid 1<br />
# use the interface connected to your LAN<br />
ia_pd 1 eth2<br />
#ia_pd 1/::/64 eth2/0/64</p></blockquote>
<p>小州大大的 DHCP6C 配置 (偷來放 BLOG 他應該不會介意)</p>
<blockquote><p># use the interface connected to your WAN<br />
interface ppp0 {<br />
send ia-pd 0;<br />
};</p>
<p>id-assoc pd 0 {<br />
# use the interface connected to your LAN<br />
prefix-interface eth2 {<br />
sla-id 1;<br />
sla-len 8;<br />
};<br />
};</p></blockquote>
<p>之前在 Facebook 上和小州大大討論過, 他是用 PPPoE 取得第一段 IPv6 , 用 DHCPv6 取得第二段, 所以會拿到二組不同的 IPv6 IP.<br />
我這個方法設定麻煩, 但是只會拿到一組 IPv6 的 IP.</p>
<p>Ref.<br />
<a href="http://blog.xuite.net/zack_pan/blog/62384661-Linux透過PPPoE取得IPv6的IP" target="_blank" rel="noopener">Linux透過PPPoE取得IPv6的IP</a></p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2016/03/07/1930/hinet-pppoe-ipv6-dual-stack-%e8%a8%ad%e5%ae%9a/">[Gentoo][Linux] Hinet PPPoE IPv6 Dual Stack 設定</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2016/03/07/1930/hinet-pppoe-ipv6-dual-stack-%e8%a8%ad%e5%ae%9a/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>[Linux] 限制時間上 Facebook</title>
		<link>https://blog.richliu.com/2015/12/15/1885/linux-%e9%99%90%e5%88%b6%e6%99%82%e9%96%93%e4%b8%8a-facebook/</link>
					<comments>https://blog.richliu.com/2015/12/15/1885/linux-%e9%99%90%e5%88%b6%e6%99%82%e9%96%93%e4%b8%8a-facebook/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Mon, 14 Dec 2015 17:29:02 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[as]]></category>
		<category><![CDATA[as number]]></category>
		<category><![CDATA[facebok]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[IPv6]]></category>
		<guid isPermaLink="false">http://blog.richliu.com/?p=1885</guid>

					<description><![CDATA[<p>Facebook 花去太多時間, 所以在 Linux 上加了一條 Rule 限制自己 時間模組是用 iptab [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2015/12/15/1885/linux-%e9%99%90%e5%88%b6%e6%99%82%e9%96%93%e4%b8%8a-facebook/">[Linux] 限制時間上 Facebook</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>

Facebook 花去太多時間, 所以在 Linux 上加了一條 Rule 限制自己

</p>



<span id="more-1885"></span>



<p>

時間模組是用 iptables 的 time , 寫起來像是這樣

</p>



<pre class="wp-block-preformatted">iptables -N limit_fb => 新增一個新個 Rule 叫 limit_fb
iptables -A OUTPUT -p tcp -m tcp -m time --kerneltz --timestart 22:00 --timestop 18:00 --dport 443 -j limit_fb

--timestart 是開始時間
--timestop 是結束時間
--kerneltz 是使用本地時間, 不設預設用 UTC </pre>


<p>因為 Facebook 都是用 https , 所以沒有很好的方式可以過濾 url<br />所以我選擇用 IP/RANGE 的方式阻擋.<br />Facebook 的所有 IP 位置可以從 AS 取得<br />用一個簡單的指令就可以取得</p>
<blockquote>
<p>$ whois -h whois.radb.net &#8216;!gAS32934</p>
</blockquote>
<p>將所有的 IP 加到 Rule tables 內</p>
<blockquote>
<p>FBAS=`whois -h whois.radb.net &#8216;!gAS32934&#8217; | tail -n 2 | head -n 1`<br />for i in $FBAS; do<br />$iptables -I limit_fb -d $i -j DROP<br />done</p>
</blockquote>
<p>效果還不錯</p>
<p>最近又接上 IPv6 了, 如果要取得 Facebook IPv6 的範圍, 可以用這個指令</p>
<blockquote>
<p>FBAS=`whois -h whois.radb.net &#8212; &#8216;-i origin AS32934&#8217; | grep route6 | awk &#8216;{print $2}&#8217;`<br />for i in $FBAS; do<br />$ip6tables -I limit_fb -d $i -j DROP<br />done</p>
</blockquote>
<p>ref.<br /><a href="https://raymii.org/s/snippets/Get_all_IP_ranges_from_an_AS_number.html" target="_blank" rel="noopener noreferrer">Get all IP ranges from an AS number</a><br /><a href="https://ma.ttias.be/whois-at-the-cli-get-all-ip-ranges-from-an-as-number/" target="_blank" rel="noopener noreferrer">Whois at the CLI: get all IP ranges from an AS number</a></p>


<p>懶得加一篇文章了<br /><br />最近要限制小孩看電視，找出電視的 IP ，下這個指令</p>



<pre class="wp-block-preformatted">iptables -A FORWARD -p tcp -s 192.168.1.163 -m state --state NEW,ESTABLISHED -m time --timestart 06:00 --timestop 18:00  --weekdays Mon,Tue,Wed,Thu,Fri --kerneltz -j REJECT</pre>



<p>比起限制 Facebook 的指令，這邊多了 weekdays ，只限制星期一到星期五的晚上六點之前，六點之後因為在家就可以直接限制了</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2015/12/15/1885/linux-%e9%99%90%e5%88%b6%e6%99%82%e9%96%93%e4%b8%8a-facebook/">[Linux] 限制時間上 Facebook</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2015/12/15/1885/linux-%e9%99%90%e5%88%b6%e6%99%82%e9%96%93%e4%b8%8a-facebook/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Gentoo 連 Hinet 的 Tunnel Broker</title>
		<link>https://blog.richliu.com/2013/03/21/1424/gentoo-%e9%80%a3-hinet-%e7%9a%84-tunnel-broker/</link>
					<comments>https://blog.richliu.com/2013/03/21/1424/gentoo-%e9%80%a3-hinet-%e7%9a%84-tunnel-broker/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Thu, 21 Mar 2013 06:58:51 +0000</pubDate>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[hinet]]></category>
		<category><![CDATA[IPv6]]></category>
		<category><![CDATA[tunnel broker]]></category>
		<category><![CDATA[中研院]]></category>
		<guid isPermaLink="false">http://blog.richliu.com/?p=1424</guid>

					<description><![CDATA[<p>剛剛看到中研院的公告 【障礙說明】總辦事處區域網路故障說明 查了一下, 發現 ASCC 的 IPv6 Tunn [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2013/03/21/1424/gentoo-%e9%80%a3-hinet-%e7%9a%84-tunnel-broker/">Gentoo 連 Hinet 的 Tunnel Broker</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>剛剛看到中研院的公告<br />
<a href="http://ascc.sinica.edu.tw/iascc/articals.php?_section=2.3&#038;_op=?articalID:4556" target="_blank" rel="noopener">【障礙說明】總辦事處區域網路故障說明</a><br />
查了一下, 發現 ASCC 的 IPv6 Tunnel Broker 不能用了, 所以只好暫時跳到 Hinet 的 Tunnel Broker 去. </p>
<p>我是 Hinet 浮動 IP 的用戶, 所以只能使用 Hinet IPv6 Tunnel Broker.<br />
請參考本站文章 <a href="http://blog.richliu.com/2012/04/28/1204/" target="_blank">Gentoo Gateway 連中研院的 IPv6 Tunnel Broker</a> 安裝 go6 的 Gateway Software. </p>
<p>在 gw6c.conf 有四處要修改<br />
[TEXT]<br />
userid=<hinet 8 位數帳號, 不需 @hinet.net><br />
passwd=</hinet><hinet 密碼><br />
server=203.74.21.88<br />
auth_method=passdss-3des-1<br />
[/TEXT]</p>
<p>這樣就可以從中研院跳到 Hinet 了. </p>
<p>Reference:<br />
<a href="http://www.ipv6.hinet.net/installGuide.htm" target="_blank" rel="noopener">HiNet IPv6 Tunnel Broker服務使用說明</a><br />
</hinet></p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2013/03/21/1424/gentoo-%e9%80%a3-hinet-%e7%9a%84-tunnel-broker/">Gentoo 連 Hinet 的 Tunnel Broker</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2013/03/21/1424/gentoo-%e9%80%a3-hinet-%e7%9a%84-tunnel-broker/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Youtube 某些特定的內容不能看.</title>
		<link>https://blog.richliu.com/2013/03/21/1422/youtube-%e6%9f%90%e4%ba%9b%e7%89%b9%e5%ae%9a%e7%9a%84%e5%85%a7%e5%ae%b9%e4%b8%8d%e8%83%bd%e7%9c%8b/</link>
					<comments>https://blog.richliu.com/2013/03/21/1422/youtube-%e6%9f%90%e4%ba%9b%e7%89%b9%e5%ae%9a%e7%9a%84%e5%85%a7%e5%ae%b9%e4%b8%8d%e8%83%bd%e7%9c%8b/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Thu, 21 Mar 2013 06:36:27 +0000</pubDate>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[隨手札記]]></category>
		<category><![CDATA[hinet]]></category>
		<category><![CDATA[IPv6]]></category>
		<category><![CDATA[Youtube]]></category>
		<category><![CDATA[不能看]]></category>
		<category><![CDATA[中研院]]></category>
		<category><![CDATA[加速]]></category>
		<category><![CDATA[問題]]></category>
		<guid isPermaLink="false">http://blog.richliu.com/?p=1422</guid>

					<description><![CDATA[<p>在看了大神HiNet 讓 YouTube 變快的方法：擋掉 210.71.222.0/24文章之後, 在 Ga [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2013/03/21/1422/youtube-%e6%9f%90%e4%ba%9b%e7%89%b9%e5%ae%9a%e7%9a%84%e5%85%a7%e5%ae%b9%e4%b8%8d%e8%83%bd%e7%9c%8b/">Youtube 某些特定的內容不能看.</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>在看了大神<a href="http://blog.gslin.org/archives/2013/03/01/3227/" target="_blank" rel="noopener">HiNet 讓 YouTube 變快的方法：擋掉 210.71.222.0/24</a>文章之後, 在 Gateway 上擋掉這個網段.<br />
使用一陣子之後發現還是會有問題,<br />
(1) 啟動比較慢<br />
(2) 某些特定的影片無法觀看.</p>
<p>(1)尚可忍受, (2) 是不能接受, 我自己的觀察是這些特定的影片是屬於華文地區專用影片, 像是&#8221;巧虎中文發音&#8221;之類的.<br />
其他地區也有的影片目前就個人所知, 不受影響, 我自己家是有 IPv6.<br />
所以目前也都還好, 就直接拿掉了. </p>
<p>一般人應該不會去看巧虎, 影響不大.<br />
註: <a href="http://ascc.sinica.edu.tw/iascc/articals.php?_section=2.3&#038;_op=?articalID:4556" target="_blank" rel="noopener">中研院目前 IPv6 的網段似乎有問題</a>, 所以看 Youtube 就更慢了&#8230;. (囧)</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2013/03/21/1422/youtube-%e6%9f%90%e4%ba%9b%e7%89%b9%e5%ae%9a%e7%9a%84%e5%85%a7%e5%ae%b9%e4%b8%8d%e8%83%bd%e7%9c%8b/">Youtube 某些特定的內容不能看.</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2013/03/21/1422/youtube-%e6%9f%90%e4%ba%9b%e7%89%b9%e5%ae%9a%e7%9a%84%e5%85%a7%e5%ae%b9%e4%b8%8d%e8%83%bd%e7%9c%8b/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Gentoo Gateway 連中研院的 IPv6 Tunnel Broker</title>
		<link>https://blog.richliu.com/2012/04/28/1204/gentoo-%e9%80%a3%e4%b8%ad%e7%a0%94%e9%99%a2%e7%9a%84-ipv6-tunnel-broker/</link>
					<comments>https://blog.richliu.com/2012/04/28/1204/gentoo-%e9%80%a3%e4%b8%ad%e7%a0%94%e9%99%a2%e7%9a%84-ipv6-tunnel-broker/#comments</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Fri, 27 Apr 2012 17:47:38 +0000</pubDate>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[gateway]]></category>
		<category><![CDATA[IPv6]]></category>
		<category><![CDATA[radvd]]></category>
		<category><![CDATA[tunnel broker]]></category>
		<category><![CDATA[中研院]]></category>
		<guid isPermaLink="false">http://blog.richliu.com/?p=1204</guid>

					<description><![CDATA[<p>自從從中華電信固3 IP 換光世代之後就失去了 IPv6 Address. 今天剛好在某 PTT 文上看到,  [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2012/04/28/1204/gentoo-%e9%80%a3%e4%b8%ad%e7%a0%94%e9%99%a2%e7%9a%84-ipv6-tunnel-broker/">Gentoo Gateway 連中研院的 IPv6 Tunnel Broker</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>自從從中華電信固3 IP 換光世代之後就失去了 IPv6 Address. </p>
<p>今天剛好在某 PTT 文上看到, 中研院的 IPv6 Tunnel Broker 有給固定 IP 和 Prefix.<br />
這樣一來就可以搞家中 IPv6 Enable 了. </p>
<p>如果有 Gentoo 做 Gateway, 想讓家中 Intranet 有 IPv6 的環境, 就需要按照這一篇設定. </p>
<p>換 IPv6 最大的好處是什麼? 用中研院的網路看 Youtube 超順的&#8230;<br />
<span id="more-1204"></span><br />
首先去 <a href="http://tb2.ipv6.ascc.net/" target="_blank" rel="noopener">http://tb2.ipv6.ascc.net/</a> 申請帳號.<br />
最好寄密碼到信箱, 要不然打錯密碼很悶的 ..</p>
<p>到 <a href="http://www.go6.net/4105/download.asp" target="_blank" rel="noopener">http://www.go6.net/4105/download.asp</a><br />
下載 Client 6.0 Platform Specific Build &#8211; Linux 和 Client 6.0 Source Code (Linux/Unix/Darwin/BSD)<br />
我是懶得 install, 所以解壓縮 Linux binary 的 gw6c 之後, 再 compile 新的, 蓋掉舊的 gw6c binary . </p>
<p>解壓縮完目錄像這樣, gw6c binary 在 bin/<br />
[TEXT]<br />
xxx gw6c # ls -lF<br />
total 16<br />
drwxr-xr-x 2 root root 4096 Apr 28 01:22 bin/<br />
drwxr-xr-x 4 root root 4096 Mar 13  2009 man/<br />
drwxr-xr-x 2 root root 4096 Apr 28 01:21 template/<br />
[/TEXT]</p>
<p>編輯 bin/gw6c.conf<br />
[TEXT]<br />
userid=< 申請帳號><br />
passwd=< 申請密碼><br />
server=tb2.ipv6.ascc.net<br />
auth_method=digest-md5<br />
host_type=router<br />
prefixlen=64<br />
if_prefix=< 網卡介面, 我是用eth1><br />
gw6_dir=< 路徑>/gw6c<br />
[/TEXT]<br />
<> 請代換成自己的參數</p>
<p>如果只是單機要連線, host_type 要設 host , if_prefix 不用設定.<br />
[TEXT]<br />
host_type=host<br />
[/TEXT]</p>
<p>Gentoo 的話記得先安裝 RADVD (host_type=host 不需要)<br />
[BASH]<br />
# emerge -av radvd<br />
[/BASH]<br />
如果是初次設定, 別忘了 ip6table 要改 MTU<br />
[BASH]<br />
# ip6tables -A FORWARD -p tcp &#8211;tcp-flags SYN,RST SYN -j TCPMSS  &#8211;clamp-mss-to-pmtu<br />
# /etc/init.d/ip6tables save<br />
# rc-update add ip6tables default<br />
[/BASH]<br />
這樣下次開機的時候就會自動設定 ip6tables </p>
<p>接下來就直接跑<br />
[BASH]<br />
# ./gw6c -f gw6c.conf<br />
# ifconfig<br />
[/BASH]<br />
如果 sit1 有起來, 表示 IPv6 設定成功,<br />
如果沒有起來, 就改 gw6c.conf加上<br />
[TEXT]<br />
log_file=3<br />
[/TEXT]<br />
重新執行一次 gw6c 看看會發生什麼事情 . Log 會記錄在 gw6c.log 內. </p>
<p>P.S Gentoo nettool 1.6 以後 ifconfig 和 route 這二個命令改位置了.<br />
如果有碰到連不上的狀況, 而且是 command 錯誤, 請修改 template/linux.sh 內這幾行<br />
[TEXT]<br />
 79 ifconfig=/bin/ifconfig<br />
 80 route=/bin/route<br />
195    ExecNoCheck $ifconfig $TSP_TUNNEL_INTERFACE add $TSP_CLIENT_ADDRESS_IPV6/$TSP_TUNNEL_PREFIXLEN<br />
196    ExecNoCheck $ifconfig $TSP_TUNNEL_INTERFACE mtu 1280<br />
[/TEXT]</p>
<p>我的 IPv6 又可以用了, 不過某些網站似乎怪怪的 :-/</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2012/04/28/1204/gentoo-%e9%80%a3%e4%b8%ad%e7%a0%94%e9%99%a2%e7%9a%84-ipv6-tunnel-broker/">Gentoo Gateway 連中研院的 IPv6 Tunnel Broker</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2012/04/28/1204/gentoo-%e9%80%a3%e4%b8%ad%e7%a0%94%e9%99%a2%e7%9a%84-ipv6-tunnel-broker/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
		<item>
		<title>[Linux] 使用 hinet IPv6 的服務</title>
		<link>https://blog.richliu.com/2010/07/30/976/linux-%e4%bd%bf%e7%94%a8-hinet-ipv6-%e7%9a%84%e6%9c%8d%e5%8b%99/</link>
					<comments>https://blog.richliu.com/2010/07/30/976/linux-%e4%bd%bf%e7%94%a8-hinet-ipv6-%e7%9a%84%e6%9c%8d%e5%8b%99/#comments</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Fri, 30 Jul 2010 09:25:03 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[hinet]]></category>
		<category><![CDATA[IPv6]]></category>
		<category><![CDATA[tunnel broker]]></category>
		<category><![CDATA[ubuntu]]></category>
		<guid isPermaLink="false">http://blog.richliu.com/?p=976</guid>

					<description><![CDATA[<p>這邊使用的是 Hinet Tunnel Broker 的服務. 不過 Hinet 只有提供 Windows 的 [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2010/07/30/976/linux-%e4%bd%bf%e7%94%a8-hinet-ipv6-%e7%9a%84%e6%9c%8d%e5%8b%99/">[Linux] 使用 hinet IPv6 的服務</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>這邊使用的是<a href="http://www.ipv6.hinet.net/installGuide.htm" target="_blank" rel="noopener"> Hinet Tunnel Broker </a>的服務.<br />
不過 Hinet 只有提供 Windows 的範例, 那 Linux 呢?<br />
<span id="more-976"></span><br />
以 ubuntu 為例, 只要安裝  gw6c 這個套件(Go6 client)<br />
[BASH]<br />
# sudo apt-get install gw6c<br />
&#8230;<br />
因為會自動啟動 gw6c, 所以先暫停<br />
# /etc/init.d/gw6c stop<br />
[/BASH]</p>
<p>編輯 gw6c configure file.<br />
[BASH]<br />
$ vim /etc//etc/gw6c/gw6c.conf<br />
[/BASH]</p>
<p>找到 server= 改成<br />
[TEXT]<br />
server=203.74.21.89<br />
[/TEXT]</p>
<p>再重新啟動 gw6c, 這樣就可以了<br />
[BASH]<br />
# /etc/init.d/gw6c start<br />
# ifconfig tun<br />
tun       Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00<br />
          inet6 addr: 2001:b020:0:71::50/128 Scope:Global<br />
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1280  Metric:1<br />
          RX packets:126 errors:0 dropped:0 overruns:0 frame:0<br />
          TX packets:132 errors:0 dropped:0 overruns:0 carrier:0<br />
          collisions:0 txqueuelen:500<br />
          RX bytes:66341 (66.3 KB)  TX bytes:12783 (12.7 KB)</p>
<p>root@rl-desktop:/etc/gw6c# ping6 ipv6.google.com<br />
PING ipv6.google.com(2404:6800:8003::68) 56 data bytes<br />
64 bytes from 2404:6800:8003::68: icmp_seq=1 ttl=53 time=30.0 ms<br />
&#8212; ipv6.google.com ping statistics &#8212;<br />
1 packets transmitted, 1 received, 0% packet loss, time 0ms<br />
rtt min/avg/max/mdev = 30.021/30.021/30.021/0.000 ms<br />
[/BASH]</p>
<p>超簡單的吧! </p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2010/07/30/976/linux-%e4%bd%bf%e7%94%a8-hinet-ipv6-%e7%9a%84%e6%9c%8d%e5%8b%99/">[Linux] 使用 hinet IPv6 的服務</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2010/07/30/976/linux-%e4%bd%bf%e7%94%a8-hinet-ipv6-%e7%9a%84%e6%9c%8d%e5%8b%99/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>[IPv6] 使用 Gentoo Linux 建置 IPv6 Network.</title>
		<link>https://blog.richliu.com/2007/05/31/489/ipv6-%e4%bd%bf%e7%94%a8-gentoo-linux-%e5%bb%ba%e7%bd%ae-ipv6-network/</link>
					<comments>https://blog.richliu.com/2007/05/31/489/ipv6-%e4%bd%bf%e7%94%a8-gentoo-linux-%e5%bb%ba%e7%bd%ae-ipv6-network/#comments</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Thu, 31 May 2007 02:05:57 +0000</pubDate>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[IPv6]]></category>
		<guid isPermaLink="false">http://blog.richliu.com/2007/05/31/489/</guid>

					<description><![CDATA[<p>5/30 是個值得記念的日子, 我住的地方終於可以大聲說 IPv6 Network Ready. 今年是 20 [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2007/05/31/489/ipv6-%e4%bd%bf%e7%94%a8-gentoo-linux-%e5%bb%ba%e7%bd%ae-ipv6-network/">[IPv6] 使用 Gentoo Linux 建置 IPv6 Network.</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>5/30 是個值得記念的日子, 我住的地方終於可以大聲說 IPv6 Network Ready.<br />
今年是 2007 年, 離 APNIC 正式發放 IPv6 Address 也快十年了.<br />
終於可以連上 IPv6 網路了.</p>
<p>軟體和文件其實很多, 不過除了 IPv6 和 IPv4 的習慣不一樣, 架構也不一樣<br />
在使用上也會有很大的差異.<br />
而目前除了實驗性計劃外, 在家能連上 IPv6 的機會其實不多,<br />
看來台灣要走 IPv6 的路還很長, 畢竟, 你身邊有多少人在用 IPv6 呢?<br />
<span id="more-489"></span><br />
剛好剛剛整完 IPv6 ,籍這樣的機會,  這邊就順便介紹一下, 怎麼樣讓你家 ADSL 升級 IPv6 Ready. 不過目前請注意, 架設完 IPv6 只有爽度增加, 實用性近乎 0.</p>
<p>1. 準備<br />
(1) 必需是 Hinet 的客戶, 包含 ADSL 和 ISP 都是.<br />
(2) 必需是 ADSL 固定制或是網路制, 簡言之, 用 PPPoE 撥接上網的統統不行. (專線不在討論範圍之內). 如果還是不知道, 那一個月網路費帳單沒有超過 1300 元的應該都沒有 :p</p>
<p>確定好自己的網路之後, 請到<a href="http://www.ipv6.hinet.net/" target="_blank" rel="noopener">http://www.ipv6.hinet.net/</a> 上, <span><a href="http://www.ipv6.hinet.net/form/ipv6-apply-form.doc" target="new" rel="noopener">中華電信股份有限公司網際資訊網路業務 ( IPv6 試用 ) 租用及異動申請書</a> 及 </span> <a href="http://www.ipv6.hinet.net/form/try-form.doc" target="new" rel="noopener">&gt;HiNet IPv6 網際資訊網路業務試用同意書</a><br />
這兩份文件下載, 填寫完以後, 寄回到</p>
<blockquote><p>地址：台北市信義路一段二十一號數據通信大樓行銷處 ) 提出申請，並請於信封上註明為IPv6試用服務申請。</p></blockquote>
<p>接下來就是等到 Hinet 與你連繫, 並將 IPv6 的資訊給你.<br />
(如果有很多人看到這篇文章去申請, 承辦人應該會很討厭我吧 XD)</p>
<p>2. Linux 環境設定.<br />
關於 Linux Kernel 如何 compile IPv6 的方法, 這邊我就偷懶, 不想寫了.</p>
<p>我配發到的是(因為不太喜歡將公開資訊放在網路上, 所有的 IP 都有修改過, 和原來的不一樣, 不過因為美觀因素, 還是不要改成 &#8220;X&#8221; 之類的字樣)</p>
<blockquote><p>您的介接介面位址是 2001:b02a:0:7::2/64<br />
HiNet局端的介面位址是2001:b02a:0:7::1/64<br />
您的內部網段(LAN)的IPv6位址是2001:b021:1B::/48<br />
您的tunnel ip: 59.125.78.157<br />
局端tunnel ip: 210.65.11.26</p></blockquote>
<p>/48 , IPv6 有  128Bit 耶, 這樣我家每樣物品都給一個 IP 也用不完呀,<br />
是不是太浪費了一點.<br />
電視一個 IP, 電視搖控器一個, 冷氣二個, 冷氣搖控器 4 個. 棉被一個  &#8230;&#8230;<br />
希望 Hinet 不要收回去才好 <img src="https://s.w.org/images/core/emoji/15.0.3/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>在設定 Tunnel 之前, 先確定是不是有 iproute2 套件, 如果沒有, 請安裝</p>
<blockquote><p># emerge sys-apps/iproute2</p></blockquote>
<p>其實重點還是, 其他的套件也需要有 IPv6 支援, 可以在 make.conf 內早點加上 ipv6 字樣, 這樣才不用統統重編 .. :p</p>
<p>接下來就是要設定 Tunnel, 而設定 Tunnel 也很簡單, 寫個 Shell Script 如下, 將 IPv4 和 IPv6 位置代換成 Hinet 發給你的位置就可以了.</p>
<blockquote><p>#!/bin/sh<br />
LOCALIP=59.125.78.157<br />
REMOTEIP=210.65.11.26<br />
LOCALV6IP=2001:b02a:0:7::2/64</p>
<p>ip link set sixbone down<br />
ip tunnel add sixbone mode sit remote $REMOTEIP local $LOCALIP ttl 64 dev eth0<br />
#(Extract the tunneling overhead from the MTU)<br />
ip link set sixbone mtu 1480<br />
#(Bring the tunnel up)<br />
ip link set sixbone up<br />
#(Assign the IPv6 address to it)<br />
ip addr add $LOCALV6IP dev sixbone<br />
#(Route all global unicast IPv6 addresses through our &#8216;sixbone&#8217; tunnel device)<br />
ip route add 2000::/3 dev sixbone</p></blockquote>
<p>這邊有二件事要注意<br />
1. sixbone 是可以代換成其他的名字, 我是直接延用,<br />
2. 原來的 MTU 是設 1200, 我試過 1400 也 OK. 所以就用到現在.</p>
<p>*2011/3/22 註: 我的環境最大可以設到 1480. 所以我就設定大一點了.</p>
<p>執行完這個 Script 以後, 應該就可以正常的連到 IPv6 的網路了. 找個站台來測試一下,</p>
<blockquote><p># ping6 www.kame.net<br />
PING www.kame.net(orange.kame.net) 56 data bytes<br />
64 bytes from orange.kame.net: icmp_seq=1 ttl=57 time=108 ms<br />
64 bytes from 2001:200:0:8002:203:47ff:fea5:3085: icmp_seq=2 ttl=57 time=103 ms<br />
64 bytes from 2001:200:0:8002:203:47ff:fea5:3085: icmp_seq=3 ttl=57 time=102 ms</p>
<p>&#8212; www.kame.net ping statistics &#8212;<br />
3 packets transmitted, 3 received, 0% packet loss, time 15816ms<br />
rtt min/avg/max/mdev = 102.793/105.090/108.683/2.586 ms</p></blockquote>
<p>如果你現在 Linux 上有  GUI 介面, 可以連到 http://www.kame.net , 上面那隻海龜就會動 了.</p>
<p>2. 讓家中的電腦也可以輕易的用 IPv6 互連.</p>
<p>如果要讓家中的電腦也可以偷偷的 IPv6 化, 因為 Linux 幾乎都內建 IPv6, 這邊要講的是 Windows XP, 以這篇文章發表的時間來看, 大家應該都是裝 Windows XP SP2, 這一版要支援 IPv6 非常簡單. 在 command 模式下, 執行以下指令</p>
<blockquote><p># ipv6 install</p></blockquote>
<p>這樣 Windows XP 就可以支援 IPv6 了.</p>
<p>接下來總是要配發一下 IP 吧.</p>
<p>IPv6 自動配發 IP 的方式有三種<br />
1. Stateless auto-configuration</p>
<p>這個就是預設 IPv6 啟動就有, fe80:: 開頭的 IPv6 位置, 會自動分配好. 屬於 Local Link IP Address, 這個不在本文討論範圍內.</p>
<p>2. Stateful auto-configuration using Router Advertisement Daemon (radvd)</p>
<p>使用 radvd 發送 Router Advertisement Packet, 當 IPv6 Client 端收到這個 Packet, 會自動設定 IP Address, 並且以 radvd 的機器做為 Server.<br />
首先, 先安裝 radvd 吧</p>
<blockquote><p># emerge radvd</p></blockquote>
<p>我是有 Assign 一個 IP 給要發 RADVD 的 Interface</p>
<blockquote><p># ifconfig eth1 inet6 add 2001:b021:1B::1/48</p></blockquote>
<p>接下來就是開一個新檔 /etc/radvd.conf</p>
<blockquote><p>interface eth1<br />
{<br />
AdvSendAdvert on;<br />
MinRtrAdvInterval 3;<br />
MaxRtrAdvInterval 10;<br />
prefix 2001:b021:1B::/64<br />
{<br />
AdvOnLink on;<br />
AdvAutonomous on;<br />
AdvRouterAddr on;</p>
<p>};<br />
};</p></blockquote>
<p>再啟動 radvd , 並將 radvd 設為預設啟動</p>
<blockquote><p># /etc/init.d/radvd start<br />
# rc-update add radvd default</p></blockquote>
<p>正常的狀況下, 你的 Windows XP 現在的 IPv6 的 IP 也會加上 2001:b021:1B:xxxxxxx<br />
Route 也會自動設定好, 就直接可以上網了 XD.<br />
請注意: 我這邊如果 prefix 設 /48 會有問題, 要改用 /64</p>
<p>3. Dynamic Host Configuration Protocol v6 (DHCPv6)</p>
<p>因為 radvd 會依照 Client 端的網路卡 Auto Assign 一個 Address 給 Client, 如果不希望使用 radvd 分配 IP 給 Client , 就要使用 DHCPv6 Server 分配.<br />
同樣的, 我們先編輯一個檔案 /etc/dhcp6s.conf</p>
<blockquote><p>prefer-life-time 10000;<br />
valid-life-time 20000;<br />
renew-time 5000;<br />
rebind-time 8000;<br />
interface eth1 {<br />
link AAA {<br />
allow unicast;<br />
send unicast;<br />
allow rapid-commit;<br />
renew-time 1000;<br />
rebind-time 2400;<br />
prefer-life-time 2000;<br />
valid-life-time 3000;<br />
pool{<br />
range 2001:b021:1B::10 to 2001:b021:1B::210/64;<br />
prefix 2001:b021:1B::/48;<br />
};<br />
};<br />
};</p></blockquote>
<p>然後再啟動 dhcp6s</p>
<blockquote><p>#/etc/init.d/dhcp6s start</p></blockquote>
<p>如果 Client 要 IP  時就很簡單了</p>
<blockquote><p># dhcp6c eth0</p></blockquote>
<p>這樣就可以了</p>
<p>20100721 Update:</p>
<p>如果是使用 IPv4 Tunnel 的方式, 因為 MTU 不一樣(我是設 1400), 所以 Linux 下要再加上一行</p>
<p>[BASH]<br />
# ip6tables -A FORWARD -p tcp &#8211;tcp-flags SYN,RST SYN -j TCPMSS  &#8211;clamp-mss-to-pmtu<br />
[/BASH]</p>
<p>這樣才可以正確的和某些站台連線.</p>
<p>剛學 IPv6 沒有多久, 希望這一篇文章能做一些拋磚引玉的作用, 吸引更多人來用 IPv6</p>
<p>Ref.<br />
<a href="http://www.gentoo.org/doc/en/ipv6.xml" target="_blank" rel="noopener">Gentoo IPv6 Router Guide</a><br />
<a href="http://www.ipv6.org.tw/NDHU/article/20020718.htm" target="_blank" rel="noopener">Linux上的IPv6路由</a></p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2007/05/31/489/ipv6-%e4%bd%bf%e7%94%a8-gentoo-linux-%e5%bb%ba%e7%bd%ae-ipv6-network/">[IPv6] 使用 Gentoo Linux 建置 IPv6 Network.</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2007/05/31/489/ipv6-%e4%bd%bf%e7%94%a8-gentoo-linux-%e5%bb%ba%e7%bd%ae-ipv6-network/feed/</wfw:commentRss>
			<slash:comments>9</slash:comments>
		
		
			</item>
	</channel>
</rss>
