How to open port with wildcard?

1/31/2020

I am going to install kubernetes on my VPS servers. The VPS servers based on Ubuntu 18.04 server and I am using the https://en.wikipedia.org/wiki/Uncomplicated_Firewall.

I have to open several ports on Ubuntu server but one of them is marked with wildcard:

TCP Inbound 6443*   Kubernetes API server   All

How to open a port with wildcard? Would this be correct:

sudo ufw allow 6443*
-- zero_coding
kubernetes
ubuntu

1 Answer

2/7/2020

The wildcard * in this case means that it can it could be any port that fit your needs (except, of course, ports already in use or reserved).

In Documentation:

Any port numbers marked with * are overridable, so you will need to ensure any custom ports you provide are also open.

Open the port with: sudo ufw allow 6443 and you are good to go.


Also related to this question, UWF does not accepts the * wildcard for rules.

  • You can specify one port: ufw allow 6443
  • You can specify the service: uwf allow ftp
  • You can specify a range: ufw allow 1234:5678/tcp
-- willrof
Source: StackOverflow