Skip to content

Instantly share code, notes, and snippets.

@anselmobattisti
Last active October 9, 2020 18:20
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 anselmobattisti/3fd5a18adc26ac599efb9640943aeccd to your computer and use it in GitHub Desktop.
Save anselmobattisti/3fd5a18adc26ac599efb9640943aeccd 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