Last active
February 5, 2024 17:53
-
-
Save devgianlu/9a0749ca148a67a4bc2467fe649c73aa to your computer and use it in GitHub Desktop.
VXLAN over Tailscale
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# https://vincent.bernat.ch/en/blog/2017-vxlan-linux#unicast-with-static-flooding | |
ROOT_TS_IP=100.90.17.91 | |
LEAF_TS_IP=100.120.82.82 | |
# create vxlan device | |
ip link add name vxlan100 type vxlan id 100 local $LEAF_TS_IP dev tailscale0 dstport 4789 | |
bridge fdb append 00:00:00:00:00:00 dev vxlan100 dst $ROOT_TS_IP | |
# create bridge and add vxlan to it | |
brctl addbr br-lan | |
brctl addif br-lan vxlan100 | |
# give bridge an IP | |
ip a add 192.168.1.2/24 dev br-lan | |
# bring up devices | |
ip link set br-lan up | |
ip link set vxlan100 up | |
# just to be sure... | |
sysctl -w net.ipv4.ip_forward=1 | |
# bring up external interface | |
brctl addif br-lan enxa0cec8878519 | |
ip link set enxa0cec8878519 up |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# https://vincent.bernat.ch/en/blog/2017-vxlan-linux#unicast-with-static-flooding | |
ROOT_TS_IP=100.90.17.91 | |
LEAF_TS_IP=100.120.82.82 | |
# create vxlan device | |
ip link add name vxlan100 type vxlan id 100 local $ROOT_TS_IP dev tailscale0 dstport 4789 | |
bridge fdb append 00:00:00:00:00:00 dev vxlan100 dst $LEAF_TS_IP | |
# add it to lan bridge | |
brctl addif br-lan vxlan100 | |
# bring it up | |
ip link set vxlan100 up |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment