不使用Mac机器网络使用iPhone网络搭建ipv6测试环境(cocos2dx项目苹果审核支持ipv6处理一)

不使用Mac机器网络使用iPhone网络搭建ipv6测试环境
1.正常使用Mac机器搭建ipv6的网络环境步骤简单,需要注意的是Mac需要有线连网,不能wi-fi入网,否则创建共享网络没有创建NAT64选项
2.第一种方式如果机器所在网络不支持ipv6协议,可能会出现模拟的ipv6环境不能正常测试,亲自趟过坑。游戏Socket对ipv4/ipv6处理没有问题,但就是在第一种方式创建的ipv6环境下无法正常登陆服务器。第二种以iphone数据流量创建,当然环境还是依靠Mac机器。手机是无法创建ipv6环境的。ps:检测所在网络对ipv4/ipv6协议的支持可以进http://ipv6.sjtu.edu.cn 

如下:

第一步:通过数据线连接iphone和mac

第二步:打开iphone的个人热点并选择仅USB

如果没有选项,请关闭手机连接的Wi-Fi,用手机自己的移动网络

id="iframe_0.9325067354366183" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://cc.cocimg.com/api/uploads/20160612/1465723782342605.png?_=5600389%22%20style=%22border:none;max-width:690px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.9325067354366183',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="margin: 0px; padding: 0px; border-style: none; width: 321px; height: 569px;">

选择仅USB

第三步:打开网络偏好设置,确保你的Mac的Wi-Fi是打开的,并且没有连接任何网络

如果已有连接wifi可以在高级里删除之前的联网缓存

id="iframe_0.637368144467473" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://cc.cocimg.com/api/uploads/20160612/1465723789771115.png?_=5600389%22%20style=%22border:none;max-width:690px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.637368144467473',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="margin: 0px; padding: 0px; border-style: none; width: 460px; height: 329px;">

第四步:打开系统偏好设置,按住option(alt)键点击共享

如果不按住option键将不会出现ipv6选项

id="iframe_0.07203403161838651" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://cc.cocimg.com/api/uploads/20160612/1465723796979042.png?_=5600389%22%20style=%22border:none;max-width:690px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.07203403161838651',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="margin: 0px; padding: 0px; border-style: none; width: 597px; height: 528px;">

第五步:选择iPhone USB -> Wi-Fi -> 创建NAT64

如果没有出现创建NAT64网络请重复第四步

id="iframe_0.40763975912705064" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://cc.cocimg.com/api/uploads/20160612/1465723804188989.png?_=5600389%22%20style=%22border:none;max-width:690px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.40763975912705064',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="margin: 0px; padding: 0px; border-style: none; width: 463px; height: 329px;">

第六步:选择右下角的Wi-Fi选项,可以设置密码也可以不设置密码


最后别忘了勾选左侧的选项,不然不会打开共享,显示互联网共享:打开代表操作成功

id="iframe_0.5593513923231512" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://cc.cocimg.com/api/uploads/20160612/1465723823540620.png?_=5600389%22%20style=%22border:none;max-width:690px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.5593513923231512',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="margin: 0px; padding: 0px; border-style: none; width: 601px; height: 373px;">

勾选互联网共享

用你另一台iPhone链接你Mac所创建的IPv6测试网络

id="iframe_0.2774321411270648" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://cc.cocimg.com/api/uploads/20160612/1465723832944875.png?_=5600389%22%20style=%22border:none;max-width:690px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.2774321411270648',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="margin: 0px; padding: 0px; border-style: none; width: 321px; height: 571px;">

如果你的DNS如上图所示的格式一样的话就代表你的ipv6测试环境已经搭建好了,可以开始测试你的项目了


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值