mirror of https://gerrit.osmocom.org/osmo-dev
net/templates/run.sh: tweak masquerade
Replace the old check with an exact check for the given rule. The old check doesn't work on my system if docker is running and sets up other masquerading rules. Change -A to -I, so it is less likely to be affected by whatever other rules may already be above in the chain. Change-Id: I30c22fe4e7683611e8dada329dbf7d51f78b6016changes/75/24875/3
parent
1276bf2c1a
commit
4186b95259
|
@ -13,8 +13,9 @@ apn="${APN_DEV}"
|
|||
|
||||
sudo true || exit 1
|
||||
|
||||
if [ -z "$(sudo iptables -L -t nat | grep MASQUERADE)" ]; then
|
||||
sudo iptables -t nat -A POSTROUTING -s ${GGSN_NET} -o $dev -j MASQUERADE
|
||||
if ! sudo iptables -t nat -C POSTROUTING -s ${GGSN_NET} -o $dev -j MASQUERADE 2>/dev/null; then
|
||||
echo "Adding iptables rule for masquerade"
|
||||
sudo iptables -t nat -I POSTROUTING -s ${GGSN_NET} -o $dev -j MASQUERADE
|
||||
fi
|
||||
|
||||
if [ "$(sudo cat /proc/sys/net/ipv4/ip_forward)" = "0" ]; then
|
||||
|
|
Loading…
Reference in New Issue