Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Commit

Permalink
Configure iptables to accept all TCP/UDP/ICMP packets.
Browse files Browse the repository at this point in the history
Signed-off-by: Lantao Liu <lantaol@google.com>
  • Loading branch information
Random-Liu committed Sep 1, 2017
1 parent 9c49624 commit e6332a7
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions hack/test-e2e-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,22 @@ if [[ -z "${GOPATH}" ]]; then
exit 1
fi

ORIGINAL_RULES=`mktemp`
sudo iptables-save > ${ORIGINAL_RULES}

# Update ip firewall
# We need to add rules to accept all TCP/UDP/ICMP packets.
if sudo iptables -L INPUT | grep "Chain INPUT (policy DROP)" > /dev/null; then
sudo iptables -A INPUT -w -p TCP -j ACCEPT
sudo iptables -A INPUT -w -p UDP -j ACCEPT
sudo iptables -A INPUT -w -p ICMP -j ACCEPT
fi
if sudo iptables -L FORWARD | grep "Chain FORWARD (policy DROP)" > /dev/null; then
sudo iptables -A FORWARD -w -p TCP -j ACCEPT
sudo iptables -A FORWARD -w -p UDP -j ACCEPT
sudo iptables -A FORWARD -w -p ICMP -j ACCEPT
fi

# Get kubernetes
KUBERNETES_REPO="https://github.com/kubernetes/kubernetes"
KUBERNETES_PATH="${GOPATH}/src/k8s.io/kubernetes"
Expand All @@ -57,3 +73,6 @@ make test-e2e-node \
TEST_ARGS='--kubelet-flags=--cgroups-per-qos=true --kubelet-flags=--cgroup-root=/' # Enable the QOS tree.

kill_cri_containerd

sudo iptables-restore < ${ORIGINAL_RULES}
rm ${ORIGINAL_RULES}

0 comments on commit e6332a7

Please sign in to comment.