1

I have following requirement;

all imap requests from 192.168.4.0/24 shoud be rejected with firewall AND all imaps request rom 192.168.4.0/24 should be allowed with firewall (along with the default rule to allow access from any host)

in order to fulfill above I added following rules;

firewall-cmd --permanent --zone=internal --add-service=imaps
firewall-cmd --permanent --zone=internal --add-source=192.168.4.0/24
firewall-cmd --reload

so my configuration becomes

[root@centos7 ~]# firewall-cmd --get-active-zones
internal
  sources: 192.168.4.0/24
public
  interfaces: ens10 eth0 eth1 eth2 eth3



[root@centos7 ~]# firewall-cmd --zone=internal --list-all
internal (active)
  target: default
  icmp-block-inversion: no
  interfaces: 
  sources: 192.168.4.0/24
  services: ssh mdns samba-client dhcpv6-client imaps
  ports: 
  protocols: 
  masquerade: no
  forward-ports: 
  source-ports: 
  icmp-blocks: 
  rich rules: 

[root@centos7 ~]# firewall-cmd --zone=public --list-all
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: ens10 eth0 eth1 eth2 eth3
  sources: 
  services: ssh dhcpv6-client http https
  ports: 161/udp 162/udp
  protocols: 
  masquerade: no
  forward-ports: 
  source-ports: 
  icmp-blocks: 
  rich rules: 

Is my configuration correct?

What I do not understand is "default" as target.

if imap request come from 192.168.4.0/24 will it be handled by "internal" zone where target is "default".

What will happen to this request?

0 Answers0