「tftp(1)」-

琐碎的文件传输程序
命令语法格式
tftp [host]
命令描述
命令tftp是Internet TFTP(普通文件传输协议)的用户界面,允许用户与远程计算机之间传输文件。可以在命令行上指定远程主机,在这种情况下,tftp使用host作为将来传输的默认主机(请参阅下面的connect命令)。
交互命令
Once tftp is running, it issues the prompt and recognizes the following commands:
mode transfer-mode 设置传输模式;传输模式可以是ascii或binary之一。默认为ascii。
ascii 等同于”mode ascii”
binary 等同于”mode binary”
connect host-name [port] 设置传输的主机(和可选端口)。请注意,与FTP协议不同,TFTP协议不保持传输之间的连接;因此,命令connect实际上不会创建连接,而只是记住要用于传输的主机。您不必使用connect命令;远程主机可以指定为get或put命令的一部分。
get filename get remotename localname get file1 file2 … fileN 从指定的源获取文件或文件集。 源可以是以下两种形式之一:远程主机上的文件名(如果已指定主机),或者是hosts:filename形式的字符串,以同时指定主机和文件名。 如果使用后一种形式,则指定的最后一个主机名将成为将来传输的默认值。
put file put localfile remotefile put file1 file2 … fileN remote-directory 将一个或一组文件放入指定的远程文件或目录。 目标可以是以下两种形式之一:远程主机上的文件名,如果已指定主机,或者是hosts:filename形式的字符串,以同时指定主机和文件名。 如果使用后一种形式,则指定的主机名将成为将来传输的默认值。 如果使用remote-directory形式,则假定远程主机是UNIX计算机。
rexmt retransmission-timeout 设置每包重传超时,以秒为单位。
status 显示当前的状态。
timeout total-transmission-timeout 设置总传输超时,以秒为单位。
trace 切换数据包跟踪。
verbose 切换详细模式。
quit 退出tftp。使用EOF也会退出。
? command-name … 显示帮助信息。
注意事项
由于TFTP协议中没有用户登录或验证,因此远程[……]

READ MORE

「init-system-helpers」

init-system-helpers,用于所有的init系统(比如systemd或者sysvinit)的帮助工具。目的当然是为了简化init系统的管理。
这个软件包的维护者是Debain systemd Maintainers,属于Debain,当然Ubuntu中也有。
软件包中的文件列表
/usr/bin/deb-systemd-helper /usr/bin/deb-systemd-invoke /usr/sbin/debian-update-rc.d /usr/sbin/invoke-rc.d /usr/sbin/service /usr/sbin/update-rc.d
/usr/share/bug/init-system-helpers/control /usr/share/doc/init-system-helpers/README.invoke-rc.d.gz /usr/share/doc/init-system-helpers/README.policy-rc.d.gz /usr/share/doc/init-system-helpers/changelog.gz /usr/share/doc/init-system-helpers/copyright /usr/share/lintian/overrides/init-system-helpers
/usr/share/man/man1/deb-systemd-helper.1p.gz /usr/share/man/man1/deb-systemd-invoke.1p.gz /usr/share/man/man8/invoke-rc.d.8.gz /usr/share/man/man8/service.8.gz /usr/share/man/man8/update-rc.d.8.gz
Ubuntu 16.04.2 TLS
sysv-rc-conf
参考文献

apt-file list init-system-helpers[……]

READ MORE

「service(8)」-

运行一个System V init脚本
命令语法格式
service SCRIPT COMMAND [OPTIONS]
service –status-all
service –help | -h | –version
命令描述
命令service在尽可能可预测的环境中运行System V init脚本、systemd单元、upstart作业,删除大多数环境变量,并将当前工作目录设置为根目录。
SCRIPT 该参数指定位于/etc/init.d/SCRIPT中的System V init脚本;或systemd单元的名称;或/etc/init中的upstart作业的名称。如果存在与/etc/init.d中的脚本同名的systemd单元或upstart作业,将导致单元/作业优先于init.d脚本执行。
COMMAND 该参数支持的值取决于调用的脚本。 service将COMMAND和OPTIONS参数未经修改地传递给init脚本。对于systemd单元或upstart作业,start, stop, status, reload将传递到其systemctl/initctl的等效项。对于upstart作业,restart将调用作业的upstart ”stop“,然后紧接着是”start“,并将以”start“命令的返回码退出。
所有脚本至少应支持start和stop命令。作为特殊情况,如果COMMAND是–full-restart,则脚本运行两次,首先使用stop命令,然后使用start命令。此选项对upstart作业没有影响。
命令service –status-all使用status命令按字母顺序运行所有init脚本。运行服务的状态为[+];停止服务的状态为[-];没有’status’命令的服务为[?]。此选项仅调用sysvinit作业的状态;可以使用initctl list以类似方式查询upstart作业。
相关文件
/etc/init.d 该目录中包含了System V init脚本
/etc/init 该目录包含了upstart作业。
/{lib,run,etc}/systemd/system 该目录中包含了systemd单元。
相关环境变量
LANG, LANGUAGE, LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES, LC_PAPER, LC_NAME, LC_ADDRESS, LC_TELEPHONE, LC_MEASUREMENT, LC_IDENTIFICATION, LC_ALL, TERM, PATH 紧将这些环境变量传递给init脚[……]

