Skip to content

Instantly share code, notes, and snippets.

View Sugavanas's full-sized avatar

Sugavanas Sugavanas

View GitHub Profile
@Sugavanas
Sugavanas / revert-floating-ip-gateway.sh
Last active February 10, 2022 09:09 — forked from sparkcodeuk/floating-ip-gateway.sh
Digital Ocean floating IP gateway script (force droplet to use the assigned floating IP for outbound traffic as well as inbound traffic). This forked script will revert back to original settings. Pass the original IP address of the droplet as the first parameter.
#!/bin/bash
# Revert outbound traffic back to original ip. Call script with the original ip address of droplet
NET_INT="eth0"
CURL_TIMEOUT=3
if [ "$1" == "" ]; then
echo "Original IP of droplet not given."
exit 1
fi