【问题标题】:Utility iptables lists host names and not IP addresses实用程序 iptables 列出主机名而不是 IP 地址
【发布时间】:2014-03-31 19:57:43
【问题描述】:

使用命令

iptables -L

我列出了所有链中的规则,但此工具列出了已保存规则的主机名而不是 IP 地址。这有点难读,因为如果我想在列表中快速找到某个 IP 地址,那是不可能的。

有没有办法,命令开关或任何简单易用的东西,让我列出我的 iptables 规则与 IP 地址而不是主机名?

【问题讨论】:

    标签: linux ip ip-address firewall iptables


    【解决方案1】:

    使用以下内容:

    iptables -L -n
    

    来自man page

    -n, --numeric
        Numeric output. IP addresses and port numbers will be printed in numeric format.
        By default, the program will try to display them as host names, network names, 
        or services (whenever applicable). 
    

    【讨论】:

    • 这很简单 :) 谢谢!
    猜你喜欢
    • 2015-01-22
    • 1970-01-01
    • 2016-05-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多