Ensure static uplink can work in RHEL and iptables
Change-Id: I84210531ef4d7282dd21e69b80a1fef3010d9095
This commit is contained in:
parent
014f85f991
commit
22601bd38b
@ -90,3 +90,13 @@ if [ "${MASQUERADE_ON}" == 'on' ] && [ -z "$(iptables -v -n -L -t nat | grep "MA
|
||||
iptables -I FORWARD -s ${FIP} -j ACCEPT
|
||||
echo "Succesfully enabled masquerading"
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user