I use the services of a Scaleway provider. I have a public instance and a few private ones. The problem is that private interfaces do not have access to the Internet.
There is an idea to organize NAT through a public instance - https://community.online.net/t/yet-another-tutorial-to-create-a-private-network/5090 This article describes how to raise GRE tunnels. But everything is tied to the use of bash skyrtta and utilities ip.
#!/bin/bash
REMOTE_ADDR="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX92.priv.cloud.scaleway.com
XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX93.priv.cloud.scaleway.com"
ip link add name br0 type bridge
ip addr add 172.16.42.254/24 dev br0
ip link set br0 up
for ADDR in $REMOTE_ADDR; do
IP=$(getent hosts $ADDR | awk '{ print $1 }')
IP_SANITIZED=$(echo $IP | sed 's/\./-/g')
TUN_DEV="tun-"$IP_SANITIZED
ip link add $TUN_DEV type gretap remote $IP ttl 64
ip link set dev $TUN_DEV up
ip link set dev $TUN_DEV master br0
done
Now I'm trying to convert this to the format of the /etc/network/interfaces file. But its not working for me.
My experiment:
iface br0 inet static
description create bridge interface
address 172.16.42.254
netmask 24
# hook scripts
pre-up ip link add name br0 type bridge
post-up ip link add tun-1 type gretap remote 10.16.167.11 ttl 64
post-up ip link set dev tun-1 up
post-up ip link set dev tun-1 master br0
post-up ip link add tun-2 type gretap remote 10.16.157.141 ttl 64
post-up ip link set dev tun-2 up
post-up ip link set dev tun-2 master br0
post-up ip link add tun-3 type gretap remote 10.16.119.13 ttl 64
post-up ip link set dev tun-3 up
post-up ip link set dev tun-3 master br0