Configure firewalld (example).
firewall-cmd --get-active-zones
firewall-cmd --set-default-zone=home
firewall-cmd --set-default-zone=home
firewall-cmd --permanent --zone=home --list-services
firewall-cmd --permanent --zone=home --remove-service=dhcpv6-client
firewall-cmd --permanent --zone=home --remove-service=ipp-client
firewall-cmd --permanent --zone=home --remove-service=mdns
firewall-cmd --permanent --zone=home --remove-service=samba-client
firewall-cmd --permanent --zone=home --add-port=5901/tcp
firewall-cmd --permanent --zone=home --list-ports
firewall-cmd --reload