[CentOS] firewalld trouble opening a port

Tim Dunphy bluethundr at gmail.com
Mon May 11 14:07:11 UTC 2015


>
> Just remember that the permanent command doesn't add the rule immediately,
> so it doesn't take effect *until* you reload.
> you can also do this:
> # firewall-cmd --zone=home --add-port=8181/tcp
> # <add other stuff>
> <Test that everything works right>
> # firewall-cmd --runtime-to-permanent
> That way, if you screw something up, you can simply reload (or reboot) to
> fix it.



That's a very excellent point! I'll have to remember that. I've read a few
guides on how to use firewall-cmd on CentOS 7, but I haven't seem this tip
mentioned anywhere!

So thanks for pointing that out!

On Mon, May 11, 2015 at 9:18 AM, Bowie Bailey <Bowie_Bailey at buc.com> wrote:

> On 5/9/2015 3:24 PM, Tim Dunphy wrote:
>
>> Hi Earl,
>>
>>  The problem is you added the rule in runtime and when you reloaded it
>>> removed the rule that you added; therefore you need to use --permanent
>>> >or
>>> do not reload.
>>>
>> Thanks! That worked.
>>
>> [root at appd:~] #firewall-cmd --zone=home --list-ports
>> [root at appd:~] #firewall-cmd --zone=home --add-port=8181/tcp --permanent
>> success
>> [root at appd:~] #firewall-cmd --reload
>> success
>> [root at appd:~] #firewall-cmd --zone=home --list-ports
>> 8181/tcp
>>
>
> Just remember that the permanent command doesn't add the rule immediately,
> so it doesn't take effect *until* you reload.
>
> you can also do this:
>
> # firewall-cmd --zone=home --add-port=8181/tcp
> # <add other stuff>
> <Test that everything works right>
> # firewall-cmd --runtime-to-permanent
>
> That way, if you screw something up, you can simply reload (or reboot) to
> fix it.
>
> --
> Bowie
>
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos
>



-- 
GPG me!!

gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B



More information about the CentOS mailing list