Iptables - (view-edit)

Discussion in 'Site & Server Administration' started by ASTRAPI, Mar 10, 2011.

  1. #1
    Hello

    Where is the file that keep the info for iptables so i can view what ip's are blocked so i can edit it and unban some of them that i want?

    My server is using cpanel and latest Centos x64.

    Thank you
     
    ASTRAPI, Mar 10, 2011 IP
  2. dynashox

    dynashox Premium Member Staff

    Messages:
    8,662
    Likes Received:
    563
    Best Answers:
    3
    Trophy Points:
    335
    #2
    You can view your current iptables rules by using this command :

    /sbin/iptables -L
    Code (markup):
    - Dynashox -
     
    dynashox, Mar 10, 2011 IP
  3. ASTRAPI

    ASTRAPI Guest

    Messages:
    500
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks :)

    I am a total noob and i am using wincsp to view and edit files :)

    So i must look on /sbin/iptables file and edit it by removing the line that keeps the ip info that i want to unban?

    Do i have to run any command after that to restart it or something when i unban the ip's that i want?

    I know it is not the best way to do it but it is more easy for me than the console solution.
     
    ASTRAPI, Mar 10, 2011 IP
  4. dynashox

    dynashox Premium Member Staff

    Messages:
    8,662
    Likes Received:
    563
    Best Answers:
    3
    Trophy Points:
    335
    #4
    There is a command line that you must run to allow or deny an IP address.

    You should restart the iptables service if you make any change to it.

    - Dynashox -
     
    dynashox, Mar 11, 2011 IP
  5. hostparlor

    hostparlor Peon

    Messages:
    521
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #5
    If you are running csf you can view them right from the csf interface.
     
    hostparlor, Mar 11, 2011 IP
  6. ASTRAPI

    ASTRAPI Guest

    Messages:
    500
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I want to remove the csf as it is resource eater ...

    Yes and the command add a line on the /sbin/iptables a line like: drp this ip bla bla 123.xxx.xxx.xxx

    So i can delete this line and the ban is gone and if i want to add a new one i can use the same line on that file with another ip or is not possible like this?

    What command i must use?
     
    ASTRAPI, Mar 11, 2011 IP
  7. dynashox

    dynashox Premium Member Staff

    Messages:
    8,662
    Likes Received:
    563
    Best Answers:
    3
    Trophy Points:
    335
    #7
    You can block and unblock as many IP address as you want. Refer to iptables man page how to do this.

    /etc/init.d/iptables restart
     
    dynashox, Mar 12, 2011 IP
  8. mathew12

    mathew12 Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    you can do it with CSF or refer the man page for the iptable utilities and proceed as per the instruction given.
     
    mathew12, Mar 15, 2011 IP