2014-02-28 94 views
3

使用命令实用的iptables列出主机名,而不是IP地址

iptables -L 

我列出的规则在所有连锁,但是这个工具列出主机名被保存的规则,而不是IP地址。这是一种艰难的阅读,因为如果我想快速在列表中找到某个IP地址,这是不可能的。

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

回答

7

使用以下命令:

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). 
+1

这是容易的:)谢谢! –

相关问题