[GLLUG] Reinstate CentOS 6 firewall on CentOS 7

M. Hamzah Khan hamzah at hamzahkhan.com
Sat Oct 24 12:38:04 UTC 2015


Just do manually what the stop script done for you, ie flush the 
iptables rules:

# Sets default policies so you don't get kicked out.
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT

for table in filter nat mangle; do
     # Flush chains (deletes all rules)
     iptables -t ${table} -F

     # Delete chains
     iptables -t ${table} -X

     # Zero counters
     iptables -t ${table} -Z
done

*M. Hamzah Khan*
Email/XMPP: hamzah at hamzahkhan.com <mailto:hamzah at hamzahkhan.com>
URL: http://www.hamzahkhan.com
Telephone: +44 (0)2071006644 <tel:+442071006644>
Mobile: +44 (0)7525663951 <tel:+447525663951>
<https://twitter.com/mhamzahkhan> <https://www.facebook.com/mhamzahkhan> 
<http://plus.google.com/+mhamzahkhan> 
<https://uk.linkedin.com/in/mhamzahkhan>

On 24/10/15 12:40, gvim wrote:
> On CentOS 6 I had a fairly complex iptables firewall script which ran 
> happily from /etc/rc3.d and which I could reboot with a small script:
>
> #!/bin/bash
>
> service iptables stop
> /root/fw
> iptables -L
>
> After upgrading to CentOS 7 I changed the first line of this to:
>
> systemctl stop iptables
>
> ... but the results are erratic. Sometimes it duplicates directives, 
> and at other times it seems to mixed up with other systemd items. Any 
> advice on how to get a custom iptables firewall working on CentOS 7 
> appreciated.
>
> gvim
>
>
> _______________________________________________
> GLLUG mailing list
> GLLUG at mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/gllug

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20151024/c7f20074/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: twitter_circle_color-20.png
Type: image/png
Size: 679 bytes
Desc: not available
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20151024/c7f20074/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: facebook_circle_color-20.png
Type: image/png
Size: 656 bytes
Desc: not available
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20151024/c7f20074/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: google_circle_color-20.png
Type: image/png
Size: 886 bytes
Desc: not available
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20151024/c7f20074/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: linkedin_circle_color-20.png
Type: image/png
Size: 630 bytes
Desc: not available
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20151024/c7f20074/attachment-0003.png>


More information about the GLLUG mailing list