分享好友 系统运维首页 频道列表

Linux IPv6 Router: RADVD + DHCPv6

Linux系统  2023-02-09 23:470

Unlike IPv4, which uses DHCP for configuration, IPv6 uses the Neighbor Discovery Protocol to configure addresses and gateways. Unfortunately, originally the protocol had no means of providing addresses of DNS servers to clients, making it necessary to use DHCPv6 for that purpose. Modern Linux and Mac OS X machines are able to use the IPv6 Router Advertisement Options for DNS Configuration (RFC 6106), but to my knowledge, Windows clients are not able at the moment. Here’s how to configure a Linux router using radvd and the ISC DHCP daemon.

Network Configuration and Packet Forwarding

The following configuration has been tested with Ubuntu Server 12.04.2 LTS. For the purposes of this article, the /etc/network/interfaces file looks like this:

# eth0 to Internet
iface eth0 inet6 static
address 2001:db8:0:1::2
netmask 64
gateway 2001:db8:0:1::1

# eth1 to internal network
iface eth1 inet6 static
address 2001:db8:0:2::1
netmask 64

Outbound interface is eth0, and inbound interface eth1.

First, to enable IPv6 packet forwarding, put this in your /etc/sysctl.conf:

net.ipv6.conf.all.forwarding=1
And run this to make the change in the running kernel:

sudo sysctl -w net.ipv6.conf.all.forwarding=1

IPv6 Router Advertisement Daemon

Install the router advertisement daemon or radvd with:

sudo apt-get install radvd

Create file /etc/radvd.conf and put your internal interface and prefix there:

interface eth1
{
    AdvSendAdvert on;
    prefix 2001:db8:0:2::/64
    {
    };
};

You can now start the daemon with

sudo service radvd start

That will enable router advertisements on the internal interface. See example configuration files under /usr/share/doc/radvd/examples. See also manual pages for radvd(8) and radvd.conf(5) for more information. The radvdump(8) is a useful tool for watching live router advertisement traffic.

The RDNSS and DNSSL Options

Below is an example radvd.conf which also advertises DNS servers with RDNSS and DNS search path with DNSSL, both of which are specified in RFC 6106. This will work with Linux and Mac OS X clients, but unfortunately Windows does not seem to support it.

interface eth1
{
    AdvSendAdvert on;
    MinRtrAdvInterval 3;
    MaxRtrAdvInterval 10;

    prefix 2001:db8:0:1::/64
    {
    };

    RDNSS 2001:db8:0:1::a 2001:db8:0:1::b
    {
        AdvRDNSSLifetime 10;
    };

    DNSSL koo.fi
    {
        AdvDNSSLLifetime 10;
    };
};

Restart radvd.

DHCPv6

To support Windows, we must install a DHCPv6 compliant DHCP server, such as a recent version of the ISC DHCP daemon:

sudo apt-get install isc-dhcp-server

Create file /etc/dhcp/dhcpd6.conf and put something like this in there:

ddns-update-style none;

default-lease-time 7200;
max-lease-time 86400;

subnet6 2001:db8:0:2::/64 {
    range6
    2001:db8:0:2::1000
    2001:db8:0:2::1fff;

    option dhcp6.name-servers
    2001:db8:0:1::a,
    2001:db8:0:1::b;

    option dhcp6.domain-search
    "koo.fi";
}

We configured a pool of 4096 addresses here (::1000-1fff), plus DNS servers and search path.

Start the dhcpv6 server:

sudo service isc-dhcp-server6 start

If it fails, see /var/log/syslog for error messages. Finally, if everything went ok, add to default runlevels:

sudo update-rc.d isc-dhcp-server6 defaults

Now you should be able to get an IPv6 address and DNS servers with a DHCP client. 


原文地址:

http://koo.fi/blog/2013/03/20/linux-ipv6-router-radvd-dhcpv6/

查看更多关于【Linux系统】的文章

