From 90d5ed23d955b19c688268a526569b881add7e0d Mon Sep 17 00:00:00 2001 From: "svenja.michal" Date: Wed, 21 Aug 2024 09:48:43 +0200 Subject: [PATCH] Add Ubuntu 24.04 in cloud-init --- .../how-to-set-up-nat-for-cloud-networks/01.de.md | 15 +++++++-------- .../how-to-set-up-nat-for-cloud-networks/01.en.md | 15 +++++++-------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/tutorials/how-to-set-up-nat-for-cloud-networks/01.de.md b/tutorials/how-to-set-up-nat-for-cloud-networks/01.de.md index 8b9bccd8e..ff030fc34 100644 --- a/tutorials/how-to-set-up-nat-for-cloud-networks/01.de.md +++ b/tutorials/how-to-set-up-nat-for-cloud-networks/01.de.md @@ -486,25 +486,24 @@ Wenn Sie die Routen nicht manuell hinzufügen möchten, können Sie beim Erstell
-Ubuntu 22.04 +Ubuntu 22.04 / 24.04 * **NAT-Server** > Ersetzen Sie `10.0.0.0/16` falls nötig. ```bash #cloud-config - packages: - - ifupdown package_update: true package_upgrade: true runcmd: - | - cat <<'EOF' >> /etc/network/interfaces - auto eth0 - iface eth0 inet dhcp - post-up echo 1 > /proc/sys/net/ipv4/ip_forward - post-up iptables -t nat -A POSTROUTING -s '10.0.0.0/16' -o eth0 -j MASQUERADE + cat <<'EOF' >> /etc/networkd-dispatcher/routable.d/10-eth0-post-up + #!/bin/bash + + echo 1 > /proc/sys/net/ipv4/ip_forward + iptables -t nat -A POSTROUTING -s '10.0.0.0/16' -o eth0 -j MASQUERADE EOF + chmod +x /etc/networkd-dispatcher/routable.d/10-eth0-post-up - reboot ``` diff --git a/tutorials/how-to-set-up-nat-for-cloud-networks/01.en.md b/tutorials/how-to-set-up-nat-for-cloud-networks/01.en.md index 8b85a0174..45b4ff3a1 100644 --- a/tutorials/how-to-set-up-nat-for-cloud-networks/01.en.md +++ b/tutorials/how-to-set-up-nat-for-cloud-networks/01.en.md @@ -486,25 +486,24 @@ If you don't want to setup the routes manually, you can use cloud-init and add t
-Ubuntu 22.04 +Ubuntu 22.04 / 24.04 * **NAT server** > Replace `10.0.0.0/16` as needed. ```bash #cloud-config - packages: - - ifupdown package_update: true package_upgrade: true runcmd: - | - cat <<'EOF' >> /etc/network/interfaces - auto eth0 - iface eth0 inet dhcp - post-up echo 1 > /proc/sys/net/ipv4/ip_forward - post-up iptables -t nat -A POSTROUTING -s '10.0.0.0/16' -o eth0 -j MASQUERADE + cat <<'EOF' >> /etc/networkd-dispatcher/routable.d/10-eth0-post-up + #!/bin/bash + + echo 1 > /proc/sys/net/ipv4/ip_forward + iptables -t nat -A POSTROUTING -s '10.0.0.0/16' -o eth0 -j MASQUERADE EOF + chmod +x /etc/networkd-dispatcher/routable.d/10-eth0-post-up - reboot ```