mirror of https://github.com/k3s-io/k3s
Merge pull request #27102 from freehan/gciping
Automatic merge from submit-queue Accept ICMP in INPUT/FORWARD chain of filter table on GCI fixes: #27059pull/6/head
commit
64b4967774
|
@ -24,16 +24,18 @@ set -o pipefail
|
||||||
function config-ip-firewall {
|
function config-ip-firewall {
|
||||||
echo "Configuring IP firewall rules"
|
echo "Configuring IP firewall rules"
|
||||||
# The GCI image has host firewall which drop most inbound/forwarded packets.
|
# The GCI image has host firewall which drop most inbound/forwarded packets.
|
||||||
# We need to add rules to accept all TCP/UDP packets.
|
# We need to add rules to accept all TCP/UDP/ICMP packets.
|
||||||
if iptables -L INPUT | grep "Chain INPUT (policy DROP)" > /dev/null; then
|
if iptables -L INPUT | grep "Chain INPUT (policy DROP)" > /dev/null; then
|
||||||
echo "Add rules to accept all inbound TCP/UDP packets"
|
echo "Add rules to accept all inbound TCP/UDP/ICMP packets"
|
||||||
iptables -A INPUT -w -p TCP -j ACCEPT
|
iptables -A INPUT -w -p TCP -j ACCEPT
|
||||||
iptables -A INPUT -w -p UDP -j ACCEPT
|
iptables -A INPUT -w -p UDP -j ACCEPT
|
||||||
|
iptables -A INPUT -w -p ICMP -j ACCEPT
|
||||||
fi
|
fi
|
||||||
if iptables -L FORWARD | grep "Chain FORWARD (policy DROP)" > /dev/null; then
|
if iptables -L FORWARD | grep "Chain FORWARD (policy DROP)" > /dev/null; then
|
||||||
echo "Add rules to accept all forwarded TCP/UDP packets"
|
echo "Add rules to accept all forwarded TCP/UDP/ICMP packets"
|
||||||
iptables -A FORWARD -w -p TCP -j ACCEPT
|
iptables -A FORWARD -w -p TCP -j ACCEPT
|
||||||
iptables -A FORWARD -w -p UDP -j ACCEPT
|
iptables -A FORWARD -w -p UDP -j ACCEPT
|
||||||
|
iptables -A FORWARD -w -p ICMP -j ACCEPT
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue