summaryrefslogtreecommitdiff
path: root/network_config
diff options
context:
space:
mode:
authorjerome <jerome@xlinfo.fr>2022-09-13 01:25:49 +0200
committerjerome <jerome@xlinfo.fr>2022-09-13 01:25:49 +0200
commite48fdf8a4c5ed73f13c9a8cdef9fe4916b9afd7f (patch)
tree17602711902bb429d2ccd1706eb947f038cc7b1b /network_config
parent1b3a9f8a0518d3f895ebb63511fe1318e72f82e0 (diff)
downloadvbox-e48fdf8a4c5ed73f13c9a8cdef9fe4916b9afd7f.tar.gz
vbox-e48fdf8a4c5ed73f13c9a8cdef9fe4916b9afd7f.zip
update tag 0.2
Diffstat (limited to 'network_config')
-rw-r--r--network_config24
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