GRE tunnel between two LXD hosts

From lxadm | Linux administration tips, tutorials, HOWTOs and articles
Jump to: navigation, search

You will need LXD > 2.3:

On server1, with IP 1.2.3.4:

lxc network create gretunnel tunnel.lan.protocol=gre
# GRE tunnel will be attached to eth1 in the container
lxc network attach-profile gretunnel default eth1
lxc network set gretunnel tunnel.server2.local 1.2.3.4
lxc network set gretunnel tunnel.server2.remote 5.6.7.8


On server2, with IP 5.6.7.8 on vmbr0:

lxc network create gretunnel ipv4.address=none ipv6.address=none tunnel.server1.protocol=gre tunnel.server1.local=5.6.7.8 tunnel.server1.remote=1.2.3.4
# GRE tunnel will be attached to eth1 in the container
lxc network attach-profile gretunnel default eth1