Ubuntu 17.10 中的 ipv6 隧道?

Tek*_*Tek 10 server ipv6 tunnel netplan

我曾经能够在没有问题的情况下进行下面的配置,/etc/network/interfaces但现在不再使用了。我现在如何配置 ipv6 隧道?我看到了用于配置接口的新 netplan 软件,但似乎找不到与以下命令等效的命令

auto he-ipv6
iface he-ipv6 inet6 v4tunnel
        address 2001:550:120e:6b7::2
        netmask 64
        endpoint 184.105.253.10
        local my.public.ip.addr
        ttl 255
        gateway 2001:550:120e:6b7::1
Run Code Online (Sandbox Code Playgroud)

如何配置 Ubuntu 以在下次重新启动时永久保留此配置?

Tek*_*Tek 9

我想到了。

我创建了以下文件:

/etc/systemd/network/he-ipv6.network

[Match]

[Network]
Tunnel=he-ipv6
Run Code Online (Sandbox Code Playgroud)

/etc/systemd/network/he-ipv6-tunnel.netdev

[Match]                                                                                                                                                                                                            

[NetDev]                                                                                                                                                                                                           
Name=he-ipv6                                        
Kind=sit                                            

[Tunnel]
Independent=true                                            
Local=192.168.0.x #Private IP if behind NAT or Public IP without NAT                                   
Remote=184.105.250.46 #Tunnel broker's IPv4 address                         
TTL=255
Run Code Online (Sandbox Code Playgroud)

/etc/netplan/01-netcfg.yaml

# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
  version: 2
  renderer: networkd
  ethernets:
      he-ipv6:
          dhcp4: no
          dhcp6: no
          addresses: ['2001:470:xxx:xxx::2/64']
          gateway6: 2001:470:xxx:xxx::1
      enp0s3:
      ...
Run Code Online (Sandbox Code Playgroud)

哪里2001:470:xxx:xxx::2/64是你的客户端IP地址从tunnelbroker.net

然后重新启动或重新启动您的网络 systemctl restart systemd-networkd && netplan apply

更新/警告除非您已经在使用 Ubuntu Bionic Beaver 或专门说 Systemd Version 235,否则这将不起作用。需要Independent[Tunnel] 下的标志,以便此配置在每次重新启动时与 systemd 版本 235 一起工作

Independent标志在 systemd 234 及以下版本中不起作用。您可以使用以下命令检查您的 systemd 版本systemd --version