Results 1 to 13 of 13

Thread: iptables

  1. #1
    Join Date
    Jan 2005
    Posts
    2,175

    iptables

    Hi, could someoe tell me how to Undo these actions?

    iptables -I INPUT -s 0/0 -p tcp --dport 6666 -j DROP
    iptables -I INPUT -s 0/0 -p tcp --dport 7000 -j DROP

    Thanks.

  2. #2
    change -I to -D

    -D, --delete chain rulenum
    Delete one or more rules from the selected chain. There are two
    versions of this command: the rule can be specified as a number
    in the chain (starting at 1 for the first rule) or a rule to
    match.

    -I, --insert chain [rulenum] rule-specification
    Insert one or more rules in the selected chain as the given rule
    number. So, if the rule number is 1, the rule or rules are
    inserted at the head of the chain. This is also the default if
    no rule number is specified.

  3. #3
    Join Date
    Jan 2005
    Posts
    2,175
    Doesn't work

    iptables -D INPUT -s 0/0 -p tcp --dport 6666 -j DROP
    iptables: Bad rule (does a matching rule exist in that chain?)

  4. #4
    Join Date
    Nov 2005
    Location
    Minneapolis, MN
    Posts
    1,648
    Are those rules actually applied? (ie, does "iptables -t filter -L" show them active?)
    Eric Spaeth
    Enterprise Network Engineer :: Hosting Hobbyist :: Master of Procrastination
    "The really cool thing about facts is they remain true regardless of who states them."

  5. #5
    Join Date
    Jan 2005
    Posts
    2,175
    I don't see them there. It wouldn't show blocked ports, would it? btw, I see many hostnames on that output, but which file is that iptables command reading from?


    However, I see it in /etc/sysconfig/iptables

    # Generated by iptables-save v1.2.8 on Mon Oct 2 14:45:41 2006
    *filter
    :INPUT ACCEPT [176185:84350057]
    :FORWARD ACCEPT [0:0]
    :OUTPUT ACCEPT [211152:220633642]
    :acctboth - [0:0]
    -A INPUT -p tcp -m tcp --dport 7000 -j DROP
    -A INPUT -p tcp -m tcp --dport 6666 -j DROP
    -A INPUT -j acctboth
    -A OUTPUT -j acctboth

  6. #6
    Join Date
    Nov 2005
    Location
    Minneapolis, MN
    Posts
    1,648
    Quote Originally Posted by ANewDay
    I don't see them there. It wouldn't show blocked ports, would it? btw, I see many hostnames on that output, but which file is that iptables command reading from?
    That's reading from the active ruleset being executed by the kernel, so that's the policy as it's being enforced right now. (and yes, it will show any rule defined) The hostnames are just reverse DNS lookups, you can see it in numeric form by doing "iptables -t filter -n -L"
    Eric Spaeth
    Enterprise Network Engineer :: Hosting Hobbyist :: Master of Procrastination
    "The really cool thing about facts is they remain true regardless of who states them."

  7. #7
    Join Date
    Jan 2005
    Posts
    2,175
    oh ok, so could I Just edit the sysconfig file and remove the line? then do ipables save ?

  8. #8
    Join Date
    Jan 2005
    Posts
    2,175
    none of you gurus have any idea?

  9. #9
    iptables -F will clear all of your iptables rules...just make sure you can get your defaults reloaded.

  10. #10
    Join Date
    Jan 2005
    Posts
    2,175
    You mean iptables -F deletes all allow/banned IPs as well? How do you get the defaults reloaded? I have APF firewall installed.

  11. #11
    Join Date
    Nov 2005
    Location
    Minneapolis, MN
    Posts
    1,648
    Who set this up initially? It might be best to contact them.
    Eric Spaeth
    Enterprise Network Engineer :: Hosting Hobbyist :: Master of Procrastination
    "The really cool thing about facts is they remain true regardless of who states them."

  12. #12
    Yes, delete the lines from sysconfig and restart iptables. This will work

  13. #13
    apf -r will reload your firewall rules into iptables.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •