From 6945ac697c0bc9bc1cf9f008996d5b3e457e24a2 Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Thu, 18 Jan 2018 14:10:15 +0000 Subject: [PATCH] Added command commandline argument to the interface masquerading script --- srsepc/if_masq.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/srsepc/if_masq.sh b/srsepc/if_masq.sh index ee6c41392..88d7f370a 100755 --- a/srsepc/if_masq.sh +++ b/srsepc/if_masq.sh @@ -23,8 +23,15 @@ #Check for sudo rights sudo -v || exit -echo "Masquerading Interface" +#Check if outbound interface was specified +if [ ! $# -eq 1 ] + then + echo "Usage :'sudo ./if_masq.sh ' " + exit +fi + +echo "Masquerading Interface "$1 echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward 1>/dev/null -sudo iptables -t nat -A POSTROUTING -o wlp58s0 -j MASQUERADE +sudo iptables -t nat -A POSTROUTING -o $1 -j MASQUERADE