diff options
| author | jerome <jerome@xlinfo.fr> | 2022-09-13 01:27:25 +0200 |
|---|---|---|
| committer | jerome <jerome@xlinfo.fr> | 2022-09-13 01:27:25 +0200 |
| commit | 7ecab07fbd8126dbb525018c2bb2bb4d3b07647b (patch) | |
| tree | 5aa80fd15aef832730cae628583db814e7ce83f8 /network_config | |
| parent | 6556b78865d1e73279d5a2091470c3b0180aad0e (diff) | |
| download | vbox-7ecab07fbd8126dbb525018c2bb2bb4d3b07647b.tar.gz vbox-7ecab07fbd8126dbb525018c2bb2bb4d3b07647b.zip | |
update tag 0.2
Diffstat (limited to 'network_config')
| -rw-r--r-- | network_config | 24 |
1 files changed, 24 insertions, 0 deletions
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 |
