this is an translation from radvd english version,thanks slusarz
Router Advertisement (radvd) 配置 Radvd 配置文件位于 /etc/config/radvd. 配置文件用来定义radvd工作的接口,radvd广播的IPv6地址前缀,路由信息以及RDNSS信息。
Sections Radvd的配置文件一般由以下几个部分组成。Radvd的最小配置包含至少一个interface(接口)部分和一个prefix部分。每个部分可能出现多次,只有interface(接口)部分对于每个interface来说只出现一次。 Interface Interface指定了radvd工作的接口部分。默认情况radvd工作在lan上。
config 'interface'
option 'interface' 'lan'
option 'AdvSendAdvert' '1'
option 'AdvManagedFlag' '0'
option 'AdvOtherConfigFlag' '0'
option 'ignore' '1'
lan 配置文件应用的逻辑接口的名字。
AdvSendAdvert 1为1表示允许广播Router Advertisement和Router Solicitation消息。
AdvManagedFlag 0 为0表示禁止有状态自动配置。(RFC2462)
AdvOtherConfigFlag 0 为0表示禁止自动配置其他信息。 (RFC2462)
ignore 1 为1表示radvd不会工作在这个接口上。
Each interface requires a separate interface declaration (i.e. the interface option only accepts a single interface name). 下面是在interface部分定义的选项。.
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| interface | string | yes | (none) | 指定的接口名字 |
| ignore boolean | no | 0 | radvd不会在这个接口上工作。 | |
| IgnoreIfMissing | boolean | no | 0 | 如果指定的interface不存在的话,不要失败。 |
| UnicastOnly | boolean | no | 0 | 下层链路是非广播链路,不要发送飞征求的router advertisement。 |
| AdvSendAdvert | boolean | no | 0 | 允许routeradvertisement 和 router solicitation。 |
| AdvManagedFlag | boolean | no | 0 | 允许额外消息的有状态自动配置。(RFC2462) |
| AdvOtherConfigFlag | boolean | no | 0 | 允许处地址消息外的其他信息的有状态自动配置。(RFC2462) |
| AdvSourceLLAddress | boolean | no | 1 | 在Router Advertisement中包括发送接口的链路层地址。 |
| MinRtrAdvInterval | integer | no | 198 | 发送两次非征求的Router Advertisment消息的最小时间间隔,单位秒。 |
| MaxRtrAdvInterval | integer | no | 600 | 发送两次非征求的Router Advertisment消息的最大时间间隔,单位秒。 |
| MinDelayBetweenRAs | integer | no | 3 | 发送两次Router Advertisment消息的最小时间间隔,单位秒。 |
| AdvLinkMTU | integer | no | 0 | 允许发送链路层的MTU。 |
| AdvReachableTime | integer | no | 0 | 广播预设的邻居可达时间阈值,单位毫秒。 |
| AdvRetransTimer | integer | no | 0 | 广播两次neighbor solicitation之间的时间间隔,单位毫秒。 |
| AdvCurHopLimit | integer | no | 64 | 在Router Advertisment中广播默认的HopLimitRA. |
| AdvDefaultLifetime | integer | no | 1800 | 广播默认路由生命周期。 |
| AdvDefaultPreference | string | no | medium | 广播默认路由的优先级。 (low, medium or high) |
| AdvHomeAgentFlag | boolean | no | 0 | 广播移动IPv6家庭代理功能。(RFC3775) |
| AdvHomeAgentInfo | boolean | no | 0 | 在RA中包括家庭代理功能消息。 |
| AdvMobRtrSupportFlag | boolean | no | 0 | 广播移动路由信息。(NEMO Basic), depends on AdvHomeAgentInfo being enabled |
| AdvIntervalOpt | boolean | no | 0 | 在RA中包含移动IPv6广播间隔选项。 |
| HomeAgentLifetime | integer | no | 1800 | 广播移动IPv6家庭代理的生命周期,单位秒。依赖于AdvHomeAgentInfo 选项。 |
| HomeAgentPreference | integer | no | 0 | 发送RA的家庭代理的优先级。依赖于 AdvHomeAgentInfo 选项。 |
Prefix:前缀 前缀声明了用户的IPv6地址所在的子网。
config 'prefix'
option 'interface' 'lan'
option 'AdvOnLink' '1'
option 'AdvAutonomous' '1'
option 'AdvRouterAddr' '0'
option 'ignore' '1'
lan prefix部分应用的逻辑的接口名字。
AdvOnLink 1 指定被广播的prefix适口可以用来做OnLink判断。(RFC4861)
AdvAutonomous 1允许使用广播的prefix来做自动配置。 (RFC4862)
AdvRouterAddr 0 强制radvd发送网络前缀而不是接口地址。
ignore 1 在这个interface上禁止prefix广播消息。
Prefix部分定义的选项.
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| interface | string yes | (none) | Prefix部分所属的interface | |
| ignore | boolean | no | 0 | 忽略掉这个prefix |
| prefix | IPv6 address | no | (current prefix of interface) | Prefix信息(CIDR写法) |
| AdvOnLink | boolean | no | 1 | Prefix可以用来做OnLink判断。(RFC4861) |
| AdvAutonomous | boolean | no | 1 | Prefix可以用来做自动地址配置。 (RFC4862) |
| AdvRouterAddr | boolean | no | 0 | 为0表示发送接口地址而非网络地址前缀。 |
| AdvValidLifetime | integer/string | no | 86400 | Prefix用于OnLink判断的生命周期。Infinity 表示无限期。 |
| AdvPreferredLifetime | integer/string | no 14400 | 广播由prefix所生成的地址的生命周期。infinity 表示无限期。 | |
| Base6to4Interface | string | no | (none) |
the prefix option specified in the same section. If the referenced interface is not avilable at configuration time, radvd will leave it disabled until a SIGHUP signal is received or radvd is
restarted |
Route:路由 Router section 定义了广播给客户机的IPv6 CIDR路由。最小配置如下:
config 'route'
option 'interface' 'lan'
option 'prefix' '2001:0DB8:1234:5678::/64'
option 'AdvRouteLifetime' 'infinity'
lan route 部分应用的接口。
2001:0DB8:1234:5678::/64 被广播的前缀
AdvRouteLifetime infinity 生命周期永远。
The defined options for route sections are:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| interface | string | yes | (none) | 接口名字 |
| ignore | boolean | no | 0 | 忽略路由。 |
| prefix | IPv6 address | yes | (none) | IPv6路由信息。(CIDR记法) |
| AdvRouteLifetime | integer/string | no | 1800 | 路由的生命周期,单位秒。 |
| AdvRoutePreference | string no | medium | 默认路由的优先级。 |
RDNSS Recursive DNS Server (rdnss) sections 定义广播的DNS消息, RFC5006.最小配置如下: config 'rdnss'
option 'interface' 'lan'
option 'addr' '2001:0DB8:1234:5678::1'
lan 接口名字。
2001:0DB8:1234:5678::1 DNS解析服务器。
The options below are defined for rdnss sections:
| Name | Type | Required | Default | |
|---|---|---|---|---|
| interface | string | yes | (none) | 接口名字。 |
| ignore | boolean | no | 0 | 忽略DNS信息。 |
| addr | IPv6 address | no | (current address of interface) | 指定被广播的DNS服务器地址。 |
| AdvRDNSSPreference | integer | no | 8 |
经从最终RFC中去掉了,但目前仍然保留做实验作用。|
| AdvRDNSSOpen | boolean | no | 0 | 在用户迁移到其他子网时候,RDNSS时候是否依然可用。 |
| AdvRDNSSLifetime | integer/string | no | 1200 | RDNSS生命周期。0:不可用。infinity 长期有效。 |
绕过UCI 传统的radvd.conf仍然可以使用。我们需要在/etc/config/radvd 中定义如下section config 'radvd'
option 'config_file' '/etc/radvd.conf'
实例: 简单例子: 在两个内部接口上广播RA消息 wired 和 wifi, 使用缺省配置。
config interface
option interface wired
config prefix
option interface wired
config rdnss
option interface wired
config interface
option interface wifi
config prefix
option interface wifi
config rdnss
option interface wifi
zh-cn/doc/uci/radvd.txt · Last modified: 2013/01/18 16:17 by sjmaysee
