close

小編因為工作需要 所以用Ubuntu 14.04 架ipv6,由eth1來發ipv6

1. sudo apt-get install isc-dhcp-server   先安裝套件

 

2. set a static IPv6 address for the Interface I want to run the DHCPv6 server from that is part of the IPv6 network subnet outside the DHCP range.

sudo ifconfig eth0 inet6 add 2001:db8:0:1::128/64  (或直接去設定固定ipv6,請參考這篇:http://pk5566.blogspot.tw/2011/01/ubuntuipv6.html)

3. Edit the /etc/dhcp/dhcpd6.conf file to configure the DHCPv6 range etc.

 但設定檔只有#/etc/dhcp/dhcpd.conf所以來建一個設定檔給ipv6用.指令如下

 #cd /etc/dhcp/

# cp dhcpd.conf dhcpd6.con

#nano dhcpd6.con

內容如下

[ configure dhcpd6.conf ]
default-lease-time 600; 
max-lease-time 7200; 
log-facility local7; 
 
subnet6 2001:db8:0:1::/64 { 
             # Range for clients
             range6 2001:db8:0:1::129 2001:db8:0:1::254; 
             # Additional options 
             option dhcp6.name-servers fec0:0:0:1::1; 
             option dhcp6.domain-search "domain.example"; 
             # Prefix range for delegation to sub-routers 
             prefix6 2001:db8:0:100:: 2001:db8:0:f00:: /56; 
             # Example for a fixed host address (可加,可不加) 
             #host specialclient { 
                          #host-identifier    option dhcp6.client-id 00:01:00:01:4a:1f:ba:e3:60:b9:1f:01:23:45; 
                          #fixed-address6   2001:db8:0:1::127; 
             #} 
}

4. Create the /var/lib/dhcp/dhcpd6.leases

  是沒這檔案,需要自己建立,指令如下

 #cd /var/lib/dhcp

# cp dhcpd.leases dhcpd6.leases

#nano dhcpd6.leases

把你裡面容全部砍光光 就可以了....YA,並存擋

5. Manually start the DHCPv6 server. 指令如下

  #touch /var/lib/dhcp/dhcpd6.leases

  #sudo chmod 666 /var/lib/dhcp/dhcpd6.leases

 #chown dhcpd:dhcpd /var/lib/dhcp/dhcpd6.leases

 #sudo dhcpd -6 -f -cf /etc/dhcp/dhcpd6.conf eth1
 
就可以成功啟動ipv6
 
正確啟動會秀出
Internet Systems Consortium DHCP Server 4.1.0 
Copyright 2004-2008 Internet Systems Consortium. 
All rights reserved. 
For info, please visit http://www.isc.org/sw/dhcp/ 
Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified in the config file 
Wrote 0 leases to leases file. 
Bound to *:547 
Listening on Socket/5/eth1/2001:db8:0:1::/64 
Sending on   Socket/5/eth1/2001:db8:0:1::/64
 
 
 
補充:
****************************************************
Can't open /var/lib/dhcp/dhcpd6.leases for append. <-----錯誤訊息發生,輸入下面
 
sudo chmod 666 /var/lib/dhcp/dhcpd6.leases  <-----請輸入這行就可以解了
參考這:http://resdoss.blogspot.tw/2013/02/isc-dhcp-serveripv6.html
              http://takashi0922.blogspot.tw/2014/10/ubuntuipv6-dhcp-server.html
             https://www.shsh.ylc.edu.tw/~taichis/wp/?p=1003
 
arrow
arrow
    全站熱搜
    創作者介紹
    創作者 qqo9110 的頭像
    qqo9110

    阿藏哥的部落格~不應該阿

    qqo9110 發表在 痞客邦 留言(0) 人氣()