https://github.com/git-bruh/digitalocean-net
Script for static networking setup on DigitalOcean VPSes
https://github.com/git-bruh/digitalocean-net
digitalocean jq posix-sh
Last synced: 2 months ago
JSON representation
Script for static networking setup on DigitalOcean VPSes
- Host: GitHub
- URL: https://github.com/git-bruh/digitalocean-net
- Owner: git-bruh
- License: lgpl-2.1
- Created: 2023-11-06T20:40:38.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-11-07T14:09:19.000Z (over 1 year ago)
- Last Synced: 2025-01-09T16:56:09.286Z (4 months ago)
- Topics: digitalocean, jq, posix-sh
- Language: Shell
- Homepage:
- Size: 13.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# digitalocean-net
Sets up the static network configuration based on the [DigitalOcean metadata file](https://docs.digitalocean.com/reference/api/metadata-api/#operation/getMetadata) without a `/etc/network/interfaces` file and `ifup`
# Usage
```sh
# /dev/vdb is mounted at /mnt
./donet /mnt/digitalocean_meta_data.json
``````sh
# Just print out the operations that would be performed
# Redirect stderr to hide debug logs
$ ./donet -d /mnt/digitalocean_meta_data.json 2>/dev/null
ip link set eth0 up
ip address add 139.59.2.174/20 broadcast + dev eth0
ip route add default via 139.59.0.1 dev eth0
ip link set eth1 up
ip address add 10.122.0.2/20 broadcast + dev eth1
ip route add default via 10.122.0.1 dev eth1
nameserver 67.207.67.2
nameserver 67.207.67.3
```