Sponsor:

Server and Web Integrator
Link:
Kloxo-MR logo
6.5.0 or 7.0.0
Click for "How to install"
Donation/Sponsorship:
Kloxo-MR is open-source.
Donate and or Sponsorship always welcome.
Click to:
Click Here
Please login or register. 2024-04-27, 19:40:12

Author Topic: Iptables error when Setting Chains to Policy ACCEPT  (Read 4611 times)

0 Members and 1 Guest are viewing this topic.

Offline prgs1971

  • Valuable Member
  • *
  • Posts: 81
  • Karma: +0/-0
    • View Profile
    • http://premium-prestashop-hosting.com
In the last Centos 6.4 64bits i am getting this error:
Code: [Select]
iptables: Setting chains to policy ACCEPT: security raw nat[FAILED]filter
when i run
Code: [Select]
service iptables restart
Did anybody experienced already this issue?
« Last Edit: 1970-01-01, 01:00:00 by Guest »

Offline prgs1971

  • Valuable Member
  • *
  • Posts: 81
  • Karma: +0/-0
    • View Profile
    • http://premium-prestashop-hosting.com
Re: Iptables error when Setting Chains to Policy ACCEPT
« Reply #1 on: 2013-08-13, 03:52:50 »
I found the fix for restart or start iptables regarding the error message in http://sysadmin.techmentor.com/2012/12/ ... -iptables/

But the patch will not work, you must fix it manually.

- to fix it you must edit the file /etc/init.d/iptables by:
           
Code: [Select]
vim /etc/init.d/iptables- around line 138 look for the following code:
                   
Code: [Select]
echo -n $"${IPTABLES}: Setting chains to policy $policy: "
                    ret=0
                    for i in $tables; do
                        echo -n "$i "
                        case "$i" in
                            raw)
                                $IPTABLES -t raw -P PREROUTING $policy
                                    && $IPTABLES -t raw -P OUTPUT $policy
                                    || let ret+=1
                                ;;
- now replace it for this one:
                   
Code: [Select]
echo -n $"${IPTABLES}: Setting chains to policy $policy: "
                    ret=0
                    for i in $tables; do
                        echo -n "$i "
                        case "$i" in
                            security)
                                $IPTABLES -t security -P INPUT $policy
                                && $IPTABLES -t security -P OUTPUT $policy
                                && $IPTABLES -t security -P FORWARD $policy
                                || let ret+=1
                                ;;
                            raw)
                                $IPTABLES -t raw -P PREROUTING $policy
                                    && $IPTABLES -t raw -P OUTPUT $policy
                                    || let ret+=1
                                ;;
* hit key "Ins" so that you go to edit mode and be able to insert text
* hit key "Esc" to leave edit mode
* hit key ":" + key "x" + key "Enter" to save and close the file

- to test if is fixed:
           
Code: [Select]
service iptables restart
- the good output will be like this:
                   
Code: [Select]
[root@server]# service iptables restart
                    iptables: Flushing firewall rules:                         [  OK  ]
                    iptables: Setting chains to policy ACCEPT: security raw nat[  OK  ]filter
                    iptables: Unloading modules:                               [  OK  ]
                    [root@server]#

- A bad output will be like this:
Code: [Select]
[code][root@server ~]# service iptables restart
            iptables: Flushing firewall rules:                         [  OK  ]
            iptables: Setting chains to policy ACCEPT: security raw nat[FAILED]filter
            iptables: Unloading modules:                           [  OK  ]  
  [/code]
« Last Edit: 1970-01-01, 01:00:00 by Guest »

 


Top 4 Global Search Engines:    Google    Bing    Baidu    Yahoo
Click Here

Page created in 0.024 seconds with 19 queries.

web stats analysis