Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install Miredo on macOS #8425

Open
qingsheng0214 opened this issue Nov 17, 2017 · 126 comments
Open

Install Miredo on macOS #8425

qingsheng0214 opened this issue Nov 17, 2017 · 126 comments

Comments

@qingsheng0214
Copy link

qingsheng0214 commented Nov 17, 2017

经过很长一段时间摸索,终于成功在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

@jinde-liu
Copy link

有效,而且不需要关闭苹果的sip

@tongchow
Copy link

tongchow commented Nov 17, 2017

到第七步输入sudo miredo后似乎会出现:
Cannot create PID file /opt/local/var/run/miredo.pid:
Resource temporarily unavailable
Please make sure another instance of the program is not already running.

@qingsheng0214
Copy link
Author

@dlzdyl 使用ps aux | grep miredo看看是不是miredo已经启动了,一般正常启动之后有三个pid及相应的进程,如下图所示。正常启动之后就不用再次sudo miredo来启动Miredo了;如果想结束之前启动的Miredo,可以使用sudo pkill -9 miredo命令完成,再次启动Miredo,就使用sudo miredo就可以了。
miredo

@JoelynZhou
Copy link

执行port提示command not found

@subcrew
Copy link

subcrew commented Nov 18, 2017

@JoelynZhou /opt/local/bin/port

@iamqk
Copy link

iamqk commented Nov 19, 2017

macOS high Sierra
sudo kextload /Applications/Tunnelblick.app/Contents/Resources/tun-signed.kext
这个步骤会有问题
在 系统偏好设置- 安全与隐私 - 允许 一下就好了

@liamlee
Copy link

liamlee commented Nov 19, 2017

终于可以了

@felixsiu
Copy link

@qingsheng0214 干货,感谢楼主,macos 10.11.6 可以安装,但是xx-net ipv6 status 还是fail。
相同网络条件下win10 ipv6没有问题。
terminal 执行 sudo miredo -f 强制前台运行,显示错误如下:
sudo miredo -f
Nov 19 10:46:37 miredo[967] : 启动中...
dyld: lazy symbol binding failed: Symbol not found: _clock_gettime
Referenced from: /opt/local/lib/libteredo.5.dylib
Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _clock_gettime
Referenced from: /opt/local/lib/libteredo.5.dylib
Expected in: /usr/lib/libSystem.B.dylib

不知道具体是什么问题?
查了miredo 的文档,也找不到其他显示状态的方法。请楼主赐教。

@maarxv
Copy link

maarxv commented Nov 19, 2017

可以啦,谢谢楼主

@subcrew
Copy link

subcrew commented Nov 19, 2017

macOS 10.13.1, tun0能获取到2001开头ipv6地址,但是xx-net ipv6 status fail,哪位知道这是什么原因吗,🙏

Test with IPv4 DNS record   ok (0.693s) using ipv4
Test with IPv6 DNS record   timeout (15.017s)
Test with Dual Stack DNS record   ok (0.866s) using ipv4
Test for Dual Stack DNS and large packet   ok (0.458s) using ipv4
Test IPv4 without DNS   ok (0.421s) using ipv4
Test IPv6 without DNS   timeout (15.011s)
Test IPv6 large packet   timeout (15.022s)
Test if your ISP's DNS server uses IPv6   ok (1.788s) using ipv4
Find IPv4 Service Provider   ok (0.847s) using ipv4 ASN 4134
Find IPv6 Service Provider   timeout (15.086s)

@onplus
Copy link
Collaborator

onplus commented Nov 19, 2017

@gwanii ipv6.test-ipv6.com

@felixsiu
Copy link

miredo 我重新安装了一遍,现在可以正常使用,为免少走弯路 ,建议port里面安装miredo前做以下:
1.安装 xcode command line tools:terminal内运行xcode-select --install
2.ports 先升级一下index:sudo port selfupdate
3.sudo miredo 后看是否成功 可以 运行ifconfig | grep tun0 ,如果看到有返回证明tun0虚拟网卡运行正常。

系统:10.11.6,xx-net:3.8.0

@wea76339
Copy link

