XX-net / XX-Net

A proxy tool to bypass GFW.
33.04k stars 7.69k forks source link

Install Miredo on macOS #8425

Open qingsheng0214 opened 6 years ago

qingsheng0214 commented 6 years ago

经过很长一段时间摸索,终于成功在macOS上(macOS Sierra Version 10.12.6)安装了Miredo,现在已试用一周,基本稳定,因此现在希望把这个经验分享给各位macOS的使用者,也希望各位能够帮助测试是否还有其它的问题(比如最新的macOS 10.13以上版本),最终使得macOS上miredo的使用更加完美。下面简单介绍一下具体步骤:

  1. Download & Install Tunnelblick (for signed tun purpose)

     https://tunnelblick.net/downloads.html
  2. Check whether has installed MacPorts & Execute the command below in Terminal

     port
  3. If not installed yet, Download & Install MacPorts

     https://www.macports.org/install.php
  4. Execute command & Install Miredo

      port search miredo
      sudo port install miredo
  5. Execute commands as below in Terminal & Check whether has loaded tun-signed kext

     kextstat | grep tun
  6. If exists, skip this step. If empty, Execute command & Try to load tun-signed.kext from Tunnelblick.app

    sudo kextload /Applications/Tunnelblick.app/Contents/Resources/tun-signed.kext
  7. Start up Miredo

    sudo miredo

  8. Check tun-signed.kext and Miredo again

     kextstat | grep tun
     ps aux | grep miredo

完成以上步骤,就可以使用Miredo了,关键点就在于Tunnelblick和MacPorts,如果还是不成功的话,各位还是要多摸索一下了。祝各位都能成功并使用顺利。

另: 当然,各位可以简单写一个脚本,在开机的时候使用root权限执行一下来启动Miredo,大概的脚本如下所示:

!/bin/bash

SIGNED_TUN_PATH=/Applications/Tunnelblick.app/Contents/Resources/

cd $SIGNED_TUN_PATH sudo kextload tun-signed.kext sudo miredo

wea76339 commented 6 years ago

@qingsheng0214 我想是teredo服务器不能用,网上能找到的都不能用,你能分享一个吗?如果可以的放在,我的邮箱是wea76339@gmail.com。谢谢。

qingsheng0214 commented 6 years ago

@iamqk 不错,赞!

qingsheng0214 commented 6 years ago

@wea76339 发送了一份到你邮箱了,查收一下!

qixiangcn commented 6 years ago

Tunnelblick需要一个配置文件,这个怎么弄啊?

wenlongGit commented 6 years ago

➜ sudo /opt/local/bin/port install miredo ---> Computing dependencies for miredo ---> Cleaning miredo ---> Scanning binaries for linking errors ---> No broken files found.

miredo 死活装不上,求指导呀

qixiangcn commented 6 years ago

@wenlongGit 你这个显示是装好了Mired啊。你可以运行 sudo miredo 了

如果还是不行,你需要检查tun/tap通道好没好。我之前就一直这个问题。

dalton-chiou commented 6 years ago

不太想装macport,但brew里没找到miredo。看网上介绍,brew里以前是有miredo的,现在没了?

lemondante commented 6 years ago

sudo miredo 显示command not found,但是应该已经安装好了啊

sudo port install miredo ---> Computing dependencies for miredo ---> Cleaning miredo ---> Scanning binaries for linking errors ---> No broken files found. 这应该是安装好的意思啊.

hzx505 commented 6 years ago

再试试楼主的方法看看。老是时好时坏

qingsheng0214 commented 6 years ago

@dalton-chiou 的确,我电脑上是有brew的,搜索发现找不到miredo,后来才偶然之间发现macPorts,然后搜索发现里面有miredo,而且版本是比较新的,所以就不得不安装了macPorts,这是目前最方便的一种安装miredo的方法

qingsheng0214 commented 6 years ago

@lemondante 已经装好的话,就直接sudo miredo就好了呀

fwjyttbtx commented 6 years ago

@lemondante macPorts安装的miredo在/opt/local/sbin下 cd到这个目录执行就好了 cd /opt/local/sbin sudo ./miredo

