IPv6的Addressing可根據Router所發送的RA (Router Advertisement) message 中的(M bit, O bit)可分為三種狀態
(0,0) Stateless autoconfiguration -> 從Router得到prefix
(0,1) Stateless autoconfiguration -> 從Router得到prefix, 但像DHCP server要求DNS Server等其他資訊
(1,1) Stateful autoconfiguration -> 從DHCP server得到prefix以及DNS Server等其他資訊
----------------------------------------------------------------------------------------------------------------------------------------
Ubuntu 8.10的環境中安裝DHCPv6 Server (wide-dhcpv6-server)
1-1.利用 apt-get install
#sudo apt-get install wide-dhcpv6-server
ER:若遇到 "Cannot fetch to http://tw.archive.ubuntu.com"
表示server掛掉了, 換源至"http://ubuntu.cs.nctu.edu.tw"
SOL:
/*備份Souce List*/
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
/*修改Source List*/
sudo gedit /etc/apt/sources.list
搜尋字串 "tw.archive.ubuntu.com/" 替換成 "ubuntu.cs.nctu.edu.tw" 存檔
1-2.或至http://sourceforge.net/projects/wide-dhcpv6/下載source code
/*解壓縮*/
tar -zxvf wide-dhcpv6-20080615.tar.gz
/*切換至子目錄*/
cd wide-dhcpv6-2008-0615
/*Configure*/
sudo ./configure
/*Make*/
sudo make
ER1:
./common.h:158: error: conflicting types for ‘dprintf’
/usr/include/stdio.h:419: note: previous declaration of ‘dprintf’ was here
dhcp6c.c: In function ‘client6_recv’:
dhcp6c.c:1424: error: invalid application of ‘sizeof’ to incomplete type ‘struct in6_pktinfo’
dhcp6c.c:1433: error: dereferencing pointer to incomplete type
dhcp6c.c:1435: error: dereferencing pointer to incomplete type
make: *** [dhcp6c.o] Error 1
SOL1:
CFLAGS="-D _GNU_SOURCE" ./configure --prefix=""
perl -pi -e "s/dprintf/debug_printf/g" *.c *.h
ER2:
make: yacc: Command not found
SOL2:
sudo apt-get install bison
2.安裝成功後修改設定檔
sudo touch /etc/wide-dhcpv6/shcp6s.conf (若檔案存在則修改時間為現在, 若檔案不再則新建檔案)
sudo vim /etc/wide-dhcpv6/dhcp6s.conf
#Stateless mode
#If you want to use Stateless mode
#You can only keep the lines for the "option domain-name" below
option domain-name-servers 2001:b000::1 2001:b000::8;
option domain-name "happypeter.zyxel.net";
#Stateful mode
interface eth0 {
address-pool IPV6POOL 3600;
};
pool IPV6POOL {
range 2001:b021:2d::1000 to 2001:b021:2d::2000;
};
#For particular client to allocate an IPv6 address
#### For Peter team EXAMPLE###
#host dut1 {
#duid 00:03:00:01:40:4a:03:14:25:36; #Last is WAN MAC
#prefix 2001:b021:2d:2002::/48 infinity; #Delagated to LAN
#address 2001:b021:2d::2002 inifity; #WAN address
#};
3. 修改/etc/rc.local設定開機啟動wide-dhcpv6-server
sudo /etc/rc.local
(add)
#Enable WIDE-DHCPv6 Server
service wide-dhcpv6-server restart
exit 0
留言列表