READ MORE

「update-rc.d」

内容:介绍 update-rc.d 命令。
创建或移除System-V风格的init脚本的链接。 update-rc.d用于更新/etc/rcrunlevel.d/下名字格式为NNname的软链接,这些链接指向/etc/init.d/name脚本。当runlevel发生改变的时候,这些链接有由init运行;这些脚本一般用于启动和停止系统服务,如守护进程。runlevel是init支持的运行级别之一,即0123456789S,NNname中NN是一个两位的数字,决定了脚本的执行顺序。
这命令并不是所有的Linux发行版里都有,至少Debian里有,也许Debian的衍生版里也有。但是有一点:file-rc包含了update-rc.d、sysv-rc包含了update-rc.d、init-system-helpers也包含了update-rc.d,也许还有其他的软件包也包含了update-rc.d,这些update-rc.d用法有不同的地方,具体的使用请查看man手册。本文指的update-rc.d是sysv-rc包中的。
命令行语法及选项

update-rc.d [-n] [-f] name remove

update-rc.d [-n] name defaults

update-rc.d [-n] name disable|enable [ S|2|3|4|5 ]

创建INIT脚本链接

进入/etc/init.d/,这下面有很多的脚本,而/etc/rcrunlevel.d/下的链接都是指向该目录下的脚本。
update-rc.d创建链接时,需要提供“依赖关系”和“运行级别“信息,而这些信息位于/etc/init.d下的脚本中的“LSB注释头”(头部的注释中),你可以看一下,这些脚本的头部信息的内容。
man 8 insserv提供了“LSB头格式”的详细信息。关于更多insserv的内容,查看《insserv命令使用》
所以在使用update-rc.d前,确保/etc/init.d/name脚本存在以及”LSB头格式“是正确的。

当使用defaults选项时,update-rc.d创建名为/etc/rcrunlevel.d/[SK]NNname的链接指向/etc/init.d/name脚本,从“LSB注释头”中获取运行级别和依赖性信息。

update-rc.d只创建不存在的链接。如果/etc/rcrunlevel.d/[SK]??name文件已经存在,update-rc.d什么也不做。这么所就是为了不改变现有的配置,因为有写配置可能[……]

READ MORE

「initscripts」

该软件包只存在与RHEL中。在Debian中并无该软件包。
consoletype

章节列表
「consoletype(1)」-[……]

READ MORE

「consoletype(1)」-

连接到标准输入的控制台的打印类型
命令语法格式
consoletype [stdout] [fg]
命令描述
命令consoletype打印连接到标准输入的控制台类型,并检查连接到标准输入的控制台是否是当前的前台虚拟控制台。
没有参数时:

如果控制台是虚拟终端(如果不在串行控制台上,则为/dev/tty*或/dev/console设备),则打印“vt”。
如果标准输入是串行控制台(/dev/console或/dev/ttyS*),则打印“serial”。
如果标准输入是伪终端,则打印“pty”。

该命令存在于RHEL系列的发行版中。
退出状态
当没有向consoletype传递参数时,则返回:

0 如果在虚拟终端上

1 如果在串行控制台上

2 如果在伪终端上

传递stdout参数时,则consoletype返回:

0 在所有情况下都为0,并将控制台类型打印到标准输出。

传递fg参数时,则consoletype返回:

0 如果连接到标准输入的控制台是当前虚拟终端

1 其他情况。

如上三种情况的返回值。
参考文献

man 1 consoletype

更新日志

09/01/2018 创建文章[……]

READ MORE

「ioping」

章节列表
「ioping」-[……]

READ MORE

「ioping」-

实时监控磁盘的I/O延迟。ioping的主要思想是类似于ping命令,它以显示网络延迟相同的方式来显示磁盘I/O延迟。
命令行语法格式
ioping [-LABCDWRkq] [-c count] [-w deadline] [-p period] [-P period] [-i interval] [-s size] [-S wsize]
[-o offset] directory|file|device