Einsteinford commented 6 years ago

这才是跟得上时代的Miredo,10.13.2成功,必须说明的是Tunnelblick并不需要启动和配置,仅仅用于加载tun-signed.kext,脚本保存为.sh文件,基本上就OK了,稍微比Linux配置麻烦些

BoneLiu commented 6 years ago

liuboendeMacBook-Pro:bin liuboen$ sudo miredo -f Dec 17 20:25:55 miredo[5690] : 启动中... Dec 17 20:26:07 miredo[5691] : Teredo 服务器无响应

qingsheng0214 commented 6 years ago

@BoneLiu 系统什么版本?貌似还没有人遇到这样的情况啊

violetcherry commented 6 years ago

请问一下; sudo kextload /Applications/Tunnelblick.app/Contents/Resources/tun-signed.kext 提示这个,应该如何处理 /Applications/Tunnelblick.app/Contents/Resources/tun-signed.kext failed to load - (libkern/kext) kext (kmod) start/stop routine failed; check the system/kernel logs for errors or try kextutil(8).

macOS 环境 Darwin localhost 15.0.0 Darwin Kernel Version 15.0.0: Wed Aug 26 16:57:32 PDT 2015; root:xnu-3247.1.106~1/RELEASE_X86_64 x86_64

qingsheng0214 commented 6 years ago

@violetcherry 上面的提示不是说了吗?可以使用kextutil来看看是什么问题,同时也可以看看system/kernel logs看看有什么问题没有

Einsteinford commented 6 years ago

@BoneLiu 关于服务器连接不上的,这个miredo所连接的teredo服务器可以更换为其它的 终端运行 sudo vim /etc/miredo.conf 按“i”进行插入操作 把文本修改为

# Miredo Configuration File
# Automatically generated from the miredo preference pane.
ServerAddress teredo.trex.fi
#ServerAddress teredo.remlab.net
RelayType autoclient
CommandDown killall -HUP lookupd DirectoryService
CommandUp killall -HUP lookupd DirectoryService

我仅仅隐藏了老服务器,添加了一行芬兰的服务器

然后按“esc” 退出修改操作 输入“:wq”保存并退出vim编辑器

然后在终端内“sudo pkill -9 miredo” 然后你自己再重新运行miredo

哦,有人可能vim命令运行不了,也可以用vi命令替代

qingsheng0214 commented 6 years ago

@Einsteinford 正解 👍

j1angvei commented 6 years ago

macOS 10.13.2按流程来正常使用。

radiumtan commented 6 years ago

下載不了Tunnelblick T.T

NSaylor commented 6 years ago

在这个基础上,实现了脚本开机自启动。 感兴趣的可以看下... https://www.jianshu.com/p/50f2c38c402a

xxnet commented 6 years ago

​能否做到启动脚本 start中? 这样启动时,判断是mac,就把miredo启动起来。

eljake58 commented 6 years ago

@qingsheng0214 到第5步,是直接再终端里输入kextstat | grep tun吗?输入后没有显示什么其他信息

wangyf123 commented 6 years ago

@hibluesea 杀掉miredo进程,miredo进程会自动重启,然后打开xx-net web管理界面,可以看到ipv6启动正常了,就没问题了。虽然miredo -f还是Resource busy,不过不影响使用的。 image

pstheresa commented 6 years ago

@Einsteinford 非常感谢

nicGithub commented 6 years ago

您好 我的sudo miredo -f 启动的时候报这个错误,能帮忙看下吗?是teredo服务器不可用吗?要是这个原因能发份地址给我吗@qingsheng0214

