mknod /dev/hitbox c 62 0
mknod /dev/nistnet c 62 1
chown root /dev/hitbox
chown root /dev/nistnet
mknod /dev/mungebox c 63 0
chown root /dev/mungebox
mknod /dev/spybox c 64 0
chown root /dev/spybox
modprobe nistnet可以将这个放到/etc/rc.local中,以便重启后继续可以使用例如:[root@nist-01 ~]# more /etc/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.touch /var/lock/subsys/local
/etc/init.d/Load.Nistnet
mknod /dev/hitbox c 62 0
mknod /dev/nistnet c 62 1
chown root /dev/hitbox
chown root /dev/nistnet
mknod /dev/mungebox c 63 0
chown root /dev/mungebox
mknod /dev/spybox c 64 0
chown root /dev/spybox
modprobe nistnet【使用】延迟命令使用:[root@nist-01 2.6.9-42.ELsmp]# cnistnet -G
Emulator is: Off
Average processed packet overhead 0 usec
Average unprocessed packet overhead 0 usec
Average hash tries 0
[root@nist-01 2.6.9-42.ELsmp]# cnistnet -a 0.0.0.0 0.0.0.0 --delay 80 0
addnistnet: 0.0.0.0:0 to 0.0.0.0:0 (prot 0 cos 0),
delay 80.000000 (sigma 0.000000 corr 0.000000),
bandwidth 0, drop 0.000000 (corr 0.000000),
dup 0.000000 (corr 0.000000),
drdmin 0, drdmax 0, drdcongest 0
[root@nist-01 2.6.9-42.ELsmp]# cnistnet -u
[root@nist-01 2.6.9-42.ELsmp]# cnistnet -G
Emulator is: On
Average processed packet overhead 3 usec
Average unprocessed packet overhead 0 usec
Average hash tries 0说明,参数80表示延迟80ms,0表示浮动区间加入想实现网段-网段的延迟,可以将一端改为特定的网段(默认以0为mask),比如目的是192.168.1.0/24网段的包全部延迟 30mscnistnet -u -a 0.0.0.0 192.168.1.0 --delay 30 0注意,这里如果源也要固定到一个网段,比如想要192.168.2.0/24到192.168.1.0/24, 这样子的话就没法做了cnistnet -u -a 192.168.2.0 192.168.1.0 --delay 30 0这样是不起作用的,只有在一端是0.0.0.0的时候,nistnet才会认为是在处理网段。【效果】