<p>I am reading the documentation for using kubeadm to set up a Kubernetes cluster. I am running Ubuntu Server 20.04 on three VMs but am currently only working with one of them before doing the configuration on the other two. I have prepared containerd and disabled swap, but am getting stuck with enabling the required ports. I first configured ufw to only allow incoming traffic from port 22 using the OpenSSH application profile. After reading up on enabling required ports, I have run the commands:</p>
<p><code>sudo ufw allow 6443</code>,
<code>sudo ufw allow 6443/tcp</code>, and
<code>sudo ufw allow 6443/udp</code>.</p>
<p>When I try using telnet to connect, it fails:</p>
<pre><code>telnet 127.0.0.1 6443
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
</code></pre>
<p>...and when using the private IP other computers connect to it with:</p>
<pre><code>telnet 192.168.50.55 6443
Trying 192.168.50.55...
telnet: Unable to connect to remote host: Connection refused
</code></pre>
<p>If I tell telnet to use port 22, it works just fine:</p>
<pre><code>telnet 127.0.0.1 22
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.3
^]
telnet&gt; close
Connection closed.
</code></pre>
<p>Is there something I am doing wrong with the firewall configuration? Or is it another thing?</p>
<p>Thank you for the help,</p>
<p>foxler2010</p>

Foxler2010
<ul>
<li><p>Thats because there is no process listening on 6443.you can verify it using <code>ss -nltp | grep 6443 </code></p>
</li>
<li><p>6443 will be listened by &quot;kube-apiserver&quot; which gets created after you initialize the cluster using <code> kubeadm init --apiserver-advertise-address=192.168.50.55 --pod-network-cidr=&lt;pod cidr&gt;</code></p>
</li>
<li><p>since you have not initialized cluster yet , kube-apiserver wont be running hence the error &quot;connection refused&quot;.</p>
</li>
<li><p>In case if you want to verify that you firewall/ufw settings are done properly in order to accept traffic on port 6443(without installating kubernetes cluster)  then you can try following :</p>
</li>
</ul>
<pre><code>1. Install nmap &quot; sudo apt-get install nmap &quot;

2. listen to port 6443 &quot;nc -l 6443&quot;

3. open a another terminal/window and connect to 6443 port &quot;nc -zv 192.168.50.55 6443&quot; . It should say connected.
</code></pre>