Mar 24 09:45:27 miredo[821] : Starting... Starting addrwatch... Mar 24 09:45:27 miredo[822] : Symmetric NAT detected. IPv6 connectivity will be limited. Mar 24 09:45:27 miredo[822] : Qualified (NAT type: restricted) Mar 24 09:45:27 miredo[822] : New Teredo address/MTU Mar 24 09:45:27 miredo[822] : Teredo pseudo-tunnel started Mar 24 09:45:27 miredo[822] : (address: 2001::53aa:64c:0:decc:c26a:f4d5, MTU: 1280) Mar 24 09:45:27 miredo[823] : Executing "killall -HUP lookupd DirectoryService". No matching processes were found Mar 24 09:45:27 miredo[823] : "killall -HUP lookupd DirectoryService" returned error code 256. Mar 24 09:46:09 miredo[822] : Lost Teredo connectivity Mar 24 09:46:09 miredo[823] : Executing "killall -HUP lookupd DirectoryService". No matching processes were found Mar 24 09:46:09 miredo[823] : "killall -HUP lookupd DirectoryService" returned error code 256. Mar 24 09:46:09 miredo[822] : Teredo pseudo-tunnel stopped Mar 24 09:46:09 miredo[822] : No reply from Teredo server

emiha commented 6 years ago

谁能解决一下 动不动就要杀掉进程 然后重启miredo啊- - Ubuntu和win都不用啊T T

Einsteinford commented 6 years ago

楼上,和楼上的楼上,同样都是因为远方Teredo服务器断线,无响应“No reply”,这个我真是解决不了,最近都因为在mac上获取不到ipv6地址(公司竟然有2个ip,不定时自动切换),都不用xx-net了

如果你们自己的公网ip地址是可ping的,并且相对稳定的,可以在https://tunnelbroker.net/ 进行一个Ipv4转ipv6的免费方案。因为前提要求比较高,想研究的就百度吧。

pstheresa commented 6 years ago

Mac10.13.2 Miredo很不稳定 绿灯用了一会儿就变黄灯了 改服务器又变绿灯 经常变黄 注意下去还能撑多久啊 不知道我顶不顶得住

AnyWAT commented 6 years ago

🤣参考?Windows 系统减小IP延时并保持稳定的做法: 从3.10.5版开始得关闭“自动调整扫描线程”,适当增大扫描线程上限为40-50(或自己调试),转换XX-Net版本、或IP延时变大网络卡顿,得手动检查IP。。。

archer-black commented 6 years ago

@emiha 碰到你一样的问题,用脚本简化流程吧 - -。

版本:macOS High Sierra version: 10.13.4.

通过使用 @qingsheng0214 (大赞😊) 的方法成功了,不过中间碰到一个问题就是电脑休眠后再次打开时链接会断掉需要重复之前步骤才能继续正常使用。 目前写了两个简单脚本来简化流程:

// run_xxnet.sh

`
#! /bin/bash
./Downloads/XX-Net-3.11.10/start
sudo kextload /Applications/Tunnelblick.app/Contents/Resources/tun-signed.kext
sudo miredo
kextstat | grep tun
ps aux | grep miredo
` 

// stop_xxnet.sh

`
#! /bin/bash
pkill -9 `lsof -i:8085`
sudo pkill -9 miredo
kextstat | grep tun
ps aux | grep miredo
`

感谢 @Einsteinford 看到他的回答才知道Tunnelblick不需要启动

两个脚本我放在 ~/ 目录下了

希望可以帮到遇到同样问题的朋友 😂

cv0cv0 commented 6 years ago

老版本能用的,是不是就不需要折腾了?

xxnet commented 6 years ago

​能用就不用折腾

noonchen commented 6 years ago

@iamqk 你好,我卡到kextload这一步了,本人macOS 10.13.5,sip也disable了。

我运行之后会提示以下错误:

/Applications/Tunnelblick.app/Contents/Resources/tun-signed.kext failed to load - (libkern/kext) kext (kmod) start/stop routine failed; check the system/kernel logs for errors or try kextutil(8).

请问你知道怎么解决吗? 现在miredo是绿灯,但是xxnet里面还是ipv6 fail,http://test-ipv6.com也找不到ipv6的地址,搞了一上午也没搞定。。

kgbook commented 6 years ago

osx 10.13.5 (17F77), 按照楼上操作,成功开启ipv6

xiyaoeva commented 6 years ago

卡在kextload这一步 运行之后提示错误 @Nochenon 解决了吗?

