安装DHCPv6服务器-dhcp-4.1.1-P1

dhcp-4.1.1-P1

环境 ubuntu 12.04
工具 dhcp-4.1.1-P1.tar.gz或者dhcp-4.3.5.tar.gz等

1. 安装isc-dhcp

点击下载:https://www.isc.org/downloads/
编译安装
解压:

tar -xvf dhcp-4.1.1-P1.tar.gz

安装:

cd dhcp-4.1.1-P1
./configure
make
sudo make install

2. 配置文件

创建 /usr/local/etc/dhcp6.conf 作为配置文件:

Sample configuration file for ISC dhcpd
INTERFACES="eth0";
option domain-name "yl0880.yyy.com";
default-lease-time 6000;
max-lease-time 6000;
log-facility local7;

option dhcp6.autop-url code 230 = string;
option dhcp6.pcode code 41 = string;
option dhcp6.tcode code 42 = string;
option dhcp6.bootfile-url code 59 = string;

subnet6 fc00:1987:1007:2916::/64 {
    # address range
    range6 fc00:1987:1007:2916::0002 fc00:1987:1007:2916::fffe:fffe;

    # Default route
    # option dhcp6.next-hop fc00:1987:1007:2916::1;

    # DNS servers
    option dhcp6.name-servers fc00:1987:1007:2916::1,fc00:1987:1007:2916::2;
    #option dhcp6.name-servers fc00:1987:1007:2916::3,fc00:1987:1007:2916::4;

    # SIP servers
    option dhcp6.sip-servers-names "www.baidu.dddd";
    option dhcp6.sip-servers-addresses fc00:1987:1007:2916::300;

    # NIS servers
    option dhcp6.nis-servers fc00:1987:1007:2916::1;
    #option dhcp6.nis-domain-name www.baidu.com.;

    # NIS+ servers
    option dhcp6.nisp-servers fc00:1987:1007:2916::500;
    #option dhcp6.nisp-domain-name nisp1.yealink.com,nisp2.yealink.com;

    # SNTP servers
    option dhcp6.sntp-servers fc00:1987:1007:2916::600;

    #option dhcp6.server-id "dadas//xxoo";

    #option dhcp6.autop-url "http://[fc00:1987:1007:2916::fffe:fffc]:8888";
    option dhcp6.autop-url "http://www.sina.com.cn:8888";
    #option dhcp6.autop-url 64;
    option dhcp6.domain-search "dangdangdang";
    #option dhcp6.sntp-servers fc00:1987:1007:2916::1;


    #option dhcp6.tcode "China(Bei)";
    #option dhcp6.pcode "CST-8CDT,M3.1.6/9:00,M9.2.1/19:05";
    #option dhcp6.bootfile-url "http://10.3.15.126:8080/telnet.cfg";
}

创建空文件 /var/db/dhcp6.leases

3. 配置网卡

通过命令 ifconfig 获取当前网卡接口名称(eth0)
选择 fc00:1987:1007:2916::1/64作为 DHCP Server 的固定 IP(与 dhcpd6.conf 中的 subnet6 在同一网段即可)。

sudo ifconfig eth0 inet6 add fc00:1987:1007:2916::1/64   /*配置网卡静态IPv6地址*/

注:此处 eth0 为上文通过命令 ifconfig 获取的

4. 启动Server

dhcpd -6 -cf /usr/local/etc/dhcp6.conf -lf /var/db/dhcp6.leases  /*启动Server*/

注:一般需要关闭ubuntu的防火墙

sudo ufw disable

重启

5. 参考链接

ubuntu 搭建 IPv6 DHCP server: https://blog.csdn.net/rainforest_c/article/details/71172738
ISC-dhcp server for IPv6: http://xiaopangxiongyuan.blog.163.com/blog/static/12490117020116263115442/?COLLCC=2319623943&

阅读更多

没有更多推荐了,返回首页