大网数据广告活动
服务器运维问答

ipv6 distribute an ula prefix without an router

· 52CE 我爱测

I have a network which has no ipv6 connectivity to the internet. But I'd like to play a little with private networking. So I want to use ULAs for my devices and automatically distribute the prefix. I know that ipv6 uses router ad…

问题原文

原帖链接 · Scheintod · CC BY-SA 4.0

I have a network which has no ipv6 connectivity to the internet. But I'd like to play a little with private networking.

So I want to use ULAs for my devices and automatically distribute the prefix.

I know that ipv6 uses router advertisement to do so. But (hence the name...) it advertises a router, too. In my case using dnsmasq it's the address of the server running it. So it ends up in my clients as a default route.

Since I don't have a router and don't want my clients to have a default route is there a way to dynamically assign ula prefixes without a router?

And even more "advanced": Is there a way to use dhcpv6 without a router?

已采纳解答

原帖链接 · Scheintod · CC BY-SA 4.0

This is possible.

According to RFC 4861 (Neighbor Discovery in IPv6) Section 4.2. Router Advertisement Message Format:

Router Lifetime
[...]
A Lifetime of 0 indicates that the router is not a
default router and SHOULD NOT appear on the default
router list.  The Router Lifetime applies only to
the router's usefulness as a default router; it
does not apply to information contained in other
message fields or options.  Options that need time
limits for their information include their own
lifetime fields.

Using radvd this can be done with e.g.:

interface eth0
{
    AdvSendAdvert on;
    AdvDefaultLifetime 0;
    prefix fd10:1::/64
    {
    };
};

With dnsmasq this is what it could look like:

enable-ra
ra-param=eth0,0,0
dhcp-range=::,constructor:eth0,ra-stateless

(note the ra-param. The second zero is the router's lifetime) (although note that eth0 is configured to have fd10:1::XX/64)

Both result in an assigned prefix on the client used for stateless autoconfiguration which results in addresses like fd10:1::c00l:cafe:baad:food. No default route is set.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2021-11-18)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。