From 7ecab07fbd8126dbb525018c2bb2bb4d3b07647b Mon Sep 17 00:00:00 2001 From: jerome Date: Tue, 13 Sep 2022 01:27:25 +0200 Subject: update tag 0.2 --- network_config | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 network_config (limited to 'network_config') diff --git a/network_config b/network_config new file mode 100644 index 0000000..e1233f1 --- /dev/null +++ b/network_config @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +# à adapter à votre réseau + +sudo hostnamectl set-hostname $1 + +sudo bash -c "cat > /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg << EOF +network: {config: disabled} +EOF" + +sudo bash -c "cat > /etc/netplan/50-cloud-init.yaml << EOF +network: + ethernets: + enp0s17: + dhcp4: false + addresses: [$2/24] + gateway4: 172.19.30.254 + nameservers: + addresses: [172.19.30.128,172.19.30.254] + version: 2 +EOF" + +sudo netplan apply + +rm $0 -- cgit v1.2.3