Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- read -p "hostanme: " new_hostname
- hostnamectl set-hostname $new_hostname
- cat /etc/hostname
- read -p "interfaz de red (ej. enp0s3): " iface
- read -p "direccion ip: " new_ip
- read -p "mascara de red (cidr ej. 24): " new_mask
- read -p "gateway: " new_gw
- echo "network:
- version: 2
- renderer: networkd
- ethernets:
- $iface:
- addresses:
- - $new_ip/$new_mask
- nameservers:
- addresses: [8.8.8.8, 8.8.4.4]
- routes:
- - to: default
- via: $new_gw" > /etc/netplan/00-installer-config.yaml
- reboot
Advertisement
Add Comment
Please, Sign In to add comment