Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/196.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/117.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 将Mac设置为wifi热点以运行移动宽带测试用例_Android_Ios_Throttling_Bandwidth Throttling_Ipfw - Fatal编程技术网

Android 将Mac设置为wifi热点以运行移动宽带测试用例

Android 将Mac设置为wifi热点以运行移动宽带测试用例,android,ios,throttling,bandwidth-throttling,ipfw,Android,Ios,Throttling,Bandwidth Throttling,Ipfw,我需要建立一个环境,在那里我可以为没有移动数据计划的iOS和Android设备模拟移动网络互联网连接。我在想,我可以用我的MAC设置一个wifi热点,然后用ipfw限制数据连接以模拟3G网络。我已经设法通过系统首选项中的“Internet共享”设置设置了MAC。我可以很好地连接iPhone4和三星Galaxy S3,并且可以毫无问题地打开网页。然而,我在ipfw方面遇到了麻烦。我编写了一个linux脚本来设置管道,但是当我运行这个程序时,我的智能手机就不能再连接到互联网了。我认为这可能是一个路由

我需要建立一个环境,在那里我可以为没有移动数据计划的iOS和Android设备模拟移动网络互联网连接。我在想,我可以用我的MAC设置一个wifi热点,然后用ipfw限制数据连接以模拟3G网络。我已经设法通过系统首选项中的“Internet共享”设置设置了MAC。我可以很好地连接iPhone4和三星Galaxy S3,并且可以毫无问题地打开网页。然而,我在ipfw方面遇到了麻烦。我编写了一个linux脚本来设置管道,但是当我运行这个程序时,我的智能手机就不能再连接到互联网了。我认为这可能是一个路由问题,但我不确定我遗漏了什么。下面是我的脚本的样子:

ipfw del pipe 1
ipfw del pipe 2
ipfw -q -f flush
ipfw -q -f pipe flush

BW_DOWN=780
[ ! -z $1 ] && BW_DOWN=$1

BW_UP=330
[ ! -z $2 ] && BW_UP=$2

if [ "$1" == "off" ]; then
        echo "disabling BW limit"
        exit
else
        echo "Download = ${BW_DOWN}KByte/s, Upload = ${BW_UP}KByte/s"
        ipfw add pipe 1 ip from any to any
        ipfw add pipe 2 ip from any to any
        ipfw pipe 1 config bw ${BW_DOWN}KByte/s
        ipfw pipe 2 config bw ${BW_UP}KByte/s
fi
有什么想法吗