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

use provided gateway 2001:4ba0:fffd:1:beef::1 /128 instead of fe80::1.

· 52CE 我爱测

I am trying to setup some IPV6 address on a FreeBSD 11 server, I was told to use as a gateway this IP: 2001:4ba0:fffd:1:beef::1 /128 My addresses are: 2001:4ba0:fffd:0063::0 /64 I tried this: ipv6_activate_all_interfaces="YES" ip…

问题原文

原帖链接 · nbari · CC BY-SA 3.0

I am trying to setup some IPV6 address on a FreeBSD 11 server, I was told to use as a gateway this IP:

2001:4ba0:fffd:1:beef::1 /128

My addresses are:

2001:4ba0:fffd:0063::0 /64

I tried this:

ipv6_activate_all_interfaces="YES"
ipv6_defaultrouter="2001:4ba0:fffd:1:beef::1"
ifconfig_bge0_ipv6="inet6 2001:4ba0:fffd:0063::1 prefixlen 64"

But I get this message:

route: writing to routing socket: Network is unreachable
add net default: gateway 2001:4ba0:fffd:1:beef::1 fib 0: Network is unreachable

By doing an npd -a I got this:

> ndp -a
Neighbor                             Linklayer Address  Netif Expire    S Flags
2001:4ba0:fffd:63::1                 2c:44:fd:9a:3f:90   bge0 permanent R
fe80::1%bge0                         28:92:4a:cd:08:18   bge0 22h8m42s  S R
fe80::2a92:4aff:fecd:818%bge0        28:92:4a:cd:08:18   bge0 23h27m31s S R
fe80::2e44:fdff:fe9a:3f90%bge0       2c:44:fd:9a:3f:90   bge0 permanent R

Then I give a try to use as a default router fe80::1.:

ipv6_activate_all_interfaces="YES"
ipv6_defaultrouter="fe80::1%bge0"
ifconfig_bge0_ipv6="inet6 2001:4ba0:fffd:0063::1 prefixlen 64"

When using the link-local fe80::1 address as the gateway, IPV6 works.

I would like to know what are the advantages/disadvantagtes of using the link-local address as the gateway and also how to use the provied gateway or using either is the same ?

已采纳解答

原帖链接 · Sander Steffann · CC BY-SA 3.0

The IPv6 gateway address your got (2001:4ba0:fffd:1:beef::1) is not inside the subnet you got (2001:4ba0:fffd:0063::/64) so your box is right to complain that that network is unreachable.

Using the link-local address as default gateway is usually a good solution, as long as the link-local address of the gateway doesn't change. The address fe80::1 looks like a manually configured address which would indicate that it is provided intentionally and therefore probably stable.

It doesn't really matter what address you use for a gateway. The only thing that the address is used for is to determine the layer-2 (MAC) address of the gateway so that packets can be sent there. Whether the MAC address is found by looking up a global address or by using a link-local address doesn't make any difference for the actual packets being routed.

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

资料来源与适用范围

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

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

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