/Applications/Tunnelblick.app/Contents/Resources/tun-signed.kext failed to load - (libkern/kext) kext (kmod) start/stop routine failed; check the system/kernel logs for errors or try kextutil(8).

noonchen commented 6 years ago

@xiyaoeva 意外发现能用ipv6了,但是miredo是灰色的,既然能用就不管kextload错误了

kjyu commented 6 years ago

严格按步骤可以,但是似乎有点慢😆

xiyaoeva commented 6 years ago

@Nochenon @violetcherry 解决了kextload问题,是因为原先固有的tuntapox引起了无法设置,关掉tuntapox即可 tunnelbilck解释: This means that Tunnelblick was unable to load the tun and/or tap kexts (device drivers) it needs to make a VPN connection. Usually that is because there are incompatible kexts already loaded. Recent versions of Tunnelblick try to be "good citizens" by loading kexts only when needed, and unloading them when they are no longer needed. However, some other VPN clients (CiscoAnyConnect SSL VPN, for example) load their own, incompatible kexts when the computer is started and leave them loaded, whether or not a VPN connection is in use. (Some nonVPN software also loads incompatible kexts — for example, Pogoplug loads a "com.pogoplug.xcetun" tun kext which interferes with Tunnelblick's tun kext.) To find out if this is what is causing the problem, use the "kextstat" command in a Terminal window. It will list all of the loaded kexts. Usually the tun and/or tap kexts show up at or near the end of the list. Common tun/taps are: net.tunnelblick.tun and net.tunnelblick.tap: These are the kexts used by current versions of Tunnelblick. The appropriate one (tun or tap) is loaded when a connection is requested, and unloaded when it is disconnected. foo.tun and foo.tap: These are kexts for obsolete Cisco and Tunnelblick VPN clients (and some others), loaded when an older version of Tunnelblick is launched (and unloaded when the computer restarts). If Tunnelblick detects them, it will offer to unload them before connecting. com.cisco.cscotun: This is CiscoAnyConnect SSL VPN kext. Cisco's installer causes it to be loaded when the computer starts. But any nonApple kext with "tun" or "tap" in its name is likely to be causing the problem.

具体步骤 1-kextstat 2-页内查找tap 107 0 0xffffff7f80a2b000 0x7000 0x7000 net.sf.tuntaposx.tap (1.0) 23FDB7153D0D3A26ACBAE3794C231CB7 <7 5 4 1> 108 0 0xffffff7f80a21000 0x7000 0x7000 net.sf.tuntaposx.tun (1.0) 95DD963DE23D3B0F8DE8A4D2F6BFA5CC <7 5 4 1> 3-sudo kextunload -b net.sf.tuntaposx.tap(注意关闭时,不要开启miredo) sudo kextunload -b net.sf.tuntaposx.tun

mikelee1 commented 6 years ago

楼主,感谢你!!!!

a3512740 commented 6 years ago

Miredo 原来可以 现在一直是灰色不可用 是服务器关了么?

migilar commented 6 years ago

@qingsheng0214 我在安装miredo的过程中出现这个错误: Error: Checksum (md5) mismatch for Judy-1.0.5.tar.gz Error: Checksum (sha1) mismatch for Judy-1.0.5.tar.gz Error: Checksum (rmd160) mismatch for Judy-1.0.5.tar.gz Error: Failed to checksum judy: Unable to verify file checksums

请问是什么原因啊?我的系统是macOS high Sierra,谢谢。

migilar commented 6 years ago

已经用安装包成功安装miredo了:http://www.deepdarc.com/miredo-osx-prerelease2.pkg.zip

之前安装不了是因为没有关闭System Integrity Protection (SIP)系统完整性保护功能,按这个操作把SIP功能关闭之后就能成功安装了:

shenguanjiejie commented 6 years ago

macOS 10.14 MacPorts不支持, 这可咋整...

koolwiki commented 6 years ago

我来试试!

zhilidali commented 6 years ago

安装 miredo 时,tuntaposx build failed,怎么办?即使手动安装 tuntaposx 还是会走这一步

sudo /opt/local/bin/port install miredo ---> Computing dependencies for miredo The following dependencies will be installed: gettext judy libiconv ncurses tuntaposx xz Continue? [Y/n]: y ---> Fetching archive for judy ---> Attempting to fetch judy-1.0.5_1.darwin_18.x86_64.tbz2 from https://packages.macports.org/judy ---> Attempting to fetch judy-1.0.5_1.darwin_18.x86_64.tbz2.rmd160 from https://packages.macports.org/judy ---> Installing judy @1.0.5_1 ---> Activating judy @1.0.5_1 ---> Cleaning judy ---> Fetching archive for tuntaposx ---> Attempting to fetch tuntaposx-20150118_0.darwin_18.x86_64.tbz2 from https://packages.macports.org/tuntaposx ---> Attempting to fetch tuntaposx-20150118_0.darwin_18.x86_64.tbz2 from http://fco.it.packages.macports.org/mirrors/macports-packages/tuntaposx ---> Attempting to fetch tuntaposx-20150118_0.darwin_18.x86_64.tbz2 from http://jnb.za.packages.macports.org/packages/tuntaposx ---> Fetching distfiles for tuntaposx ---> Attempting to fetch tuntap_20150118_src.tar.gz from https://ayera.dl.sourceforge.net/project/tuntaposx/tuntap/20150118 ---> Verifying checksums for tuntaposx ---> Extracting tuntaposx ---> Applying patches to tuntaposx ---> Configuring tuntaposx ---> Building tuntaposx Error: Failed to build tuntaposx: command execution failed Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_tuntaposx/tuntaposx/main.log for details. Error: Follow https://guide.macports.org/#project.tickets to report a bug. Error: Processing of port miredo failed

normanjid commented 5 years ago

安装 miredo 时,tuntaposx build failed,怎么办?即使手动安装 tuntaposx 还是会走这一步

sudo /opt/local/bin/port install miredo ---> Computing dependencies for miredo The following dependencies will be installed: gettext judy libiconv ncurses tuntaposx xz Continue? [Y/n]: y ---> Fetching archive for judy ---> Attempting to fetch judy-1.0.5_1.darwin_18.x86_64.tbz2 from https://packages.macports.org/judy ---> Attempting to fetch judy-1.0.5_1.darwin_18.x86_64.tbz2.rmd160 from https://packages.macports.org/judy ---> Installing judy @1.0.5_1 ---> Activating judy @1.0.5_1 ---> Cleaning judy ---> Fetching archive for tuntaposx ---> Attempting to fetch tuntaposx-20150118_0.darwin_18.x86_64.tbz2 from https://packages.macports.org/tuntaposx ---> Attempting to fetch tuntaposx-20150118_0.darwin_18.x86_64.tbz2 from http://fco.it.packages.macports.org/mirrors/macports-packages/tuntaposx ---> Attempting to fetch tuntaposx-20150118_0.darwin_18.x86_64.tbz2 from http://jnb.za.packages.macports.org/packages/tuntaposx ---> Fetching distfiles for tuntaposx ---> Attempting to fetch tuntap_20150118_src.tar.gz from https://ayera.dl.sourceforge.net/project/tuntaposx/tuntap/20150118 ---> Verifying checksums for tuntaposx ---> Extracting tuntaposx ---> Applying patches to tuntaposx ---> Configuring tuntaposx ---> Building tuntaposx Error: Failed to build tuntaposx: command execution failed Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_tuntaposx/tuntaposx/main.log for details. Error: Follow https://guide.macports.org/#project.tickets to report a bug. Error: Processing of port miredo failed

同样情况,解决了么?

zhilidali commented 5 years ago

@normanjid 没有解决,一直困扰着我。 我的另一台就没有这个问题,不晓得是否与 mojave 不兼容导致,我从 sierra(已成功安装miredo) 升级到 mojave 的没有问题 而重装 mojave 的这台机器,在装 tuntaposx 时 一直存在此问题

jasonzwf commented 5 years ago

@zhilidali 在终端下执行命令: sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Kernel.framework/Headers /System/Library/Frameworks/Kernel.framework/Headers 然后重新安装