用户:Clandmeter
我们首先在网络配置中添加 mGRE 隧道。结合 IPsec VPN,这允许在连接的网络之间传递路由信息。
auto gre1 iface gre1 inet static pre-up ip tunnel add $IFACE mode gre key 42 ttl 64 dev br0 || true address 192.168.148.2 netmask 255.255.255.255 post-down ip tunnel del $IFACE || true
为了加密通过此隧道的流量,我们将使用 IPsec。对于 IPsec,我们将使用具有 vici 插件的 strongswan,参见:vici 插件提供 VICI,即多功能 IKE 配置接口。顾名思义,它为外部应用程序提供了一个接口,不仅可以配置,还可以控制和监控 IKE 守护进程 charon。为此,我们还需要 fabled 提供的 strongswan 修改版本。
thisshouldbetheipsecconfig
为了与 vici 接口通信,我们使用 Timo Terras (fabled) 开发的 Quagga 新的 NHRP 插件。我们必须使用他的修改版本,因为这些更改尚未向上游推送。
NHRP 将自动在 IPsec 上创建 GRE 隧道,我们将使用 BGP 在其上路由流量。
关于 DMVPN 的笔记
ip tunnel add gre1 mode gre remote 172.16.4.1 local 172.16.3.1 ttl 255 ip link set gre1 up ip addr add 192.168.148.1/24 dev gre1
ip tunnel add gre1 mode gre remote 172.16.3.1 local 172.16.4.1 ttl 255 ip link set gre1 up ip addr add 192.168.148.2/24 dev gre1