ioping -h | -v
命令支持的选项及含义
-c count ping执行的次数。
-w deadline 指定执行的时间。默认以秒为单位,有关单位的介绍查看下面的“Argument suffixes”部分。
-p period 每period个请求,打印一次原始统计信息。
-P period 每隔period秒,打印一次原始统计信息。
-i interval 两次ping请求之间间隔的秒数。默认为1秒。
-s size 每个请求的大小。默认为4k。
-S size Working Set的大小(目录为1m。对于文件或者设备是完整的大小。)
-o offset 文件或者设备的起始偏移量。默认为0。
-k 保留在工作目录中生成的ioping.tmp文件。
-L 使用顺序操作代替默认的随机操作。同时将请求的大小设置为256k(-s 256k)。
-A 使用异步IO。(系统调用io_submit(2), io_submit(2)等)
-C 使用缓存的IO(使用posix_fadvise(2)抑制缓存无效)
-D 使用直接IO(参见手册open(2)中的O_DIRECT)
-W 使用写来代替读。对于以目录为目标的操作是安全的。 注意:对于文件/设备,会使数据碎片化。这种情况下,应才重复三次(-WWW)。
-R 磁盘寻道速率测试,等价于-q -i 0 -w 3 -S 64m。如果磁盘的缓存非常大,应该相应增加Working Set(-S)。
-B 批处理模式。只输出原始格式的最后统计。
-q 抑制定期的可读性输出。
-h / -v 显示帮助与版本信息。
参数后缀(Argument suffixes)
以“时间”为参数的选项,比如:-i, -P, -w。默认的单位为秒,也可以使用以下单位作为后缀(大小写不敏感):
us, usec microseconds (a millionth of a second, 1 / 1 000 000)
ms, msec milliseconds (a thousandth of a second, 1 / 1 0[……]

READ MORE

「IOTop」

IOTop,一个Python程序,其UI,用于显示I类似top命令,可以列出当前执行I/O的进程。
Homepage: http://guichaz.free.fr/iotop/
安装方法
Ubuntu 16.04.2 LTS

apt-get install iotop

源码编译安装
查看源码目录下的 README 文件。
程序文件
iotop UI类似于top命令的I/O监控工具。该程序是一个Python脚本,如果使用的是源码编译安装,那程序文件可能是iotop.py。[……]

READ MORE

「iotop」- 简单的、类似与 top 命令的 I/O 监控程序

常用命令
语法格式

iotop [OPTIONS]

命令描述
iotop 用于监视 Linux Kernel(>= 2.6.20)输出的 I/O 使用情况信息,并显示系统中进程或线程的当前 I/O 使用情况的表格。在 Linux Kernel 构建配置中,至少需要启用 CONFIG_TASK_DELAY_ACCT,CONFIG_TASK_IO_ACCOUNTING,CONFIG_TASKSTATS,CONFIG_VM_EVENT_COUNTERS 这几个选项。
在采样期间,iotop 显示由每个进程/线程读和写的 I/O 带宽的列,它还显示线程/进程在交换和等待I/O时花费的时间百分比。对于每个进程,还显示其 I/O 优先级(class/level)。
此外,在采样周期内,读取和写入的总 I/O 带宽显示在UI的顶部。Total DISK READ 和 Total DISK WRITE 值表示进程和核线程和内核块设备子系统之间的总读取和写入带宽。而 Actual DISK READ 和 Actual DISK WRITE 表示内核块设备子系统和底层硬件(HDD,SSD 等)之间的实际磁盘 I/O 的相应带宽。因此,由于数据缓存和在 Linux Kernel 中进行的 I/O 操作重新排序,Total 和 Actual 值在任何给定的时间可能并不相等。
使用左箭头和右箭头改变排序,r 进行反向排序,o 用于 –only 选项的切换,p 用于 –processes 选项的切换,a 用于 –accumulated 选项的切换,q 用于退出,i 用于修改线程或者进程的线程的优先级,其他的任何键用于刷新。
命令选项
-o, –only 只显示正在进行 IO 的进程或者线程的信息,默认显示全部的。使用o键进行切换。
-P, –processes 只显示进程。通常情况下,显示所有的线程。
-p PID, –pid=PID 指定要监控的PID,默认是全部的。如果要监控多个PID,可以通过多次使用该参数。
-u USER, –user=USER 要监控的用户,默认为全部的。如果要监控多个用户,可以多次使用该参数。
-a, –accumulated 显示累计I/O,而不是默认的带宽。在这种模式下,显示的IO进程累计是从iotop启动开始的。
-k, –kilobytes 以kilobyte(1000 byte)为单位。对iotop的批处理模式使用脚本时,此模式很有用。iotop将以千字节显示所有大小,而不是选择最合适的单元。
非交互模式类选项
-b, –batch 进入非交互模式,循环的输出IO使用情况。记录随着时间的推移IO的使用[……]

READ MORE

「ipcalc」

ipcalc
参考文献

IP Calculator

章节列表
「ipcalc(1)」-[……]

READ MORE

「iproute2」

IPRoute2,该软件包包含基于基础IPV4和高级网络的程序。
命令列表及功能
bridge Configures network bridges
ctstat Connection status utility
genl Generic netlink utility frontend
ifcfg A shell script wrapper for the ip command.
Note that it requires the arping and rdisk programs from the iputils package found at http://www.skbuff.net/iputils/
ifstat Shows the interface statistics, including the amount of transmitted and received packets by interface
ip The main executable. It has several different functions:

ip link <device> allows users to look at the state of devices and to make changes
ip addr allows users to look at addresses and their properties, add new addresses, and delete old ones
ip neighbor allows users to look at neighbor bindings and their properties, add new neighbor entries, and delete old ones
ip rule allows users to look at the routing policies and change them
ip route allows users to look at the routing table and change routing table rules
ip tunnel allows users to look at the IP tunnels and their properties, and change them
ip maddr allows users to look at the multicast addresses and their properties, and change them
ip mroute a[……]

READ MORE

「arpd(8)」-

用户空间的ARP守护进程
命令语法格式
arpd [ -lkh? ] [ -a N ] [ -b dbase ] [ -B number ] [ -f file ] [-p interval ] [ -n time ] [ -R rate ] [ <INTERFACES> ]
命令描述
守护程序arpd收集免费ARP信息,将其保存在本地磁盘上并根据需要将其提供给内核,以避免由于内核ARP缓存的大小有限而导致冗余广播。
命令支持的选项及含义
-l 将arpd数据库转储到标准输出,并退出。输出由三列组成:接口索引、接口的IP地址、接口的MAC地址。还显示了死主机的否定条目,在这种情况下,MAC地址被替换为单词FAILED后跟冒号,以及最近的时间(证明主机已经死亡的事实)。
-f <FILE> 以类似于-l选项转储的文本格式,从FILE读取并加载arpd数据库。加载后退出,如果还给出了-l选项,可能列出结果数据库。 如果FILE是“-”,则读取标准输入以获取ARP表。
-b <DATABASE> 数据库文件的位置。 默认位置是/var/lib/arpd/arpd.db
-a <NUMBER> 使用此选项,arpd不仅可以被动地侦听接口上的ARP数据包,还可以自己发送广播查询。参数NUMBER是在目标被视为死亡之前要进行的此类查询的数量。当arpd没有此选项并作为内核帮助程序启动时(即在sysctl中启用app_solicit,或甚至使用选项-k),并且仍然没有获得足够的信息,您可以观察到1秒的服务缺口。不是致命的,但并不好。
-k 禁止内核发送广播查询。 此选项仅与选项-a一起使用。
-n <TIME> 指定负缓存的超时。 当解决方案失败时,arpd会抑制在此期间进一步尝试解决问题。 此选项仅与选项’-k’一起使用。 此超时不应超过不支持免费ARP的典型主机的启动时间。 默认值为60秒。
-p <TIME> 轮询尝试到内核ARP表之间等待的时间(以秒为单位)。 TIME可以是浮点数。 默认值为30。
-R <RATE> arpd每秒发送的最大稳定广播速率。 默认值为1。
-B <NUMBER> 由arpd连续发送的广播数量。 默认值为3。与-R选项一起使用此选项可确保在任何时间间隔T内广播的ARP查询数不超过B + R * T.
-h -? 打印帮助
<INTERFACES> 是要监视的网络接口的名称列表。 如果没有给出接口,arpd监视所有接口。 在这种情况下,arpd不调整sysctl参数,假设用户在arpd启动后自己执行此操作。
注[……]

READ MORE

「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[……]

READ MORE

「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.[……]

READ MORE

「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[……]

READ MORE

「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 创建文章[……]

READ MORE

「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[……]

READ MORE

「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.[……]

READ MORE

「nstat(8)」-

网络统计工具
命令描述
参考rtacct(8)命令。
参考文献

man 8 rtacct, Version 2007

更新日志

08/03/2018 创建文章[……]

READ MORE

「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 创建文章[……]

READ MORE

「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 创建文章[……]

READ MORE

「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 创建文章[……]

READ MORE

「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.[……]

READ MORE

「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 创建文章[……]

READ MORE

「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.[……]

READ MORE

「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[……]

READ MORE

「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[……]

READ MORE

「在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[……]

READ MORE

「ip6tables(8)」-

用于IPv4/IPv6数据包过滤和NAT的管理工具
命令描述
参考iptables(8)手册。
参考文献

man 8 iptables, Version 1.6.2-1.1

更新日志

10/30/2018 创建文章[……]

READ MORE