在MacOSX上使用ipfw模拟丢包

freeswitch mac

Mon Nov 30 01:14:30 -0800 2009

今天测试FreeSWITCH录音,需要在MacOSX上模拟丢包的环境,就写了一个简单的脚本。需要说明,由于UDP会有自动重发的机制,因此只有丢包率超过一定比例才会真正发生丢包。

#!/bin/sh

trap "ipfw delete 02000" EXIT
while :; do
        echo deny
        ipfw add 02000 deny udp from 192.168.1.21 to any in

        sleep 3

        echo allow
        ipfw delete 02000
        sleep 2
done

参考:http://www.ibiblio.org/macsupport/ipfw/


本文地址:http://www.dujinfang.com/past/2009/11/30/zai-macosxshang-shi-yong-ipfwmo-ni-diu-bao/
短地址:

-------------------------------------------------------------------------------------------
给我留言 | Leave a comment
------ ^_^ ------------------------------------------------------------------------7-------

名字|Your Name *required

邮件|Your Email *required but won't show

网站|Your Website -optional

空白|Blank Leave me blank if you are a live person

留言|Comment