通过无线方式配置隐藏的 IPv6 网络

通过无线方式配置隐藏的 IPv6 网络

我正在尝试配置需要 IPv6 连接的新路由器,我设法通过修改接口文件通过以太网连接,但在通过无线连接时遇到了很大的麻烦。你能帮忙吗?

我是 ubuntu 新手,对网络和 ubuntu 本身了解甚少,请简单解释一下,我非常感谢任何帮助。

这是我设法创建的接口配置。

    # interfaces(5) file used by ifup(8) and ifdown(8)
# The loopback network interface

auto lo
iface lo inet loopback

# The primary network interface (eth0)
auto eth0
iface eth0 inet dhcp

# The primary network interface (wlan0)
auto lo
iface lo inet loopback
auto wlan0
iface wlan0 inet dhcp

# IPv6 Address Blocks
# Add a static block for your default public IPv6 address, and include a directive for its gateway.

iface eth0 inet6 static
    address 2001:db8:a0b:12f0::1/64
    gateway fe80::1

iface lo inet loopback
address fe80::b0b5:4cfb:ef29:2f98/64
netmask 255.255.255.0
network 192.168.0.21
broadcast 192.168.1.255
gateway 192.168.1.15

# add an additional block for each IPv6 address you need to configure.

iface eth0 inet6 static
    address 2001:db8:2000:aff0::1/64

iface wlan0 inet6 static
    address 2001:db8:2000:aff0::2/64

答案1

我找到了配置 2.4hz 无线连接的解决方案。更新后/etc/network/interfaces。我必须重新启动系统....

无论如何,这是代码

# interfaces(5) file used by ifup(8) and ifdown(8)
# The loopback network interface

auto lo
iface lo inet loopback

# The primary network interface (eth0)
auto eth0
iface eth0 inet dhcp

# IPv6 Address Blocks
# Add a static block for your default public IPv6 address, and include a directive for its gateway.

iface eth0 inet6 static
    address 2001:db8:a0b:12f0::1/64
    gateway fe80::1

# add an additional block for each IPv6 address you need to configure.

iface eth0 inet6 static
    address 2001:db8:2000:aff0::1/64

答案2

以下是/etc/network/interfaces我建议您使用的:

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

auto wlan0
iface wlan0 inet dhcp
wpa-ssid <your_essid>
wpa-psk <your_wpa_key>

重启。检查是否获得了 IP 地址:

ip addr show

理想情况下,它的内容如下:

3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether xx:c5:d4:0e:64:xx brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.10/24 brd 192.168.0.255 scope global wlp3s0
       valid_lft forever preferred_lft forever
    inet6 2602:306:b8c8:15f9:ece1:521:3e13:68ca/64 scope global temporary dynamic 
       valid_lft 604770sec preferred_lft 86086sec
    inet6 2602:306:b8c8:15f9:5ec5:d4ff:fe0e:64a6/64 scope global mngtmpaddr dynamic 
       valid_lft 2591970sec preferred_lft 604770sec
    inet6 fe80::5ec5:d4ff:fe0e:64a6/64 scope link 
       valid_lft forever preferred_lft forever

如您所见,路由器提供了一个 inet6 地址;在我的示例中为 2602:306:b8c8:15f9:ece1:521:3e13:68ca/64。

检查是否可以 ping 通:

ping6 -c3 www.att.com

相关内容