Search code examples
spring-bootwebservercentos7firewall

Cento 7 Firewalld refuses all incoming connections to my web-server


I have Centos7 VM built using vagrant with private IP address of:192.168.56.255

I am running my Spring boot application on that VM on port 8443. It supports HTTPS. My issue is that when try to send https requests to 192.168.56.255 web server via Curl command i got

curl: (7) Couldn't connect to server

I have read many tutorials that explain how to configure my Firewall in Cento7 but still got the same issue one is provided by DigitalOcean

When I type

sudo firewall-cmd --list-all-zones

I got

public
  target: default
  icmp-block-inversion: no
  interfaces:
  sources:
  services: ssh dhcpv6-client https http mysql
  ports: 8443/tcp 3306/tcp
  protocols:
  masquerade: no
  forward-ports:
  source-ports:
  icmp-blocks:
  rich rules:

As you can see I enabled everything I need and more but still. I even shut down the Firewall but still the connection is refused from my host.

When I made the changes I did reload my firewall

sudo firewall-cmd --realod

So that is not the problem


Solution

  • The problem was not with the Firewalld but with the pre-configured IP address using Vagrant.

    The IP address should not be 255 in the first byte as I did 192.168.56.255 because that indicates that this is a broadcast address. So i solved it by changing it to 192.168.56.10