Created
September 24, 2023 14:08
-
-
Save jgdev/60d33a968e6a2f21a5a16f21bdee8878 to your computer and use it in GitHub Desktop.
DigitalOcean - restore network on droplet resize
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 | |
DROPLET_IP= | |
DROPLET_GATEWAY= | |
ip link set eth0 up | |
ip link set eth1 up | |
ip addr flush dev eth0 | |
ip addr add $DROPLET_IP/32 dev eth0 | |
ip route add $DROPLET_GATEWAY dev eth0 | |
ip route add default via $DROPLET_GATEWAY | |
sudo apt install cloud-init cloud-guest-utils | |
reboot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment