Windows XP Windows 7 Windows 2003 Windows Vista Windows教程綜合 Linux 系統教程
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟件教程
 Windows教程網 >> Linux系統教程 >> Linux教程 >> 阿裡雲 CentOS 如何添加IPV6支持

阿裡雲 CentOS 如何添加IPV6支持

日期:2017/2/7 14:23:22      編輯:Linux教程
 

默認情況下阿裡雲ECS禁用了IPV6的支持,首先要開啟系統的IPV6功能

修改/etc/sysconfig/network文件使NETWORKING_IPV6=yes
刪除/etc/modprobe.d/disable_ipv6.conf

到tunnelbroker.net注冊賬戶並創建一個 Regular Tunnel,需要填寫服務器的公網IP
注冊完成後到Example Configurations中找到系統自動生成的腳本,這裡我們選擇Linux-route2,先不要著急拿去執行


注意頁面下的這段提醒


NOTE: When behind a firewall appliance that passes protocol 41, use the IPv4 address you get from your appliance’s DHCP service instead of the IPv4 endpoint you provided to our broker.

這裡需要使用的是內網IP,而不是公網IP

所以我們要執行的代碼應該是這樣子的
modprobe ipv6
ip tunnel add he-ipv6 mode sit remote 0.0.0.0 local <你的內網IP> ttl 255
ip link set he-ipv6 up
ip addr add 00:00:00:00::2/64 dev he-ipv6
ip route add ::/0 dev he-ipv6
ip -f inet6 addr

執行完畢之後就可以在ifconfig中看到這個he-ipv6了,隨便ping6一個地址測試一下看看是否暢通

需要注意的是重啟服務器後he-ipv6就會消失,需要把這段代碼添加到自啟動中去,例如/etc/rc.d/rc.local。

另外還注意到一個問題,不知道是不是個例,阿裡雲ECS CentOS中/etc、/usr/bin目錄沒有寫權限,很奇怪的設定,不過默認PATH中/usr/local/bin的位置比/usr/bin靠前,所以放到/usr/local/bin中的文件會“覆蓋”掉系統原來的文件,但是很多自動化的腳本就無法運行了,甚至很多程序都無法正常編譯。 PS:我只是想升級一下CURL版本而已

Copyright © Windows教程網 All Rights Reserved