On Jun 30, 2014 6:51 PM, "JD" <jd1008(a)gmail.com> wrote:
On Mon, Jun 30, 2014 at 6:28 PM, Ed Greshko <ed.greshko(a)greshko.com>
wrote:
>
> On 07/01/14 08:11, JD wrote:
>
> Hi all,
> When I run /sbin/system-config-services
> I see that iptables is enabled, and that
> /etc/sysconfig/iptables contains the rules
> I want.
>
> However, after bootup, I open a terminal and
> run iptables -L -n
> and do not see those rules at all, and all
> the rules are in "ACCEPT" state.
>
> I have to resort to start iptables manually
> in order to install the rules I have in
> /etc/sysconfig/iptables.
>
> So, what needs to be done to force iptables to run
> and to use the rules I have in the iptables file?
>
>
>
>
>
> Directly after a reboot I would run....
>
> systemctl status iptables.service
>
> And, yeah, your emails are a bit hard to read.
>
# systemctl status iptables.service
iptables.service - IPv4 firewall with iptables
Loaded: loaded (/usr/lib/systemd/system/iptables.service; enabled)
Active: inactive (dead)
# iptables -L -n ....
--------------------------
What I have in /etc/sysconfig/iptables:
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT
ACCEPT[0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -m state --state NEW -j DROP
COMMIT
--
Congrats, you've created a firewall ruleset just like the default, but
without ssh. You could have:
`firewall-cmd --remove-service ssh --permanent `
You can read about firewalld at
https://fedoraproject.org/wiki/FirewallD .
If you prefer to disable firewalld and use iptables, there are instructions
on the same page.
--Pete