Creating a cluster using on tun0 devices

xmichael99

New Member
Feb 10, 2023
3
0
1
Hello all,

I've been experimenting with creating a remote cluster using tinc and openvpn, both solutions seem overly complicated.

Why not this;

device 1 (IP: 10.10.10.10)
sudo modprobe tun
sudo ip tuntap add dev tun0 mode tun
sudo ip link set dev tun0 up
sudo ip addr add 192.168.69.1/24 dev tun0
sudo ip route add 192.168.69.0/24 dev tun0
sudo ip neigh add 10.20.20.20 lladdr 00:00:00:00:00:01 dev tun0

device 2 (IP: 10.20.20.20)
sudo modprobe tun
sudo ip tuntap add dev tun0 mode tun
sudo ip link set dev tun0 up
sudo ip addr add 192.168.69.2/24 dev tun0
sudo ip route add 192.168.69.0/24 dev tun0
sudo ip neigh add 10.10.10.10 lladdr 00:00:00:00:00:01 dev tun0

Thoughts?
 
Wrapping in UDP port 12345, instead of using raw IP;

sudo modprobe tun
sudo ip tuntap add dev tun0 mode tun
sudo ip link set dev tun0 up
sudo ip addr add 192.168.69.1/24 dev tun0
sudo ip route add 192.168.69.0/24 dev tun0
sudo iptables -A INPUT -p udp --dport 12345 -j ACCEPT
sudo iptables -A FORWARD -i tun0 -j ACCEPT


sudo modprobe tun
sudo ip tuntap add dev tun0 mode tun
sudo ip link set dev tun0 up
sudo ip addr add 192.168.69.2/24 dev tun0
sudo ip route add 192.168.69.0/24 dev tun0
sudo iptables -A INPUT -p udp --dport 12345 -j ACCEPT
sudo iptables -A FORWARD -i tun0 -j ACCEPT
 
Or even this

iptunnel add gre1 mode gre local 10.10.10.10 remote 10.20.20.20 ttl 255
ip addr add 192.168.69.1/24 dev gre1
ip link set gre1 up
route add 192.168.69.0/24 gw 192.168.69.2 dev gre1

iptunnel add gre1 mode gre local 10.20.20.20 remote 10.10.10.10 ttl 255
ip addr add 192.168.69.2/24 dev gre1
ip link set gre1 up
route add 192.168.69.0/24 gw 192.168.69.1 dev gre1
 
Hi,
I use Tailsacale and work pretty well.

On both machine

Bash:
curl -fsSL https://pkgs.tailscale.com/stable/debian/bullseye.noarmor.gpg | tee /usr/share/keyrings/tailscale-archive-keyring.gpg >/dev/null
curl -fsSL https://pkgs.tailscale.com/stable/debian/bullseye.tailscale-keyring.list | tee /etc/apt/sources.list.d/tailscale.list
apt-get update
apt-get install tailscale
tailscale up


Connect and authorize on tailscale

Create Network on proxmox:
Linux VLAN (tailsacale IP/24) with Vlan raw device = your Network Device : Vlantag of your choice.

Last thing on Hosts :
Add : "tailscaleIP pveX.lan pveX"on top of your host file, if not proxmox cluster would use your local ip instead...

Your good to create your cluster as usual!
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!