Skip to content

Instantly share code, notes, and snippets.

@anselmobattisti
Created May 15, 2022 16:06
Show Gist options
  • Save anselmobattisti/780e99dfbd7fd40f9d95c4ec7dee548e to your computer and use it in GitHub Desktop.
Save anselmobattisti/780e99dfbd7fd40f9d95c4ec7dee548e to your computer and use it in GitHub Desktop.
#!/bin/bash
rm /etc/netplan/00-installer-config.yaml
echo "
network:
version: 2
renderer: networkd
ethernets:
enp0s3:
dhcp4: false
addresses: [192.168.0.$1/24]
gateway4: 192.168.0.1
nameservers:
addresses: [8.8.8.8]" > /etc/netplan/00-installer-config.yaml
netplan apply
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment