2020-12-01 05:52:39 -08:00
|
|
|
#!/bin/bash
|
2017-12-19 04:57:31 -08:00
|
|
|
|
|
|
|
#
|
2020-12-01 05:54:40 -08:00
|
|
|
# Copyright 2013-2020 Software Radio Systems Limited
|
2017-12-19 04:57:31 -08:00
|
|
|
#
|
2020-12-01 05:54:40 -08:00
|
|
|
# By using this file, you agree to the terms and conditions set
|
|
|
|
# forth in the LICENSE file which can be found at the top level of
|
|
|
|
# the distribution.
|
2017-12-19 04:57:31 -08:00
|
|
|
#
|
|
|
|
|
|
|
|
#Check for sudo rights
|
|
|
|
sudo -v || exit
|
|
|
|
|
2018-01-18 06:10:15 -08:00
|
|
|
#Check if outbound interface was specified
|
|
|
|
if [ ! $# -eq 1 ]
|
|
|
|
then
|
|
|
|
echo "Usage :'sudo ./if_masq.sh <Interface Name>' "
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Masquerading Interface "$1
|
2017-12-19 04:57:31 -08:00
|
|
|
|
|
|
|
echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward 1>/dev/null
|
2018-01-18 06:10:15 -08:00
|
|
|
sudo iptables -t nat -A POSTROUTING -o $1 -j MASQUERADE
|