10.13.1 安装后,xx-net仍然IPv6 Status为fail 求助
启动miredo终端显示如下:
bash-3.2# sudo miredo
bash-3.2# kextstat | grep tun
162 0 0xffffff7f80f93000 0x7000 0x7000 net.sf.tuntaposx.tun (1.0) 95DD963D-E23D-3B0F-8DE8-A4D2F6BFA5CC <7 5 4 1>
166 0 0xffffff7f80c36000 0x7000 0x7000 net.sf.tuntaposx.tap (1.0) 23FDB715-3D0D-3A26-ACBA-E3794C231CB7 <7 5 4 1>
bash-3.2# ps aux | grep miredo
root 250 0.0 0.0 655136 432 ?? S< 6:14下午 0:00.00 /usr/sbin/miredo --foreground -c /etc/miredo.conf
nobody 249 0.0 0.0 663176 1176 ?? S< 6:14下午 0:00.01 /usr/sbin/miredo --foreground -c /etc/miredo.conf
root 73 0.0 0.0 630816 2632 ?? S<s 6:14下午 0:00.08 /usr/sbin/miredo --foreground -c /etc/miredo.conf
root 624 0.0 0.0 4276984 920 s000 S+ 6:16下午 0:00.00 grep miredo
root 602 0.0 0.0 4288672 4556 ?? S 6:16下午 0:00.01 /opt/local/libexec/miredo/miredo-privproc F
miredo 601 0.0 0.0 4327488 1008 ?? S 6:16下午 0:00.48 miredo
root 600 0.0 0.0 4315128 1860 ?? Ss 6:16下午 0:00.01 miredo
bash-3.2#

@wea76339
Copy link

补充xx-net版本3.8.1。用老版本结果相同。宽带为移动宽带。

@qingsheng0214
Copy link
Author

@wea76339 test-ipv6.com测试一下,另外在miredo.conf中换一下teredo服务器并重启miredo多试一下

@wea76339
Copy link

@qingsheng0214 test-ipv6.com测试结果:没有检测到您的 IPv6 地址。该怎么办?这和移动宽带有关系吗?

@qingsheng0214
Copy link
Author

@wea76339 可能有关系可能没有关系,不过我知道移动宽带是能够使用的,建议换换teredo服务器多尝试一下,应该能够稳定使用的

@wea76339
Copy link

@qingsheng0214 找了一些服务器,还是不行。不知该怎么办了

@wea76339
Copy link

@qingsheng0214 终于可以了,用@felixsiu的顺序,就可以,真奇怪。谢谢你们!!!!!!!

@wea76339
Copy link

@qingsheng0214 只好一下子,接下来马上又不行。想重装,请问如何在终端卸载miredo呢?安装时显示:Warning: xcodebuild exists but failed to execute
Warning: Xcode does not appear to be installed; most ports will likely fail to build.
---> Computing dependencies for miredo
---> Cleaning miredo
---> Scanning binaries for linking errors
---> No broken files found.

@qingsheng0214
Copy link
Author

@wea76339 应该不需要重装,还是换个好用一点的teredo服务器应该就没有问题

@wea76339
Copy link

@qingsheng0214 默认服务器和芬兰的服务器能ping通,但还是不行。其它的服务器都ping不通。

@hibluesea
Copy link

运行sudo miredo 返回
Error: cannot open device file /dev/tun0 (Resource busy)
IPv6 tunneling will not work.
miredo面板一直显示黄灯,有人遇到过吗?

@wea76339
Copy link

还是不成功,这是什么意思?
bash-3.2# sudo miredo -f
Nov 23 08:56:56 miredo[7587] : 启动中...
Nov 23 08:56:56 miredo[7588] : 新 Teredo 地址/MTU
Nov 23 08:56:56 miredo[7588] : Teredo 虚假隧道已启动
Nov 23 08:56:56 miredo[7588] : (地址:2001::53aa:64c:c7d:efc9:8fcc:c468,MTU:1280)
route: writing to routing socket: not in table
delete net default: not in table
add net default: gateway tun1
Nov 23 08:56:56 miredo[7588] : Internal IPv4 address: 192.168.0.103
Nov 23 08:56:56 miredo[7588] : packet passed to maintenance procedure
Nov 23 08:57:26 miredo[7588] : packet passed to maintenance procedure

@OriTheElf
Copy link

Finally,it worked!👍

@qingsheng0214
Copy link
Author

@hibluesea 你是通过不同方式安装了两次miredo吗?通过MacPorts安装的应该不会在面板中显示的,建议卸载其中之一

@qingsheng0214
Copy link
Author

@wea76339 ping不ping得通关系不大,主要需要看test-ipv6.com是否能够通过测试

@qingsheng0214
Copy link
Author

