Iptables file resolution not found under/etc/sysconfig/

Source: Internet
Author: User
Tags i18n rsyslog

Time:2014-12-19 01:17 Source:Csdn Author:Big Wisdom Report Click:5,639 plays

Would like to do some firewall policy. The firewall policy is written in the/etc/sysconfig/iptables file. But I found that I did not have this file.

Cd/etc/sysconfig/[[email protected] sysconfig]# lsatd         firstboot         irqbalance  network-scripts  Portal            sysstatauditd      Grub              kdump       ntpd             rngd           sysstat.ioconfauthconfig  Htcacheclean      Kernel      ntpdate          rsyslog        system-config-firewallcbq         httpd             keyboard    prelink          Sandbox        system-config-firewall.oldclock       i18n              modules     quota_nld        saslauthd      Udevconsole     init              netconsole  raid-check       selinuxcpuspeed    ip6tables-config  Network     readahead        smartmontoolscrond       iptables-config   networking  readonly-root    
Workaround:

1. Write a iptables command to configure a firewall rule. such as: Iptables-p OUTPUT ACCEPT.

Cd/etc/sysconfig/[[email protected] sysconfig]# iptables-p OUTPUT ACCEPT

2. The service iptables save.

 [[email protected] sysconfig]# service iptables saveiptables:saving firewall rules to/etc/sysconfig/ iptables:[OK][[email protected] sysconfig]# lsatd firstboot iptables-config Networking 
   
    readonly-root sshdauditd grub irqbalance network-scripts Portal Sysstata             Uthconfig htcacheclean kdump ntpd rngd SYSSTAT.IOCONFCBQ httpd Kernel ntpdate rsyslog system-config-firewallclock i18n keyboard Prel Ink sandbox system-config-firewall.oldconsole init modules quota_nld SASL AUTHD udevcpuspeed ip6tables-config netconsole raid-check selinuxcrond iptables networ K ReadAhead smartmontools[[email protected] sysconfig]#  
   

3. Service iptables Restart command restart:

[Email protected] sysconfig]# service iptables restartiptables:setting chains to policy Accept:filter          [  ok
   
    ]iptables:flushing firewall rules:                         [  OK  ]iptables:unloading modules:                               [  OK  ]iptables: Applying firewall rules:                         [  OK  
   

Iptables file resolution not found under/etc/sysconfig/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.