「bridge」-
bridge – show / manipulate bridge addresses and devices
命令语法格式
bridge [ OPTIONS ] OBJECT { COMMAND | help }
OBJECT := { link | fdb | mdb | vlan | monitor }
OPTIONS := { -V[ersion] | -s[tatistics] | -n[etns] name | -b[atch] filename | -j[son] }
bridge link set dev DEV [ cost COST ] [ priority PRIO ] [ state STATE] [ guard { on | off } ] [ hairpin { on | off } ] [ fastleave { on | off } ] [ root_block { on | off } ] [ learning { on | off } ] [ learning_sync { on | off } ] [ flood { on | off } ] [ hwmode { vepa | veb } ] [ mcast_flood { on | off } ] [ self ] [ master ]
bridge link [ show ] [ dev DEV ]
bridge fdb { add | append | del | replace } LLADDR dev DEV { local | static | dynamic } [ self ] [ master ] [ router ] [ use ] [ dst IPADDR ] [ vni VNI ] [ port PORT ] [ via DEVICE ]
bridge fdb [ show ] [ dev DEV ]
bridge mdb { add | del } dev DEV port PORT grp GROUP [ permanent | temp ] [ vid VID ]
bridge mdb show [ dev DEV ]
bridge vlan { add | del } dev DEV vid VID [ pvid ] [ untagged ] [ self ] [ master ]
bri[……]
「ctstat」-
lnstat – unified linux network statistics
命令语法格式
lnstat [options]
命令描述
This manual page documents briefly the lnstat command.
lnstat is a generalized and more feature-complete replacement for the old rtstat program. It is commonly used to periodically print a selection of statistical values exported by the kernel. In addition to routing cache statistics, it supports any kind of statistics the linux kernel exports via a file in /proc/net/stat/.
Each file in /proc/net/stat/ contains a header line listing the column names. These names are used by lnstat as keys for selecting which statistics to print. For every CPU present in the system, a line follows which lists the actual values for each column of the file. lnstat sums these values up (which in fact are counters) before printing them. After each interval, only the difference to the last value is printed.
Files and columns may be selected by using the -f and -k parameters. By default, all columns of all files are printed.
命令支持的选项及含义
lnstat supports the following options.
-h, –help
Show summary of options.[……]
「genl」-
genl – generic netlink utility frontend
命令语法格式
genl [ -s[tatistics] ] [ -d[etails] ] [ -r[aw] ] OBJECT
genl { -V[ersion] | -h[elp] }
OBJECT := { ctrl CTRL_OPTS }
CTRL_OPTS := { help | list | monitor | get PARMS }
PARMS := { name NAME | id ID }
命令描述
The genl utility provides a simple frontend to the generic netlink library. Although it’s designed to support multiple OBJECTs, for now only the ctrl object is available, which is used to query the generic netlink controller.
ctrl
The generic netlink controller can be queried in various ways:
help This command just prints a help text for the ctrl object.
list Show the registered netlink users.
monitor
Listen for generic netlink notifications.
get Query the controller for a given user, identified either by name or id.
命令支持的选项及含义
genl supports the following options.
-h, -help
Show summary of options.
-V, -Version
Show version of program.
-s, -stats, -statistics
S[……]
「ifcfg(8)」-
简化脚本,用于取代ifconfig的IP管理
命令语法格式
ifcfg [ DEVICE ] [ command ] ADDRESS [ PEER ]
命令描述
本手册页简要介绍了ifcfg命令。
这是一个简单的脚本,取代了ifconfig的一个选项,即IP地址管理。 它不仅可以添加地址,还可以执行重复地址检测RFC-DHCP,发送未经请求的ARP来更新其他主机共享接口的缓存,添加一些控制路由并在必要时重新启动路由器发现。
命令行命令
DEVICE 它可能有别名,后缀,用冒号分隔。
command 取值可以是add、delete、stop
ADDRESS IP地址,可选地后跟前缀长度。
peer pointpoint接口的可选对等地址。
注意事项
该脚本不适用与IPv6
相关手册
IP Command reference ip-cref.ps
参考文献
man 8 ifcfg, Version 0.8.32
更新日志
10/25/2018 创建文章[……]
「ip(8)」-
显示/操纵路由、设备、策略路由、隧道
命令语法格式
ip [ OPTIONS ] OBJECT { COMMAND | help } ip [ -force ] -batch filename
命令中的「OPTIONS」部分
命令中的OPTIONS部分可以是以下选项:
-l, -loops <COUNT> 指定ip address flush逻辑在放弃之前将尝试的最大循环次数。 默认值为10。零(0)表示循环,直到删除所有地址。
-n, -netns <NETNS> 将ip切换到指定的网络命名空间<NETNS>。实际上它只是简化了执行:
# ip netns exec NETNS ip [ OPTIONS ] OBJECT { COMMAND | help }
简化为
# ip -n[etns] NETNS [ OPTIONS ] OBJECT { COMMAND | help }
-a, -all 对所有对象OBJECT执行指定的命令COMMAND,它取决于命令是否支持此选项。
-rc, -rcvbuf<SIZE> 设置netlink套接字接收缓冲区大小,默认为1MB。
输出信息控制
-iec 以IEC为单位,打印易读的速率(例如1Ki = 1024)。关于IEC和SI参考维基百科「Binary prefix」一文。
-h, -human, -human-readable 输出易读的统计信息,后跟表示单位的后缀。
-s, -stats, -statistics 输出更多信息。如果该选项出现两次或更多次,则输出的信息量会增加。通常,输出的信息是一些统计信息或某些时间值。
-d, -details 输出更详细的信息。
-c, -color 使用彩色输出。
-t, -timestamp 使用monitor选项时,显示当前时间。
-ts, -tshort 类似于-timestamp选项,但是格式更短一些。
-o, -oneline 将每条记录输出到一行,用’\’字符替换换行符。 当您想要使用wc(1)计数记录或使用grep(1)过滤输出时,这很方便。
-r, -resolve 使用系统的名称解析程序来打印DNS名称,而不是打印主机地址。
批量执行命令
-b, -batch <FILENAME> 从提供的文件<FILENAME>或标准输入中读取命令并调用它们。当遇到首个执行失败的命令时,将终止ip命令的执行。
-force 在批处理模式(-b, –batch)下,不要因为错误而终止ip[……]
「lnstat」-
lnstat – unified linux network statistics
命令语法格式
lnstat [options]
命令描述
This manual page documents briefly the lnstat command.
lnstat is a generalized and more feature-complete replacement for the old rtstat program. It is commonly used to periodically print a selection of statistical values exported by the kernel. In addition to routing cache statistics, it supports any kind of statistics the linux kernel exports via a file in /proc/net/stat/.
Each file in /proc/net/stat/ contains a header line listing the column names. These names are used by lnstat as keys for selecting which statistics to print. For every CPU present in the system, a line follows which lists the actual values for each column of the file. lnstat sums these values up (which in fact are counters) before printing them. After each interval, only the difference to the last value is printed.
Files and columns may be selected by using the -f and -k parameters. By default, all columns of all files are printed.
命令支持的选项及含义
lnstat supports the following options.
-h, –help
Show summary of options.[……]
「nstat(8)」-
「routef」-
routel – list routes with pretty output format
routef – flush routes
SYNTAX
routel [tablenr [raw ip args…]]
routef
命令描述
These programs are a set of helper scripts you can use instead of raw iproute2 commands.
The routel script will list routes in a format that some might consider easier to interpret then the ip route list equivalent.
The routef script does not take any arguments and will simply flush the routing table down the drain. Beware! This means deleting all routes which will make your network unusable!
相关文件
/usr/bin/routef
/usr/bin/routel
AUTHORS
The routel script was written by Stephen R. van den Berg <srb@cuci.nl>, 1999/04/18 and donated to the public domain.
This manual page was written by Andreas Henriksson <andreas@fatal.se>, for the Debian GNU/Linux system.
相关手册
ip(8)
参考文献
man 8 routel, Version target gateway source proto scope dev tbl
更新日志
08/03/2018 创建文章[……]
「routel」-
routel – list routes with pretty output format
routef – flush routes
SYNTAX
routel [tablenr [raw ip args…]]
routef
命令描述
These programs are a set of helper scripts you can use instead of raw iproute2 commands.
The routel script will list routes in a format that some might consider easier to interpret then the ip route list equivalent.
The routef script does not take any arguments and will simply flush the routing table down the drain. Beware! This means deleting all routes which will make your network unusable!
相关文件
/usr/bin/routef
/usr/bin/routel
AUTHORS
The routel script was written by Stephen R. van den Berg <srb@cuci.nl>, 1999/04/18 and donated to the public domain.
This manual page was written by Andreas Henriksson <andreas@fatal.se>, for the Debian GNU/Linux system.
相关手册
ip(8)
参考文献
man 8 routel, Version target gateway source proto scope dev tbl
更新日志
08/03/2018 创建文章[……]
「rtacct(8)」-
网络统计工具
命令语法格式
nstat [ -h?vVzrnasd:t: ] [ PATTERN [ PATTERN ] ]
rtacct [ -h?vVzrnasd:t: ] [ ListOfRealms ]
命令描述
命令nstat和rtacct是监视内核snmp计数器和网络接口统计信息的简单工具。
命令支持的选项及含义
-z, –zero 显示为零的计数器。默认是不显示的。
-r, –reset 重置历史。
-n, –nooutput 不显示任何东西,只更新历史。
-a, –ignore 转储计数器的绝对值。 默认设置是计算自上次使用以来的增量。
-s, –noupdate 不要更新历史记录,以便下次您将看到包含累积到此测量时刻的值的计数器。
-j, –json 以JSON格式显示结果。
-d, –interval <INTERVAL> 以守护进程模式运行收集统计信息。 <INTERVAL>是以秒为单位的测量间隔。
Time 平均率的时间间隔。 默认值为60秒。
其他选项
-h, –help 显示帮助信息。
-V, –version 显示版本信息。
相关文档
lnstat(8)
参考文献
man 8 rtacct, Version 2007
更新日志
08/03/2018 创建文章[……]
「rtmon」-
rtmon – listens to and monitors RTnetlink
命令语法格式
rtmon [ options ] file FILE [ all | LISTofOBJECTS ]
命令描述
This manual page documents briefly the rtmon command.
rtmon listens on netlink socket and monitors routing table changes.
rtmon can be started before the first network configuration command is issued. For example if you insert:
rtmon file /var/log/rtmon.log
in a startup script, you will be able to view the full history later. Certainly, it is possible to start rtmon at any time. It prepends the history with the state snapshot dumped at the moment of starting.
命令支持的选项及含义
rtmon supports the following options:
-Version
Print version and exit.
help Show summary of options.
file FILE [ all | LISTofOBJECTS ]
Log output to FILE. LISTofOBJECTS is the list of object types that we want to monitor. It may contain ‘link’, ‘address’, ‘route’ and ‘all’. ‘link’ specifies the network device, ‘address’ the protocol (IP or IPv6) address on a device, ‘route’ the routing table entry and ‘all’ does what the name says.[……]
「rtpr」-
rtpr – replace backslashes with newlines.
命令描述
rtpr is a trivial bash script which converts backslashes in standard input to newlines. It’s sole purpose is to be fed with input from ip when executed with it’s –oneline flag.
使用示例
ip –oneline address show | rtpr
Undo oneline converted ip-address output.
相关手册
ip(8)
AUTHORS
Stephen Hemminger <shemming@brocade.com>
参考文献
18 September, man 8 rtpr, Version 2015
更新日志
08/03/2018 创建文章[……]
「rtstat」-
lnstat – unified linux network statistics
命令语法格式
lnstat [options]
命令描述
This manual page documents briefly the lnstat command.
lnstat is a generalized and more feature-complete replacement for the old rtstat program. It is commonly used to periodically print a selection of statistical values exported by the kernel. In addition to routing cache statistics, it supports any kind of statistics the linux kernel exports via a file in /proc/net/stat/.
Each file in /proc/net/stat/ contains a header line listing the column names. These names are used by lnstat as keys for selecting which statistics to print. For every CPU present in the system, a line follows which lists the actual values for each column of the file. lnstat sums these values up (which in fact are counters) before printing them. After each interval, only the difference to the last value is printed.
Files and columns may be selected by using the -f and -k parameters. By default, all columns of all files are printed.
命令支持的选项及含义
lnstat supports the following options.
-h, –help
Show summary of options.[……]
「ss(8)」-
另一个调查套接字的实用程序
命令语法格式
ss [options] [ FILTER ]
命令描述
命令ss用于转储套接字的统计信息。它允许显示类似于netstat(8)的信息。它可以显示比其他工具更多的TCP和状态信息。
命令行选项
如果没有使用任何选项,则ss显示已建立连接的打开的非监听套接字列表(例如TCP/UNIX/UDP)。
-H, –no-header 抑制标题行。
-n, –numeric 不解析服务名。
-r, –resolve 不解析IP地址和端口号。
-a, –all 显示“监听”与“非监听”的套接字。对于TCP来说,“非监听”指的是已经建立的连接。
-l, –listening 只显示“监听”的套接字。默认情况下忽略该选项。
-o, –options 显示计时器的信息。
-e, –extended 显示套接字的详细信息。
-m, –memory 显示套接字的内存使用信息。
-i, –info 显示内部的TCP信息。
-K, –kill 试图强行关闭套接字。 此选项显示已成功关闭的套接字、以静默方式跳过内核不支持关闭的套接字。它仅支持IPv4和IPv6套接字。
-s, –summary 打印摘要统计。此选项不解析从各种源获取摘要的套接字列表。 当套接字的数量太大,以至于解析/proc/net/tcp很痛苦时,此选项很有用。
-p, –processes 显示正在使用套接字的进程。
-Z, –context 如同-p选项,还显示进程安全性上下文。
对于netlink(7)套接字,初时进程上下文显示如下:
如果有效的pid,则显示进程上下文。
如果destination是内核(pid = 0),则显示内核初始上下文。
如果内核或netlink用户已分配唯一标识符,则将上下文显示为“unavailable”。 这通常表示进程有多个netlink套接字处于活动状态。
-z, –contexts 与选项-Z一起,但也显示套接字上下文。 套接字上下文取自关联的inode,而不是内核持有的实际套接字上下文。 套接字通常用创建进程的上下文标记,但是所显示的上下文将反映应用的任何策略角色、类型、范围转换规则,因此是有用的参考。
-N NSNAME, –net=NSNAME 切换到指定的网络命名空间名称。
-A QUERY, –query=QUERY, –socket=QUERY 要转储的套接字表列表,以逗号分隔。支持标识符有:all,inet,tcp,udp,raw,unix,packet,netlink,un[……]
「tc」-
tc – show / manipulate traffic control settings
命令语法格式
tc [ OPTIONS ] qdisc [ add | change | replace | link | delete ] dev DEV [ parent qdisc-id | root ] [ handle qdisc-id ] qdisc [ qdisc specific parameters ]
tc [ OPTIONS ] class [ add | change | replace | delete ] dev DEV parent qdisc-id [ classid class-id ] qdisc [ qdisc specific parameters ]
tc [ OPTIONS ] filter [ add | change | replace | delete | get ] dev DEV [ parent qdisc-id | root ] protocol protocol prio priority filtertype [ filtertype specific parameters ] flowid flow-id
tc [ OPTIONS ] [ FORMAT ] qdisc show [ dev DEV ]
tc [ OPTIONS ] [ FORMAT ] class show dev DEV
tc [ OPTIONS ] filter show dev DEV
OPTIONS := { [ -force ] -b[atch] [ filename ] | [ -n[etns] name ] | [ -nm | -nam[es] ] | [ { -cf | -c[onf] } [ filename ] ] }
FORMAT := { -s[tatistics] | -d[etails] | -r[aw] | -p[retty] | -i[ec] | -g[raph] }
命令描述
Tc is used to configure Traffic Control in the Linux kernel. Traffic Control consists of the following:
SHAPING
When traffic is shaped, its rate[……]
「在GNU/Linux中,安装iptables防火墙」
从发行版的源中安装
#!/bin/bash
# Kali GNU/Linux Rolling
apt-get install iptables
使用源码编译安装
参考BLFS/Iptables-1.6.0中的说明。
安装的可执行程序
iptables / ip6tables 用于设置、维护、检查Linux内核中的IP数据包过滤规则表。该命令是用于配置防火墙的主要命令,对防火墙的操作主要是通过该命令实现的。
iptables-restore / ip6tables-restore 从文件中或者STDIN中读取数据中来恢复IP表。可以用于将多条防火墙配置数据导入到防火墙中。该命令识别的数据格式与iptables-save命令导出的格式相同。
iptables-save / ip6tables-save 将IP表的内容以一种易于解析的格式输出到STDOUT中。或者可以使用SHELL的I/O重定向来输出到文件。该命令可以用于导出防火墙的配置,并且该命令导出的配置可以使用iptables-restore命令再次导入到防火墙中。
iptables-xml / ip6tables-xml 用于将iptables-save的输出转换为XML格式。你可以执行iptables-save | iptables-xml命令看一下输出。
xtables-multi 这是一个二进制文件。它的行为与调用它时所使用的名称相符。比如,创建指向xtables-multi且名为iptables的软链接,那执行该iptables软链接时,它的行为与实际的iptables命令相同。
参考文献
BLFS/Iptables-1.6.0[……]
「ip6tables(8)」-
用于IPv4/IPv6数据包过滤和NAT的管理工具
命令描述
参考iptables(8)手册。
参考文献
man 8 iptables, Version 1.6.2-1.1
更新日志
10/30/2018 创建文章[……]
「ip6tables-restore(8)」-
恢复IP表
命令描述
参考iptables-restore(8)手册。
参考文献
man 8 iptables-restore, Version 1.6.0+snapshot20161117-6
更新日志
09/15/2018 创建文章[……]
「ip6tables-save(8)」-
将iptables规则转储到标准输出
命令描述
参考iptables-save(8)手册。
参考文献
man 8 iptables-save, Version 1.6.2-1.1
更新日志
11/04/2018 创建文章[……]
「iptables(8)」-
用于IPv4/IPv6数据包过滤和NAT的管理工具
命令语法格式
iptables [-t table] {-A|-C|-D} chain rule-specification
ip6tables [-t table] {-A|-C|-D} chain rule-specification
iptables [-t table] -I chain [rulenum] rule-specification
iptables [-t table] -R chain rulenum rule-specification
iptables [-t table] -D chain rulenum
iptables [-t table] -S [chain [rulenum]]
iptables [-t table] {-F|-L|-Z} [chain [rulenum]] [options…]
iptables [-t table] -N chain
iptables [-t table] -X [chain]
iptables [-t table] -P chain target
iptables [-t table] -E old-chain-name new-chain-name
rule-specification = [matches…] [target]
match = -m matchname [per-match-options]
target = -j targetname [per-target-options]
命令描述
命令iptables和ip6tables用于在Linux内核中设置、维护、检查IPv4和IPv6数据包过滤规则表。
在iptables中,有以下几个术语:
Table,表,目前有5个独立的”表“:filter、nat、mangle、raw、security。参见后面的介绍。
Chain,链,“链”属于“表”,不同的“表”包含不同的“链”,但通常都包含了INPUT、OUTPUT,或者FORWARD等等。也可以包含“用户自定义的链”。
Rule,规则,”规则“用于判断一个数据包是否匹配。
Target,目标,如果数据包匹配了”规则“,则跳转到”目标“进行处理,这一步决定了如何处理这个数据包。
可以定义几个不同的表。 每个表包含许多内置的链(Chain),也可能包含用户定义的链。
每个链都是一组可以匹配一组数据包的规则。 每个规则都指定如何处理匹配的数据包。 这称为“目标”,可以跳转到同一个表中的用户定义链。
命令行参数[……]
「iptables-extensions」-
iptables-extensions — list of extensions in the standard iptables distribution
命令语法格式
ip6tables [-m name [module-options…]] [-j target-name [target-options…]
iptables [-m name [module-options…]] [-j target-name [target-options…]
MATCH EXTENSIONS
iptables can use extended packet matching modules with the -m or –match options, followed by the matching module name; after these, various extra command line options become available, depending on the specific module. You can specify multiple extended match modules in one line, and you can use the -h or –help options after the module has been specified to receive help specific to that module. The extended match modules are evaluated in the order they are specified in the rule.
If the -p or –protocol was specified and if and only if an unknown option is encountered, iptables will try load a match module of the same name as the protocol, to try making the option available.
addrtype
This module matches packets based on their address type. Address types are used within the kernel networking stack and categorize addresses into various groups. The exact d[……]
「iptables-restore(8)」-
恢复IP表
命令语法格式
iptables-restore [-chntv] [-M modprobe] [-T name] [file]
ip6tables-restore [-chntv] [-M modprobe] [-T name] [file]
命令描述
命令iptables-restore和ip6tables-restore用于从文件(或标准输入)中指定的数据来恢复IPv4和IPv6表。使用Shell提供的I/O重定向从文件读取或指定文件作为参数。
命令支持的选项及含义
-c, –counters 恢复所有数据包和字节计数器的值
-M, –modprobe modprobe_program 指定modprobe程序的路径。 默认情况下,iptables-restore将检查/proc/sys/kernel/modprobe以确定可执行文件的路径。
-T, –table name 即使输入流包含其他表,也只恢复由name指定的表。
-n, –noflush 不要刷新表的先前内容。如果未指定,则两个命令都刷新(flush、delete)相应表的所有先前内容。
-t, –test 仅解析和构造规则集,但不提交它。
-v, –verbose 在规则集处理期间,打印其他调试信息。
-h, –help 显示一个简短的选项摘要。
相关手册
iptables-apply(8),iptables-save(8), iptables(8)
iptables-HOWTO详细说明了更多的iptables用法;NAT-HOWTO详细介绍了NAT;netfilter-hacking-HOWTO详细介绍了内部结构。
参考文献
man 8 iptables-restore, Version 1.6.0+snapshot20161117-6
更新日志
09/15/2018 创建文章[……]
「iptables-save(8)」-
将iptables规则转储到标准输出
命令语法格式
iptables-save [-M modprobe] [-c] [-t table]
ip6tables-save [-M modprobe] [-c] [-t table]
命令描述
命令iptables-save和ip6tables-save用于以易于解析的格式将IPv4或IPv6表的内容转储到标准输出。 使用Shell提供的I/O重定向来写入文件。
命令支持的选项及含义
-c, –counters 输出中包含所有数据包和字节计数器的值
-M, –modprobe modprobe_program 指定modprobe程序的路径。 默认情况下,iptables-restore将检查/proc/sys/kernel/modprobe以确定可执行文件的路径。
-T, –table name 输出中只包含由name指定的表。如果未指定,则输出所有的可用的表。
相关手册
iptables-apply(8),iptables-restore(8), iptables(8)
iptables-HOWTO详细说明了更多的iptables用法;NAT-HOWTO详细介绍了NAT;netfilter-hacking-HOWTO详细介绍了内部结构。
参考文献
man 8 iptables-save, Version 1.6.0+snapshot20161117-6
更新日志
09/16/2018 创建文章[……]
「iptables-xml(1)」-
将iptables-save格式转换为XML
命令语法格式
iptables-xml [-c] [-v]
命令描述
iptables-xml用于将iptables-save的输出转换为易于操作的XML格式到标准输出。使用Shell提供的I/O重定向来写入文件。
命令支持的选项及含义
-c, –combine 将连续规则与相同匹配但不同目标相结合。iptables目前不支持每个匹配多个目标,因此这通过将连续iptables规则中的目标收集到一个操作标记中来模拟,但仅当规则匹配时才相同。 终止操作(RETURN,DROP,ACCEPT,QUEUE等)不会与后续目标结合使用。
-v, –verbose 输出XML注释,其中包含从中派生XML的iptables行。
注意事项
iptables-xml将机制转换为非常有表现力的xml格式;唯一的语义考虑因素是-g和-j目标,以区分<call>、<goto>、<nane-of-target>,因为它可以帮助xml处理脚本,如果它们可以区分像SNAT目标和另一个链。
输出示例
<iptables-rules>
<table name=”mangle”>
<chain name=”PREROUTING” policy=”ACCEPT” packet-count=”63436″ byte-count=”7137573″>
<rule>
<conditions>
<match>
<p>tcp</p>
</match>
<tcp>
<sport>8443</sport>
</tcp>
</conditions>
<actions>
<call>
<check_ip/>
</call>
<ACCEPT/>
</actions>
</rule>
</chain>
</table>
</iptables-rules>
可以使用iptables.xslt脚本和xsltproc或使用libxsltproc或类似的自定义程序从XML转换为iptables-save格式;以这种方式:xsltproc iptables.xslt my-iptables.xml | iptables-restore
相关手册
iptabl[……]
「xtables-multi(8)」-
用于netfilter的iptables和ip6tables的xtables多链接二进制文件
命令语法格式
xtables-multi
命令描述
xtables-multi没有官方手册页。它是一个二进制文件,根据它所调用的名称运行。另请参见列出名称。
相关手册
iptables(8), ip6tables(8), iptables-save(8), ip6tables-save(8), iptables-restore(8), ip6tables-restore(8)
参考文献
man 8 xtables-multi, Version 1.6.0+snapshot20161117-6
更新日志
09/16/2018 创建文章[……]
「iptraf-ng」
「iptraf-ng(8)」-
交互式彩色IP LAN监视器
命令语法格式
iptraf { [ -f ] [ -q ] [ -u ] [ { -i iface | -g | -d iface | -s iface | -z iface | -l iface } [ -t timeout ] [ -B [ -L logfile ] ] ] }
命令描述
命令iptraf是一个基于ncurses的IP LAN监视器,可生成各种网络统计信息,包括TCP信息,UDP计数,ICMP和OSPF信息,以太网负载信息,节点统计信息,IP校验和错误等等。
如果在没有任何命令行选项的情况下运行iptraf命令,则程序将以交互模式启动,并通过主菜单访问各种功能。
命令支持的选项及含义
支持的选项如下:
-i iface 立即在指定接口启动IP流量监视器。如果指定了“-i all”,则所有接口上。
-d iface 允许您立即启动指定接口上的详细信息(iface)
-s iface 允许您立即监视指定接口上的TCP和UDP流量(iface)
-z iface 显示指定接口上的数据包计数大小
-l iface 在指定接口上启动LAN站监视器。如果指定了“-l all”,则所有LAN接口。
-t timeout 告诉IPTraf仅运行指定的工具timout分钟。 此选项仅用于上述参数之一。
-B 将标准输出重定向到/dev/null,关闭标准输入,并将程序分叉到后台。 只能与上面的设施调用参数之一来一起使用。 向后台进程发送USR2信号来终止。
-L logfile 允许您指定备用日志文件名。 默认日志文件名基于所选接口(详细接口统计信息,TCP/UDP服务统计信息,数据包大小细分),或设施实例(IP流量监视器,LAN站监视器)。 如果未指定路径,则日志文件将放在/var/ log/iptraf中。
-f 清除所有锁和计数器,导致IPTraf的这个实例认为它是第一个运行的。 这应仅用于从异常终止或系统崩溃中恢复。
-u 允许使用不受支持的接口作为以太网设备。 如果更改了接口的名称,则需要这样做(例如:ip link set eth0 name foo0)
-g 立即启动常规接口统计。
其他选项
-q 不再需要,仅为兼容性而维护。
-h 显示命令摘要。
信息号
SIGUSR1 在程序运行时轮转日志。
SIGUSR2 终止的后台运行的IPTraf进程。
相关文件
/var/log/iptraf/*.log 日志文件。
/var/lib/iptraf/* 重要的IPTraf数据文件。
相关手册
Documentation[……]
「iptstate」
「iptstate(8)」-
以top命令的风格显示IP表状态表条目
命令语法格式
iptstate [<options>]
命令描述
命令iptstate以类似top的格式,实时显示IP表状态表中保存的信息。输出可以按任何字段排序,也可以按任何字段反向排序。用户可以选择只输出一次输出并退出,而不是类似top系统。刷新率是可配置的,IP可以解析为名称,输出可以格式化,显示可以过滤,颜色编码是许多功能中的一些。
命令行选项
-c, –no-color 按协议切换颜色代码。
-t, –totals 切换总计的显示。
-C, –counters 切换bytes/packets计数器的显示。
-l, –lookup 显示主机名,而不是IP地址。启用此功能还将启用-L选项,以防止数量不断增加的DNS请求。
-L, –no-dns 跳过传出的DNS查找状态
-m, –mark-truncated 使用“+”标记截断的主机名
-o, –no-dynamic 切换动态格式化。
-f, –no-loopback 在环回上过滤状态。
-p, –no-scroll 没有滚动(不要使用“pad”)。 有关更多信息,请参阅SCROLLING和PADS部分。
-R, –rate seconds 刷新率,然后是以秒为单位的速率。请注意,这适用于statetop模式,不适用于单次运行模式(–single)。
-1, –single 单次运行(没有Curses)
限制IP地址和端口
-d, –dst-filter IP 仅显示目标地址为IP的状态。注意,参数IP必须是地址,尚不支持主机名匹配。
-D –dstpt-filter port 仅显示目标端口为port的状态。
-s, –src-filter IP 仅显示源地址为IP的状态。注意,参数IP必须是地址,尚不支持主机名匹配。
-S, –srcpt-filter port 仅显示源端口为port的状态。
排序
-r, –reverse 反向排序。
-b, –sort column 这决定了要排序的列。选项:
S Source Port
d Destination IP (or Name)
D Destination Port
p Protocol
s State
t TTL
b Bytes
P Packets
要按源IP(或名称)排序,请不要使用-b。 按bytes/packets排序仅适用于支持它的内核,并且仅在针对libnetfilter_conntra[……]
「iputils」
arping
clockdiff
ninfod
ping
rarpd
rdisc
tftpd
tracepath
traceroute6
参考文献
https://github.com/iputils/iputils[……]