系统相关
首页 > 系统相关> > linux – 实用程序iptables列出主机名而不是IP地址

linux – 实用程序iptables列出主机名而不是IP地址

作者:互联网

使用命令

iptables -L

我列出了所有链中的规则,但此工具列出了保存规则的主机名而不是IP地址.这是一种难以阅读的,因为我想在列表中快速找到一些IP地址,这是不可能的.

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

解决方法:

使用以下内容:

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

标签:linux,ip,iptables,ip-address,firewall
来源: https://codeday.me/bug/20190722/1507345.html