From 3d3a76780c013a747d4aad5a11fe05d1e5acf89d Mon Sep 17 00:00:00 2001 From: Gulsum Atici Date: Wed, 1 Feb 2023 11:15:52 +0300 Subject: [PATCH] Make iptables persistent after reboot Change-Id: Ief0342cf23406622458c28cf2c65a6e6069262fc Signed-off-by: Gulsum Atici --- installers/full_install_osm.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/installers/full_install_osm.sh b/installers/full_install_osm.sh index 3160eb4a..8c651e2e 100755 --- a/installers/full_install_osm.sh +++ b/installers/full_install_osm.sh @@ -823,8 +823,7 @@ function install_osm() { add_local_k8scluster track final_ops add_local_k8scluster_ok - echo -e "Fixup firewall so docker and LXD can share the host." - sudo iptables -I DOCKER-USER -j ACCEPT + arrange_docker_default_network_policy wget -q -O- https://osm-download.etsi.org/ftp/osm-13.0-thirteen/README2.txt &> /dev/null track end @@ -887,6 +886,13 @@ function install_to_openstack() { return 0 } +function arrange_docker_default_network_policy() { + echo -e "Fixing firewall so docker and LXD can share the same host without affecting each other." + sudo iptables -I DOCKER-USER -j ACCEPT + sudo iptables-save | sudo tee /etc/iptables/rules.v4 + sudo ip6tables-save | sudo tee /etc/iptables/rules.v6 +} + function install_k8s_monitoring() { [ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function # install OSM monitoring -- 2.25.1