Skip to content

Instantly share code, notes, and snippets.

@jgdev
Created September 24, 2023 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jgdev/60d33a968e6a2f21a5a16f21bdee8878 to your computer and use it in GitHub Desktop.
Save jgdev/60d33a968e6a2f21a5a16f21bdee8878 to your computer and use it in GitHub Desktop.
DigitalOcean - restore network on droplet resize
#!/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