From 2e4f552ab7d94f194041567216533381250067c5 Mon Sep 17 00:00:00 2001 From: Keith Whyte Date: Wed, 29 Apr 2020 05:11:37 +0200 Subject: [PATCH] Script to check local MASQ This is for BTS access to d/l updates --- modules/rhizo_base/files/var/SysmoBTS/chk_masq | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 modules/rhizo_base/files/var/SysmoBTS/chk_masq diff --git a/modules/rhizo_base/files/var/SysmoBTS/chk_masq b/modules/rhizo_base/files/var/SysmoBTS/chk_masq new file mode 100644 index 0000000..303e49a --- /dev/null +++ b/modules/rhizo_base/files/var/SysmoBTS/chk_masq @@ -0,0 +1,9 @@ +#!/bin/bash + +. /home/rhizomatica/bin/vars.sh + +/sbin/iptables -t nat -vnL | egrep "MASQUERADE.*all.*$_PUBIF.*172.16.0.0/16.*0.0.0.0/0" +if [ $? != 0 ] ; then + # Add the Masquerade RULE + iptables -t nat -I POSTROUTING -s 172.16.0.0/16 -o $_PUBIF -j MASQUERADE +fi