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才會認為是在處理網段。【效果】