微型電腦
Linux
從 /proc/net/dev 去截取資料來運算。
[root@ip069 ~]# cat /proc/net/dev
Inter-| Receive | Transmit
face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
lo:55684135 25897 0 0 0 0 0 0 55684135 25897 0 0 0 0 0 0
eth0:1439346272 9461893 0 0 82 0 0 0 904668828 3744265 0 0 0 0 0 0
eth1: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
sit0: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
virbr0: 0 0 0 0 0 0 0 0 9208 42 0 0 0 0 0 0
FreeBSD 監看即時流量可用以下指令:
# netstat -ibd -I bce0 1
input (bce0) output
packets errs bytes packets errs bytes colls drops
9 0 894 3 0 1486 0 0
11 0 942 2 0 388 0 0
5 0 879 2 0 356 0 0
方法一:
重開機後也跟著修改的方法。
在/etc/sysconfig/network-scripts/ifcfg-eth0中加入
MACADDR=00:0A:EC:EB:93:3C
方法二:
ifconfig eth0 down
ifconfig eth0 hw ether 00:12:34:56:78:90
ifconfig eth0 up