需求:同时连接手机热点(en0)和有线网络(en11)。 在论坛里搜了下,基本就是配置路由表,默认 en0 访问外网,en11 设置指定的网段访问内网。 由于我的梯子被 imgur 屏蔽了,访问 403 ,下面只好贴文字了,辛苦大家的眼睛了。
ifconfig 的信息如下:
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=6460<TSO4,TSO6,CHANNEL_IO,PARTIAL_CSUM,ZEROINVERT_CSUM>
ether f8:4d:89:66:ba:a0
inet6 fe80::83b:23a4:c8cd:863e%en0 prefixlen 64 secured scopeid 0xe
inet 172.20.10.2 netmask 0xfffffff0 broadcast 172.20.10.15
inet6 2408:8409:1840:b58d:c3b:b228:a437:3699 prefixlen 64 autoconf secured
inet6 2408:8409:1840:b58d:250f:9a82:b170:5790 prefixlen 64 autoconf temporary
nd6 options=201<PERFORMNUD,DAD>
media: autoselect
status: active
en11: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=6464<VLAN_MTU,TSO4,TSO6,CHANNEL_IO,PARTIAL_CSUM,ZEROINVERT_CSUM>
ether 00:e1:6c:68:2a:72
inet6 fe80::72:db57:6430:b797%en11 prefixlen 64 secured scopeid 0xf
inet 172.27.136.101 netmask 0xffffff00 broadcast 172.27.136.255
nd6 options=201<PERFORMNUD,DAD>
media: autoselect (1000baseT <full-duplex>)
status: active
尝试过的命令:
sudo route add -net 192.168.0.0/24 -interface en11
和
sudo route add -net 192.168.0.0/24 172.27.136.1
路由表的信息如下
Internet:
Destination Gateway Flags Netif Expire
default 172.20.10.1 UGScg en0
default 172.27.136.1 UGScIg en11
127 127.0.0.1 UCS lo0
127.0.0.1 127.0.0.1 UH lo0
169.254 link#14 UCS en0 !
169.254 link#15 UCSI en11 !
172.20.10/28 link#14 UCS en0 !
172.20.10.1/32 link#14 UCS en0 !
172.20.10.1 1a:fa:b7:21:ee:64 UHLWIir en0 1019
172.20.10.2/32 link#14 UCS en0 !
172.20.10.2 f8:4d:89:66:ba:a0 UHLWI lo0
172.27.136/24 link#15 UCS en11 !
172.27.136.1/32 link#15 UCS en11 !
172.27.136.1 ec:b9:70:b3:e9:27 UHLWIir en11 1199
172.27.136.101/32 link#15 UCS en11 !
192.168.0 172.27.136.1 UGSc en11
224.0.0/4 link#14 UmCS en0 !
224.0.0/4 link#15 UmCSI en11 !
224.0.0.251 1:0:5e:0:0:fb UHmLWI en0
239.255.255.250 1:0:5e:7f:ff:fa UHmLWI en0
239.255.255.250 1:0:5e:7f:ff:fa UHmLWI en11
255.255.255.255/32 link#14 UCS en0 !
255.255.255.255/32 link#15 UCSI en11 !
1
eunrui OP 添加后依然是 ping 不通内网的 ip 🤔
``` PING 192.168.85.110 (192.168.85.110): 56 data bytes Request timeout for icmp_seq 0 Request timeout for icmp_seq 1 Request timeout for icmp_seq 2 Request timeout for icmp_seq 3 Request timeout for icmp_seq 4 Request timeout for icmp_seq 5 Request timeout for icmp_seq 6 Request timeout for icmp_seq 7 Request timeout for icmp_seq 8 Request timeout for icmp_seq 9 Request timeout for icmp_seq 10 Request timeout for icmp_seq 11 Request timeout for icmp_seq 12 Request timeout for icmp_seq 13 ``` |
2
eunrui OP 以上是 gpt 给的方法,大佬们有什么建议吗
|
3
yagamisam 328 天前 1
sudo route add -net 192.168.0.0/16 172.27.136.1
或者 sudo route add -net 192.168.85.0/24 172.27.136.1 应该可以吧 |
6
yihy8023 328 天前 1
提供一种思路,我用的 surge 管理的网络路由
|
8
MrKrabs 328 天前 1
sing-box 应该可以,商店有免费客户端
|