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

mac 双网卡同时连接上网 #52

Open
iliuyt opened this issue Nov 5, 2019 · 0 comments
Open

mac 双网卡同时连接上网 #52

iliuyt opened this issue Nov 5, 2019 · 0 comments

Comments

@iliuyt
Copy link
Owner

iliuyt commented Nov 5, 2019

场景描述

因为我的是mac air,使用有线很不方便,所以我的方案是蓝牙连接手机上外网,wifi连接内网,
这个适应内网地址比较少的场景,我访问外网比较多,内网主要是通信,所以只需要三四个地址

步骤

  • 连接内网
  • 获取所有需要连接内网的ip或者域名
  • 如果是域名需要通过请求查找对应的ip,最简单的时候通过chrome 的network 获取对应ip
  • 如果是域名需要更改host, sudo vim /etc/hosts
  10.203.77.9 aone-yx.saic-m.com
  210.75.68.61 mail.shanghaim.com
  • 获取内网网关,就是路由器ip地址,我的是10.2.46.25
  • 通过命令行添加路由
  sudo route add -net 10.203/16 10.2.46.25
  sudo route add -net 210.75/16 10.2.46.25
  • 最后一步打开蓝牙连接外网,搞定可以同时访问添加路由的内网地址和所有外网地址了

结束

暂时这么用着,后续有问题继续优化更新

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

No branches or pull requests

1 participant