LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 02-28-2019, 05:39 PM   #1
tech0925
Member
 
Registered: Aug 2018
Posts: 39

Rep: Reputation: Disabled
Centos 7 firewalld Zone Issue


I have been trying to figure out how to fix the issue I am having. I have two zones, public (default) and internal. Here is what that looks like.

public (active)
target: default
icmp-block-inversion: no
interfaces: enp7s0
sources:
services: https http
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:

internal (active)
target: default
icmp-block-inversion: no
interfaces: enp10s0
sources: xx.xx.xx.xx/32 xx.xx.xxx.xxx/32
services: mdns samba-client dhcpv6-client ssh
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:

My problem is that I can view my site when I'm not connected to the same network that the server is on. However, when connected to the same network then the site is not accessible. What am I doing wrong? Also, is the services that I have open in public good enough for web related websites or are there others you would recommend opening? I am running a PHP web server.

Thanks!
 
Old 02-28-2019, 09:20 PM   #2
mralk3
Slackware Contributor
 
Registered: May 2015
Distribution: Slackware
Posts: 1,900

Rep: Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050
Centos 7 firewalld Zone Issue

You need to also open the ports for http and https internally.

Code:
firewall-cmd --permanent --zone internal --add-service=http

firewall-cmd --permanent --zone internal --add-service=https

firewall-cmd --reload
run as root or with sudo privileges.

Edit:. I'm sure there is also a way to forward http(s) traffic to your internal network to public interface using rich rules, but the above is much less complicated.

You can also enable masquerading but that is dependent on what kind of device/firewall/security you wish to implement.

Last edited by mralk3; 02-28-2019 at 09:25 PM.
 
Old 03-01-2019, 05:55 PM   #3
tech0925
Member
 
Registered: Aug 2018
Posts: 39

Original Poster
Rep: Reputation: Disabled
Thank you! I did this before but it didn't work but now it is. Weird. Thanks again!
 
Old 03-01-2019, 11:23 PM   #4
mralk3
Slackware Contributor
 
Registered: May 2015
Distribution: Slackware
Posts: 1,900

Rep: Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050
Centos 7 firewalld Zone Issue

glad to help!
 
  


Reply



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
I find file zone in the slave zone to the do a transfer of zone from Windows Server 2012 as master dns and CentOS as slave DNS. To learn Linux - Newbie 1 09-02-2016 09:36 AM
Which zone bind dns work either in forward zone are reverse zone sanjay87 Linux - Server 2 06-05-2012 04:21 AM
DNS Master Zone Vs. DNS Slave Zone ALInux Linux - Networking 3 08-29-2007 09:28 AM
DNS Zone x-fer - From one zone to another / Debian 3.1 + BIND9 kenwoodgt Linux - Software 0 11-01-2006 10:28 AM
linux firewall with internet zone, dmz and trusted zone ikhwan98 Linux - Security 1 11-27-2001 04:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 05:36 AM.

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