2011年12月13日 星期二

B2D 伺服器 IPv6網卡設定!

學校伺服器網卡設定:
# vi /etc/network/interfaces
auto lo eth0
iface lo inet loopback
iface eth0 inet static
address 163.27.210.1
netmask 255.255.255.192
network 163.27.210.0
broadcast 163.27.210.63
gateway 163.27.210.62

iface eth0 inet6 static
address 2001:288:6200:217::1
netmask 64
up /sbin/ifconfig eth0 inet6 add 2001:288:6200:217::1 || true

重啟網卡,不知為何不成功?IPv6果然難搞。
我覺得我DNS設定應該沒錯,也經過再三dig的確認。靈機一動,下指令查網卡的設定:
# ifconfig
eth0  Link encap:Ethernet HWaddr 00:0E:2E:F0:BB:F2
        inet addr:163.27.210.1 Bcast:163.27.210.63 Mask:255.255.255.192
        inet6 addr: 2001:288:6200:217:20e:2eff:fef0:bbf2/64 Scope:Global
        inet6 addr: fe80::20e:2eff:fef0:bbf2/64 Scope:Link
        UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
        RX packets:9527 errors:0 dropped:0 overruns:0 frame:0
        TX packets:8079 errors:0 dropped:0 overruns:0 carrier:0
        collisions:0 txqueuelen:1000
        RX bytes:1202385 (1.1 MiB) TX bytes:2113003 (2.0 MiB)
        Interrupt:18 Base address:0x2c00

lo    Link encap:Local Loopback
       inet addr:127.0.0.1 Mask:255.0.0.0
       inet6 addr: ::1/128 Scope:Host
       UP LOOPBACK RUNNING MTU:16436 Metric:1
       RX packets:2276 errors:0 dropped:0 overruns:0 frame:0
       TX packets:2276 errors:0 dropped:0 overruns:0 carrier:0
       collisions:0 txqueuelen:0
       RX bytes:244782 (239.0 KiB) TX bytes:244782 (239.0 KiB)

果然網卡的IPv6位址 2001:288:6200:217::1,並沒有被啟動!
這就是因為啟用 IPv6 功能後,因為auto-configuration,自動建立的 Link-local 位址。為
2001:288:6200:217:20e:2eff:fef0:bbf2/64

死馬當活馬醫,直接以指令設定:
# ip -6 addr add 2001:288:6200:217::1/64 dev eth0

但每次重開機都要下這個指令實在麻煩,把它寫進防火牆設定檔就好。

# vi  /etc/init.d/rc.local
貼上 ip -6 addr add 2001:288:6200:217::1/64 dev eth0 










哎,累啊!

還好有臥龍小三的IPv6文件:
http://news.ols3.net/techdoc/new/ipv6_intro/
阿剛老師的設定示範:
http://kentxchang.blogspot.com/2011/11/ob2dipv6.html

沒有留言:

張貼留言