展开全文
相关推荐
反对 0
举报 0
评论 0
图文资讯
热门推荐
优选好物
更多热点专题
更多推荐文章
linux下如何单独编译设备树? linux设备树是什么
答: make vendor/device_name.dtb  如: make freescale/fsl-1043a-rdb.dtb

0评论2023-02-10369

移植linux3.7到nuc900系列开发板遇到的问题
通过移植学习linux新版本内核,大概了解一下内核变化。记录一下移植过程中遇到的问题或值得注意的地方。1,添加一款arm9芯片的支持首先修改\arch\arm\tools\mach-types文件添加一行w90p950evbMACH_W90P950EVBW90P950EVB同目录下的脚本文件在编译内核时会根据

0评论2023-02-10697

linux下安装redis3.2
这部分来自网络: http://blog.csdn.net/cuibruce/article/details/535015321.下载下载地址:http://www.redis.io/download选取当前最新版本3.2.1下载,上传到linux上,进行解压缩:[root@mongodb1 redis]# lsredis-3.2.1 redis-3.2.1.tar.gz进入redis-3.2.1目录

0评论2023-02-10962

终于解决了Linux下运行OCCI程序一直报Error while trying to retrieve text for error ORA-01804错误
终于解决了Linux下运行OCCI程序一直报Error while trying to retrieve text for error ORA-01804错误http://blog.csdn.net/zklth/article/details/7184032Linux下 和 Windows 下 Oracle Instant Client 的安装.http://fableking.iteye.com/blog/2115724 http

0评论2023-02-10637

linux lvm删除导致无法启动
要想编辑/etc/fstab文件,我们需要在系统中重新挂载根目录,使其具有可读写状态,使用如下命令:mount -o remount,rw /该条命令的作用是,以可读写的形式重新挂载根分区。然后再编辑/etc/fstab文件,就可以正常编辑。如下:

0评论2023-02-10931

linux中的strip命令简介------给文件脱衣服【转】
转自:http://blog.csdn.net/stpeace/article/details/47090255版权声明:本文为博主原创文章,转载时请务必注明本文地址, 禁止用于任何商业用途, 否则会用法律维权。作为一名Linux开发人员, 如果没有听说过strip命令, 那是很不应该的。 strip这个单词,

0评论2023-02-10728

linux下常用文件系统 linux支持的文件系统
不同的操作系统需要使用不同类型的文件系统,为了与其他操作系统兼容,以相互交换数据,通常操作系统都能支持多种类型的文件系统。Linux内核支持十多种不同类型的文件系统,下面对Linux常用的文件系统作一个简单介绍。ext2与ext3文件系统ext是第一个专门为Lin

0评论2023-02-10794

linux下将Python环境默认更改为Python3.6
步骤:#删除原来指向python2的软链接sudo mv /usr/bin/python /usr/bin/python.bak #/usr/local/python3.6/bin/python3.6 这个路径为实际的python3.6的bin文件夹下的Python3.6的路径,这个按照自己的实际情况进行更改 sudo ln -s /usr/bin/python3.6 /usr/bin

0评论2023-02-10852

Linux更改SSH默认端口 linux设置ssh端口
1.修改ssh配置文件  vim /etc/ssh/sshd_config  将 #Port 22 改为 Port 10023(更改的端口号最好在1024~65535间,不和其他服务端口冲突就ok)2.关闭防火墙  systemctl stop firewalld.service3.重启ssh服务  systemctl restart sshd.service4.新建ssh

0评论2023-02-10765

mongodb 对内存的占用监控 ——mongostat,linux系统可用的内存是free + buffers + cached
刚开始使用mongodb的时候,不太注意mongodb的内存使用,但通过查资料发现mongodb对内存的占用是巨大的,在本地测试服务器中,8G的内存居然被占用了45%。汗呀。 本文就来剖析一下mongodb对内存的具体使用方法,以及生产环境针对mongodb占大量内存的问题的解决

0评论2023-02-10641

更多推荐