From: David Garcia Date: Tue, 26 May 2020 17:27:03 +0000 (+0200) Subject: Install iptables-persistent if it doesn't exist X-Git-Tag: v7.1.0rc4 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=2092ddfde3ba26c8dbcc71ccc44963bfd9115c3f;p=osm%2FN2VC.git Install iptables-persistent if it doesn't exist Change-Id: I7535e7ff3b74236cd3c7e752244252481582d557 Signed-off-by: David Garcia --- diff --git a/n2vc/provisioner.py b/n2vc/provisioner.py index b170b2e..fbb16ca 100644 --- a/n2vc/provisioner.py +++ b/n2vc/provisioner.py @@ -72,8 +72,8 @@ fi IPTABLES_SCRIPT = """#!/bin/bash set -e -apt-get update -DEBIAN_FRONTEND=noninteractive apt-get install -yqq iptables-persistent +[ -v `which netfilter-persistent` ] && apt update \ + && DEBIAN_FRONTEND=noninteractive apt-get install -yqq iptables-persistent iptables -t nat -A OUTPUT -p tcp -d {} -j DNAT --to-destination {} netfilter-persistent save """