Ensure static uplink can work in RHEL and iptables
Change-Id: I84210531ef4d7282dd21e69b80a1fef3010d9095
This commit is contained in:
@@ -90,3 +90,13 @@ if [ "${MASQUERADE_ON}" == 'on' ] && [ -z "$(iptables -v -n -L -t nat | grep "MA
|
|||||||
iptables -I FORWARD -s ${FIP} -j ACCEPT
|
iptables -I FORWARD -s ${FIP} -j ACCEPT
|
||||||
echo "Succesfully enabled masquerading"
|
echo "Succesfully enabled masquerading"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Ensure there are no malicious iptables rules
|
||||||
|
if [ -f /etc/redhat-release ];
|
||||||
|
then
|
||||||
|
iptables -D FORWARD -j REJECT --reject-with icmp-host-prohibited || true
|
||||||
|
if [[ $(cat /etc/sysconfig/iptables | grep -v -- '-A FORWARD -j REJECT --reject-with icmp-host-prohibited') ]];
|
||||||
|
then
|
||||||
|
cat /etc/sysconfig/iptables | grep -v -- '-A FORWARD -j REJECT --reject-with icmp-host-prohibited' > /etc/sysconfig/iptables
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user