Update unraid-config.sh
This commit is contained in:
parent
2296121044
commit
b84fcb015e
1 changed files with 18 additions and 0 deletions
|
@ -22,6 +22,24 @@ check_root() {
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
# Function to fix routing
|
||||||
|
fix_routing() {
|
||||||
|
echo -e "${YELLOW}Fixing routing table...${NC}"
|
||||||
|
|
||||||
|
# Delete Tailscale's default route if it exists
|
||||||
|
ip route del 0.0.0.0/0 dev tailscale0 2>/dev/null
|
||||||
|
|
||||||
|
# Ensure br0 is the default route
|
||||||
|
ip route add default via $(ip route | grep br0 | grep default | awk '{print $3}') dev br0
|
||||||
|
|
||||||
|
# Add specific route for VPS through Tailscale
|
||||||
|
ip route add $VPS_IP via $(ip route | grep tailscale0 | awk '{print $1}') dev tailscale0
|
||||||
|
|
||||||
|
# Save current routing config
|
||||||
|
echo "ip route del 0.0.0.0/0 dev tailscale0 2>/dev/null" > /boot/config/routing.sh
|
||||||
|
echo "ip route add default via $(ip route | grep br0 | grep default | awk '{print $3}') dev br0" >> /boot/config/routing.sh
|
||||||
|
chmod +x /boot/config/routing.sh
|
||||||
|
}
|
||||||
|
|
||||||
# Function to check if Tailscale is installed
|
# Function to check if Tailscale is installed
|
||||||
check_tailscale() {
|
check_tailscale() {
|
||||||
|
|
Loading…
Reference in a new issue