@wea76339 没有遇到过这种情况,我也不清楚,抱歉

@wea76339
Copy link

@qingsheng0214 哦。还是谢谢你。现在还不清楚是不是我这边的移动网络的问题,改天用电信的试试。

@qhxzgl2006
Copy link

终于成功了,感谢楼主。

@normanjid
Copy link

安装 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
Copy link

zhilidali commented Oct 29, 2018

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

@jasonzwf
Copy link

jasonzwf commented Nov 1, 2018

@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
然后重新安装

@zhilidali
Copy link

@jasonzwf 万分感谢,已成功

@HelloJacky
Copy link

sudo port install miredo 报错

Error: Unable to open port: couldn't change working directory to "/opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/net/miredo": no such file or directory

系统:10.14

求解答!谢谢

@dnzng
Copy link

dnzng commented Nov 6, 2018

@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
然后重新安装

ln: /System/Library/Frameworks/Kernel.framework/Headers: Operation not permitted
执行后出现这个,请问怎么解决?

@xiaodongxing
Copy link

miredo一直是红灯是为什么

@j2cms
Copy link

j2cms commented Nov 18, 2018

@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
然后重新安装

ln: /System/Library/Frameworks/Kernel.framework/Headers: Operation not permitted
执行后出现这个,请问怎么解决?

我也遇到这个问题,请问你解决了吗?

@j2cms
Copy link

j2cms commented Nov 18, 2018

@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
然后重新安装

ln: /System/Library/Frameworks/Kernel.framework/Headers: Operation not permitted
执行后出现这个,请问怎么解决?

我也遇到这个问题,请问你解决了吗?

我解决了 ,还是要先 csrutil disable

El Capitan now protects certain system directories in "rootless" mode (a.k.a. System Integrity Protection). If you run the command ls -lO /System/Library/LaunchDaemons you'll see that the directories and files under there are now marked as "restricted."

You can disable rootless mode like this:

Reboot into recovery mode (reboot and hold down Cmd-R)
Open a terminal
Use this command: csrutil disable
Reboot and run the command that worked prior to El Capitan
When you're done, it is highly recommended that you re-enable SIP by following the same steps, but using csrutil enable in step 3.

@j2cms
Copy link

j2cms commented Nov 18, 2018

有效,而且不需要关闭苹果的sip

还是要先 csrutil disable

@a3512740
Copy link

有效,而且不需要关闭苹果的sip

export PATH=/opt/local/bin:/opt/local/sbin:$PATH
设置下环境变量就可以了

@wjain
Copy link

wjain commented Jan 5, 2019

终于搞定了,虽然系统偏好里面没有Miredo,但是ipv6可以用了

@gerogelin
Copy link

osx 10.14.1 xx-net 3.13.1
有没有人遇到这样的问题啊:
按照wiki里面的教程进行了安装,pkg都成功安装
kextstat | grep tun
ps aux | grep miredo
这两个也都有输出
系统偏好里面没有miredo
ipv6也ping不通

感激不尽

@easonlv
Copy link

easonlv commented Jan 27, 2019

Miredo一直是红灯,肿么办

@AnyWAT
Copy link

AnyWAT commented Feb 28, 2019

更换服务器(IP)。。。😂来自另类系统:#12043

@718MGQ
Copy link

718MGQ commented Mar 16, 2019

osx 10.14.1 xx-net 3.13.1
有没有人遇到这样的问题啊:
按照wiki里面的教程进行了安装,pkg都成功安装
kextstat | grep tun
ps aux | grep miredo
这两个也都有输出
系统偏好里面没有miredo
ipv6也ping不通

感激不尽

+1

@MarkWong87
Copy link

按wiki安装成功并启动,也可以访问google了,但是过不了多久就不行了,重启下命令有事好使,有时不行,这是怎么回事

@AnyWAT
Copy link

AnyWAT commented Apr 12, 2019

参考:#12455

@stupidsongshu
Copy link

sudo kextload /Applications/Tunnelblick.app/Contents/Resources/tun-signed.kext
执行上面的命令后报错提示:
/Applications/Tunnelblick.app/Contents/Resources/tun-signed.kext failed to load - (libkern/kext) not found; check the system/kernel logs for errors or try kextutil(8).

查看了Tunnelblick(Tunnelblick_3.8.1beta01_build_5380.dmg)安装包,Contents/Resources 目录下没有 tun-signed.kext, 扩展名为kext的只有 tun-notarized.kexttap-notarized.kext 两个。

