LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 04-10-2016, 04:56 PM   #1
gctaylor1
Member
 
Registered: Dec 2006
Distribution: Red Hat
Posts: 45

Rep: Reputation: 0
Firewalld zone allows source address access.


With firewalld in RHEL/CentOS 7, when I add a source address to a zone and the
service(http) is not defined in that zone, I expect connection attempts from the source address for that service to be denied. Instead I'm finding that it is allowed.

Client machine:
Code:
[root@outsider2 ~]# ip a | grep eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    inet 192.168.100.200/24 brd 192.168.100.255 scope global eth0

[root@outsider2 ~]# curl http://server1
server1 web server
Server1 running firewalld
Code:
[root@server1 ~]# firewall-cmd --permanent --zone=work --list-all
work
  interfaces: 
  sources: 192.168.100.200/24
  services: dhcpv6-client ipp-client ssh
  ports: 
  masquerade: no
  forward-ports: 
  icmp-blocks: 
  rich rules: 

[root@server1 ~]# firewall-cmd --permanent --list-all-zones | grep -B 2 '192.168.100.200/24'
work
  interfaces: 
  sources: 192.168.100.200/24


[root@server1 ~]# tail -n1 /var/log/httpd/access_log 
192.168.100.200 - - [10/Apr/2016:11:04:53 -0700] "GET / HTTP/1.1" 200 13 "-" "curl/7.29.0"
I thought that firewalld separated all incoming traffic into zones with each
zone having it's own set of rules. Then it followed this logic where the first
rule that matches wins:

1. If the source address of an incoming packet matches a source rule setup for a zone, that
packet will be routed though that zone.

2. If the incoming interface for a packet matches a filter setup for a zone, that zone. will be used.

3. Otherwise, the default zone is used. The default zone is not a separate zone; instead, it
points to one of the other zones defined on the system.


These are virtual machines but as far as I can tell this should not be a factor. (?)


FYI - the drop zone denies correctly. A rich rule denies correctly.

firewalld-0.3.9-7.el7.noarch
Red Hat Enterprise Linux Server release 7.0 (Maipo)

My searching has not enlightened me. Am I missing something?

Thanks for your time.
Gary
 
Old 04-11-2016, 11:58 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Have a look at this blog post I made some time ago when I had similar issues:
http://www.linuxquestions.org/questi...-solved-36590/

Quote:
Upshot is that if one does NOT specify the zone in the ifcfg-<interface> file in /etc/sysconfig/network-scripts it will automatically go to whichever zone has been defined as "default". (As noted we had changed internal zone to default - on most systems it would be public zone.)
You can set "work" as your default zone or you can do the update for specific interface.
 
Old 04-13-2016, 09:44 AM   #3
gctaylor1
Member
 
Registered: Dec 2006
Distribution: Red Hat
Posts: 45

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by MensaWater View Post
Have a look at this blog post I made some time ago when I had similar issues:
http://www.linuxquestions.org/questi...-solved-36590/
Thanks MensaWater. Very helpful.
 
  


Reply

Tags
firewalld



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Selecting the correct firewalld zone borgy95 Linux - Networking 1 06-25-2015 05:03 AM
Block incoming IPv6 access to LAN clients with firewalld? n0xlf Linux - Networking 2 09-12-2014 08:23 PM
Fedora 18 firewalld specify source ip vonedaddy Fedora 2 06-18-2013 12:49 AM
Which zone bind dns work either in forward zone are reverse zone sanjay87 Linux - Server 2 06-05-2012 04:21 AM
Bind IP address with MAC address in squid 3 ( Source baced) gulnawaz Linux - Server 3 01-14-2010 01:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 07:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration