I am having issues with relevant Wormhole traffic being blocked by the OS firewall. In my case I am using:
- CentOS 7.7.1908
- firewalld 0.6.3-2
- wireguard-dkms 1:0.0.20200128-1
- wireguard-tools 1:1.0.20191226-1
- one “real” network interface managed by the OS
- that interface is in the firewalld zone called “internal”
** the “internal” zone has a default rule/target that “rejects” packets without a defined rule allowing it - i have defined the following rules on the master node:
** allow ssh
** allow 6443, 2379, 2380, 10250, 10251, 10252 TCP for Kubernetes traffic
** allow 9806 for Wireguard - i have defined the following rules on the worker nodes:
** allow ssh
** allow 10250 and 30000-32767 TCP for Kubernetes traffic
** allow 9806 for Wireguard
NOTE: Sorry for the non-linked URLs below. Apparently as a new user to this forum I can only include 2 real links.
I installed one master and two (2) workers using Kubernetes 1.17 based on the Kubernetes ‘Installing kubeadm’ page. Next up, I installed Wireguard according to their ‘Installation - Wireguard’ page. Followed by the Wormhole instructions on the Github page. I did have to modify the instructions a bit due to the now deprecated PodSecurity API location. You can see my Github issue #17 with the Wormhole project for details on that.
This leaves me with a mostly working cluster. However when I look closely to kubectl get pods --all-namespaces
output I see that my two (2) coredns pods are NOT ready.
root@kube-master00:~$ kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system coredns-6955765f44-dx2h4 0/1 Running 4 20d
kube-system coredns-6955765f44-jpgjz 0/1 Running 4 20d
If I stop the ‘firewalld’ service. Within a minute the two (2) coredns pods spin up and everything works as expected.
root@kube-master00:~$ kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system coredns-6955765f44-dx2h4 1/1 Running 4 20d
kube-system coredns-6955765f44-jpgjz 1/1 Running 4 20d
When I have ‘firewalld’ running and I am logging denied packets. I see a lot of this:
root@kube-master00:~$ tail -f /var/log/messages
Feb 3 14:23:24 kube-master00 kernel: FINAL_REJECT: IN=wormhole-br0 OUT=ens33
PHYSIN=vethb8345c2f MAC=b6:47:98:45:58:84:72:70:f9:6a:f5:16:08:00 SRC=10.244.0.19
DST=172.16.222.2 LEN=45 TOS=0x00 PREC=0x00 TTL=63 ID=32767 DF PROTO=UDP
SPT=38741 DPT=53 LEN=25
Feb 3 14:23:24 kube-master00 kernel: FINAL_REJECT: IN=wormhole-br0 OUT=
PHYSIN=vethb8345c2f MAC=b6:47:98:45:58:84:72:70:f9:6a:f5:16:08:00 SRC=10.244.0.19
DST=172.16.222.129 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=64816 DF PROTO=TCP
SPT=33154 DPT=6443 WINDOW=43690 RES=0x00 SYN URGP=0
I have tried permitting specific traffic that I see being blocked. Every time I open one up, another seems to now be blocked. I was hoping someone out here or someone from Gravitational could give me a list of the required iptables rules. The only documentation I see on this forum, or the Github page, mention allowing port 9806 for Wireguard. Which I have open already.
Oh, and I have tested this on multiple hosting platforms. GCP, VMware Fusion, and bare metal. They all result in the same outcome. The GCP through me for a bit of a loop cause they put their interfaces in the “trusted” zone. This zones uses a default target of “ACCEPT” which basically allows all traffic. Per specific rules on my network I can’t do that or leave the firewall off.