Tunnelblick安装前用gpg的验证结果是:

gpg: 签名建立于 六  7/20 01:40:52 2019 CST
gpg:               使用 RSA 密钥 B4D96F0D6A58E335A0F4923A2FF3A2B2DC6FD12C
gpg: 完好的签名,来自于 “Tunnelblick Security <tunnelblicksecurity@protonmail.com>” [未知]
gpg: 警告:此密钥未被受信任签名认证!
gpg:       没有证据表明此签名属于其声称的所有者。
主密钥指纹: 76DF 975A 1C56 4277 4FB0  9868 FF5F D80E 6BB9 367E
     子密钥指纹: B4D9 6F0D 6A58 E335 A0F4  923A 2FF3 A2B2 DC6F D12C

试了很久,不知道是哪里的问题了。

@greeniecoder
Copy link

miredo装好了,ps aux 也看到进程正常启动了。
但是在系统偏好里面没有,没有办法看什么黄灯绿灯的。
这么明显的问题,没有人提过?10.14.2的版本。

@tw93
Copy link

tw93 commented Feb 9, 2020

miredo装好了,ps aux 也看到进程正常启动了。
但是在系统偏好里面没有,没有办法看什么黄灯绿灯的。
这么明显的问题,没有人提过?10.14.2的版本。

+1

@hzx505
Copy link

hzx505 commented Apr 4, 2020

运行 sudo miredo
sudo: unable to execute /usr/sbin/miredo: Bad CPU type in executable
---------查到 如下资料
我了解到目前您的 Mac 更新至 macOS Catalina 后安装应用程序提示“bad CPU type in executable“。目前,Apple 现已完成向 64 位技术的过渡。从 macOS Catalina 开始,32 位 App 不再与 macOS 兼容

是不是 在 10.15.3 系统 miredo 是32位应用 无法使用?

@littlen9ne
Copy link

littlen9ne commented Jul 17, 2020

tunnleblick可以使用homebrew装,实在不行可以去官网下载安装包。
Miredo非常建议使用1.0.6那个旧版本,就是第一个链接的zip。
安装后系统直接提示你“系统设置需要刷新才能看到”就可用图标开关miredo了。
另外目录/Applications/Tunnelblick.app/Contents/Resources/ 默认没有tun-signed.kext的,要去tuntap的文件里面找到tun-signed.text和tap-signed.text复制到上面目录下就OK了。

@heisajoker
Copy link

终于搞定了,虽然系统偏好里面没有Miredo,但是ipv6可以用了

你这个怎么搞定的呢?

@Lynnluxu
Copy link

Lynnluxu commented Oct 6, 2020

到第七步输入sudo miredo后似乎会出现:
Cannot create PID file /opt/local/var/run/miredo.pid:
Resource temporarily unavailable
Please make sure another instance of the program is not already running.

你用的是虚拟机吗?我使用虚拟机的时候,在虚拟机内运行miredo出现了类似的问题。

@jingxinxin
Copy link

macOS Catalina 10.15.7 亲测可用
在sudo port install miredo的时候,遇到安装依赖失败的问题
比如:Fetching archive for tuntaposx
可以通过先过滤安装miredo,单独安装tuntaposx包
命令如下:
sudo port install miredo -tuntaposx

或则sudo port edit miredo
然后,您从depends_lib或depends_lib-append中删除依赖项保存编辑文件,再重新安装即可

@drcege
Copy link

drcege commented Mar 25, 2022

如果安装 miredo 失败,建议检查一下编译器是不是 gcc/g++,mac 默认的 clang 不行

@drcege
Copy link

drcege commented Mar 25, 2022

tunnleblick可以使用homebrew装,实在不行可以去官网下载安装包。 Miredo非常建议使用1.0.6那个旧版本,就是第一个链接的zip。 安装后系统直接提示你“系统设置需要刷新才能看到”就可用图标开关miredo了。 另外目录/Applications/Tunnelblick.app/Contents/Resources/ 默认没有tun-signed.kext的,要去tuntap的文件里面找到tun-signed.text和tap-signed.text复制到上面目录下就OK了。

请问你说的 “1.0.6那个旧版本,就是第一个链接的zip” 是哪个链接?

还有 tuntap 是哪里?从哪里找到 kext 文件

@heisajoker
Copy link

heisajoker commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests