Find the answer to your Linux question:
Results 1 to 3 of 3
Like Tree1Likes
  • 1 Post By awc
The first ,i'm using verstion:iptables v1.3.5 i insert a rule(iptables -I RH-Firewall-1-INPUT 2 -m state --state NEW -s 42.228.8.194 -m tcp -p tcp --dport 21 -j DROP ) to Chain ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! ibelieveme's Avatar
    Join Date
    Apr 2011
    Posts
    30

    iptables weird question


    The first ,i'm using verstion:iptables v1.3.5
    i insert a rule(iptables -I RH-Firewall-1-INPUT 2 -m state --state NEW -s 42.228.8.194 -m tcp -p tcp --dport 21 -j DROP ) to Chain RH-Firewall-1-INPUT
    this ip:42.228.8.194 show "hn.kd.ny.adsl "
    HTML Code:
    [root@localhost shell]# iptables --list
    Chain RH-Firewall-1-INPUT (2 references)
    target     prot opt source               destination         
    ACCEPT     all  --  anywhere             anywhere            
    DROP       tcp  --  hn.kd.ny.adsl        anywhere            state NEW tcp dpt:ftp 
    ACCEPT     icmp --  anywhere             anywhere            icmp any
    i insert same rule:iptables -I RH-Firewall-1-INPUT 2 -m state --state NEW -s 61.147.110.21 -m tcp -p tcp --dport 21 -j DROP
    this ip:61.147.110.21 show:that's right
    HTML Code:
    [root@localhost shell]# iptables --list
    Chain RH-Firewall-1-INPUT (2 references)
    target     prot opt source               destination         
    ACCEPT     all  --  anywhere             anywhere     
    DROP       tcp  --  61.147.110.21        anywhere            state NEW tcp dpt:ftp       
    DROP       tcp  --  hn.kd.ny.adsl        anywhere            state NEW tcp dpt:ftp 
    ACCEPT     icmp --  anywhere             anywhere            icmp any
    i don't know where question.help me thank you.

  2. #2
    awc
    awc is offline
    Just Joined! awc's Avatar
    Join Date
    Aug 2012
    Location
    North America
    Posts
    40
    Be default, iptables -L or iptables --list, attempts to resolve ip addresses to hostnames. It doesn't affect the rule, it's just a matter of output

    If you only want to see ip's use:

    Code:
     iptables -L -n
    From man iptables

    "-L, --list [chain]
    List all rules in the selected chain. If no chain is selected, all chains are listed. Like every other iptables command, it applies to the specified table (filter is the default), so NAT rules get listed by

    iptables -t nat -n -L

    Please note that it is often used with the -n option, in order to avoid long reverse DNS lookups."
    ibelieveme likes this.

  3. #3
    Just Joined! ibelieveme's Avatar
    Join Date
    Apr 2011
    Posts
    30
    Thank you very much

Posting Permissions

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