2011年1月21日 星期五

ubuntu設定ipv6

安裝 vi 加強版 #操作 vi 怪怪的,所以安裝加強版
apt-get install vim
網路設定 (設定固定ip,dhcp為自動取得ip)
vi /etc/network/interfaces
auto eth0
iface eth0 inet static
address 163.23.115.193
netmask 255.255.255.192
gateway 163.23.115.254
#同一張網卡新增一個虛擬的網路ip
auto eth0:0
iface eth0:0 inet static
address 172.20.1.248
netmask 255.255.255.0
gateway 172.20.1.254

/etc/init.d/networking restart #重新啟動網卡設定

如果沒有安裝 ncftp ,使用 apt-get install ncftp 來安裝
cd pub/ols3tools/
get ols3dns-1.0.5p.tar.gz
exit
tar zxvf ols3dns-1.0.5p.tar.gz
./ols3dns

檢查設定檔 (一定要檢查)
vi /etc/bind/named.conf
將路徑 /var/named 修改成 /etc/bind
vi /etc/bind/db.XXX.XXX.XX
vi /etc/bind/db.XXX.XXX.XXX
重新啟動 named
/etc/init.d/bind9 restart


ipv6
----------------------------------------------------
參考http://blogs.yyes.chc.edu.tw/post/2/2723

ifconfig
看網卡是否支援IPv6
出現inet6 addr表示支援
sudo vi /etc/networkinterfaces
iface eth0 inet6 static
address 2001:288:xxxx::2
netmask 48
gateway 2001:288:xxxx::1
sudo /etc/init.d/networking restart
網路連線測試
以「ping6」指令 ping 到「ipv6.l.google.com」
ping6 2404:6800:8005::6a

DNS 伺服器設定
sudo vi /etc/bind/named.conf
在 options 區段內有些 Bind 版本需加入以下內容:
listen-on-v6 { any; };
DNS 正解檔設定
vi /etc/bind/db.hnps.chc.edu.tw 裡列出正解設定,
IPv6 的寫法除了IP位址不同外,另一差別只是將「A」改成「AAAA」,
加上兩列關於這兩部主機新的設定:
dns             IN      AAAA    2001:288:xxxx::2
www           IN      AAAA    2001:288:xxxx::2

重新啟動DNS
sudo /etc/init.d/bind9 restart
測試
nslookup
> server 163.23.115.xx
Default server: 163.23.115.xx
Address: 163.23.115.xx#53

沒有留言:

張貼留言