ホットスポットが有効になっていないと、AndroidではIP転送が利用できません

ホットスポットが有効になっていないと、AndroidではIP転送が利用できません

私は本当にこの問題に固執しました。コンピュータのゲートウェイを変更して、携帯電話を介して自宅の同じWi-Fiネットワークに接続したいと思います。ホットスポットがオンになっていて他のデバイスに接続すると、期待どおりに機能します。ホットスポットを無効にしてコンピュータゲートウェイをモバイルに変更し、転送を有効にすると、iptables FORWARDテーブルのカウンタは変更されません。

ホットスポットで使用するすべてのポート転送を有効にしました。以下のsysctl出力を参照してください。

コンピュータのIPは192.168.0.57です。

接続したい携帯電話/タブレットはSamsung Galaxy TAB A6です。現在、レガシーカスタムROM Android 9を実行していますが、8.1ストックイメージも成功しませんでした。

PCでping 8.8.8.8を実行すると、次の結果が表示されます。

ホットスポットがオンのときtcpdump

06:55:33.500227 IP 19.18.39.197 > dns.google: ICMP echo request, id 21730, seq 1, length 64
06:55:33.528039 IP dns.google > 19.18.39.197: ICMP echo reply, id 21730, seq 1, length 64
06:55:34.578520 IP 19.18.39.197 > dns.google: ICMP echo request, id 21731, seq 1, length 64
06:55:34.603065 IP dns.google > 19.18.39.197: ICMP echo reply, id 21731, seq 1, length 64
06:55:35.717137 IP 19.18.39.197 > dns.google: ICMP echo request, id 21732, seq 1, length 64
06:55:35.763043 IP dns.google > 19.18.39.197: ICMP echo reply, id 21732, seq 1, length 64

ホットスポットのないtcpdump

06:58:16.566254 IP 19.18.39.197 > 192.168.0.57: ICMP net cache2.service.virginmedia.net unreachable, 
length 68

ただ繰り返し続ける

ifconfig and ip r:

:/ # ip r
19.0.0.0/8 dev rmnet1 proto kernel scope link src 19.18.39.197
192.168.0.0/24 dev wlan0 proto kernel scope link src 192.168.0.50
:/ # ifconfig
wlan0     Link encap:Ethernet  HWaddr 08:78:08:ac:fc:04  Driver ar6k_wlan
          inet addr:192.168.0.50  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::a78:8ff:feac:fc04/64 Scope: Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5876 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3845 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3000
          RX bytes:935863 TX bytes:580125

rmnet1    Link encap:Point-to-Point Protocol
          inet addr:19.18.39.197  P-t-P:19.18.39.197  Mask:255.0.0.0
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:3351 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3383 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1564260 TX bytes:1053730

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope: Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:5435 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5435 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:869529 TX bytes:869529

iptables - ホットスポットがダウンしても、フォワードチェーンでは何も変わりません。

:/ # iptables -vnL
Chain INPUT (policy ACCEPT 6542 packets, 1282K bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain FORWARD (policy ACCEPT 1666 packets, 346K bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain OUTPUT (policy ACCEPT 6514 packets, 925K bytes)
 pkts bytes target     prot opt in     out     source               destination

:/ # iptables -t nat -vnL
Chain PREROUTING (policy ACCEPT 3072 packets, 203K bytes)
pkts bytes target     prot opt in     out     source               destination

Chain INPUT (policy ACCEPT 2074 packets, 126K bytes)
pkts bytes target     prot opt in     out     source               destination

Chain OUTPUT (policy ACCEPT 199 packets, 13593 bytes)
pkts bytes target     prot opt in     out     source               destination

Chain POSTROUTING (policy ACCEPT 62 packets, 4337 bytes)
pkts bytes target     prot opt in     out     source               destination
710 58824 MASQUERADE  all  --  *      rmnet1  0.0.0.0/0            0.0.0.0/0

Sysctl(ホットスポットをオフにして再度有効にすると無効になります)

  :/ # sysctl -a |grep forward
    net.ipv4.conf.all.forwarding = 1
    net.ipv4.conf.all.mc_forwarding = 0
    net.ipv4.conf.default.forwarding = 1
    net.ipv4.conf.default.mc_forwarding = 0
    net.ipv4.conf.ip6tnl0.forwarding = 1
    net.ipv4.conf.ip6tnl0.mc_forwarding = 0
    net.ipv4.conf.lo.forwarding = 1
    net.ipv4.conf.lo.mc_forwarding = 0
    net.ipv4.conf.rmnet0.forwarding = 1
    net.ipv4.conf.rmnet0.mc_forwarding = 0
    net.ipv4.conf.rmnet1.forwarding = 1
    net.ipv4.conf.rmnet1.mc_forwarding = 0
    net.ipv4.conf.rmnet2.forwarding = 1
    net.ipv4.conf.rmnet2.mc_forwarding = 0
    net.ipv4.conf.rmnet3.forwarding = 1
    net.ipv4.conf.rmnet3.mc_forwarding = 0
    net.ipv4.conf.rmnet4.forwarding = 1
    net.ipv4.conf.rmnet4.mc_forwarding = 0
    net.ipv4.conf.rmnet5.forwarding = 1
    net.ipv4.conf.rmnet5.mc_forwarding = 0
    net.ipv4.conf.rmnet6.forwarding = 1
    net.ipv4.conf.rmnet6.mc_forwarding = 0
    net.ipv4.conf.rmnet7.forwarding = 1
    net.ipv4.conf.rmnet7.mc_forwarding = 0
    net.ipv4.conf.sit0.forwarding = 1
    net.ipv4.conf.sit0.mc_forwarding = 0
    net.ipv4.conf.umts_dm0.forwarding = 1
    net.ipv4.conf.umts_dm0.mc_forwarding = 0
    net.ipv4.conf.wlan0.forwarding = 1
    net.ipv4.conf.wlan0.mc_forwarding = 0
    net.ipv4.ip_forward = 1
    net.ipv4.ip_forward_use_pmtu = 0
    sysctl: key 'net.ipv4.route.flush': Permission denied
    net.ipv6.conf.all.forwarding = 1
    net.ipv6.conf.default.forwarding = 1
    net.ipv6.conf.ip6tnl0.forwarding = 1
    net.ipv6.conf.lo.forwarding = 1
    net.ipv6.conf.rmnet0.forwarding = 1
    net.ipv6.conf.rmnet1.forwarding = 1
    net.ipv6.conf.rmnet2.forwarding = 1
    net.ipv6.conf.rmnet3.forwarding = 1
    net.ipv6.conf.rmnet4.forwarding = 1
    net.ipv6.conf.rmnet5.forwarding = 1
    net.ipv6.conf.rmnet6.forwarding = 1
    net.ipv6.conf.rmnet7.forwarding = 1
    net.ipv6.conf.sit0.forwarding = 1
    net.ipv6.conf.umts_dm0.forwarding = 1
    net.ipv6.conf.wlan0.forwarding = 1

ホットスポットがオンになったときに配信を可能にするオプションを、私が知らないオプションに変更するような気がします。誰かがアイデアがあることを願っています。

編集する

助けてくれたABに感謝します。この問題は、ホットスポットがオンになっているときにAndroidが生成するIPルールが原因で発生し、ホットスポットがオフになっているときは複製されません。

ここで要求されているように、まずホットスポットテーブルをオフにします。

:/ # ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: umts_dm0: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ppp
3: rmnet0: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ppp
4: rmnet1: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 1000
    link/ppp
5: rmnet2: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ppp
6: rmnet3: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ppp
7: rmnet4: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ppp
8: rmnet5: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ppp
9: rmnet6: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ppp
10: rmnet7: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ppp
11: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT group default
    link/sit 0.0.0.0 brd 0.0.0.0
12: ip6tnl0@NONE: <NOARP> mtu 1452 qdisc noop state DOWN mode DEFAULT group default
    link/tunnel6 :: brd ::
13: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT group default qlen 3000
    link/ether 08:78:08:ac:fc:04 brd ff:ff:ff:ff:ff:ff
14: p2p0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 3000
    link/ether 0a:78:08:ac:fc:04 brd ff:ff:ff:ff:ff:ff

1|:/ # ip address
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: umts_dm0: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ppp
3: rmnet0: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ppp
4: rmnet1: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 1000
    link/ppp
    inet 19.18.242.148/8 scope global rmnet1
       valid_lft forever preferred_lft forever
5: rmnet2: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ppp
6: rmnet3: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ppp
7: rmnet4: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ppp
8: rmnet5: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ppp
9: rmnet6: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ppp
10: rmnet7: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ppp
11: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default
    link/sit 0.0.0.0 brd 0.0.0.0
12: ip6tnl0@NONE: <NOARP> mtu 1452 qdisc noop state DOWN group default
    link/tunnel6 :: brd ::
13: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 3000
    link/ether 08:78:08:ac:fc:04 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.50/24 brd 192.168.0.255 scope global wlan0
       valid_lft forever preferred_lft forever
    inet6 fe80::a78:8ff:feac:fc04/64 scope link
       valid_lft forever preferred_lft forever
14: p2p0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 3000
    link/ether 0a:78:08:ac:fc:04 brd ff:ff:ff:ff:ff:ff

130|:/ # ip route
19.0.0.0/8 dev rmnet1 proto kernel scope link src 19.18.242.148
192.168.0.0/24 dev wlan0 proto kernel scope link src 192.168.0.50
:/ # ip rule
0:      from all lookup local
10000:  from all fwmark 0xc0000/0xd0000 lookup legacy_system
10500:  from all iif lo oif wlan0 uidrange 0-0 lookup wlan0
10500:  from all iif lo oif rmnet1 uidrange 0-0 lookup rmnet1
13000:  from all fwmark 0x10063/0x1ffff iif lo lookup local_network
13000:  from all fwmark 0x10065/0x1ffff iif lo lookup wlan0
13000:  from all fwmark 0x50064/0x5ffff iif lo lookup rmnet1
14000:  from all iif lo oif wlan0 lookup wlan0
14000:  from all fwmark 0x40000/0x40000 iif lo oif rmnet1 lookup rmnet1
15000:  from all fwmark 0x0/0x10000 lookup legacy_system
16000:  from all fwmark 0x0/0x10000 lookup legacy_network
17000:  from all fwmark 0x0/0x10000 lookup local_network
19000:  from all fwmark 0x65/0x1ffff iif lo lookup wlan0
22000:  from all fwmark 0x0/0xffff iif lo lookup wlan0
32000:  from all unreachable
:/ #
1|:/ # ip rule show table local
0:      from all lookup local
:/ # ip rule show table rmnet1
10500:  from all iif lo oif rmnet1 uidrange 0-0 lookup rmnet1
13000:  from all fwmark 0x50064/0x5ffff iif lo lookup rmnet1
14000:  from all fwmark 0x40000/0x40000 iif lo oif rmnet1 lookup rmnet1
:/ # ip rule show table wlan0
10500:  from all iif lo oif wlan0 uidrange 0-0 lookup wlan0
13000:  from all fwmark 0x10065/0x1ffff iif lo lookup wlan0
14000:  from all iif lo oif wlan0 lookup wlan0
19000:  from all fwmark 0x65/0x1ffff iif lo lookup wlan0
22000:  from all fwmark 0x0/0xffff iif lo lookup wlan0
:/ # ip rule show table local_network
13000:  from all fwmark 0x10063/0x1ffff iif lo lookup local_network
17000:  from all fwmark 0x0/0x10000 lookup local_network
:/ # ip rule show table legacy_network
16000:  from all fwmark 0x0/0x10000 lookup legacy_network
:/ # ip rule show table legacy_system
10000:  from all fwmark 0xc0000/0xd0000 lookup legacy_system
15000:  from all fwmark 0x0/0x10000 lookup legacy_system
:/ #
:/ # ip route show table local
broadcast 19.0.0.0 dev rmnet1 proto kernel scope link src 19.18.242.148
local 19.18.242.148 dev rmnet1 proto kernel scope host src 19.18.242.148
broadcast 19.255.255.255 dev rmnet1 proto kernel scope link src 19.18.242.148
broadcast 127.0.0.0 dev lo proto kernel scope link src 127.0.0.1
local 127.0.0.0/8 dev lo proto kernel scope host src 127.0.0.1
local 127.0.0.1 dev lo proto kernel scope host src 127.0.0.1
broadcast 127.255.255.255 dev lo proto kernel scope link src 127.0.0.1
broadcast 192.168.0.0 dev wlan0 proto kernel scope link src 192.168.0.50
local 192.168.0.50 dev wlan0 proto kernel scope host src 192.168.0.50
broadcast 192.168.0.255 dev wlan0 proto kernel scope link src 192.168.0.50
:/ # ip route show table rmnet1
default via 19.18.242.1 dev rmnet1 proto static
19.18.242.1 dev rmnet1 proto static scope link
19.18.242.148 dev rmnet1 proto static scope link
:/ # ip route show table wlan0
default via 192.168.0.1 dev wlan0 proto static
192.168.0.0/24 dev wlan0 proto static scope link
:/ # ip route show table local_network
:/ # ip route show table legacy_network
:/ # ip route show table legacy_system
:/ #

そしてホットスポットがオンになったら

:/ # ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: umts_dm0: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ppp
3: rmnet0: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000
    link/ppp
4: rmnet1: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 1000
    link/ppp
5: rmnet2: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ppp
6: rmnet3: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ppp
7: rmnet4: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ppp
8: rmnet5: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ppp
9: rmnet6: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ppp
10: rmnet7: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ppp
11: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT group default
    link/sit 0.0.0.0 brd 0.0.0.0
12: ip6tnl0@NONE: <NOARP> mtu 1452 qdisc noop state DOWN mode DEFAULT group default
    link/tunnel6 :: brd ::
13: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 3000
    link/ether 08:78:08:ac:fc:04 brd ff:ff:ff:ff:ff:ff
:/ #
:/ # ip address
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: umts_dm0: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ppp
3: rmnet0: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ppp
4: rmnet1: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 1000
    link/ppp
    inet 19.18.242.148/8 scope global rmnet1
       valid_lft forever preferred_lft forever
5: rmnet2: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ppp
6: rmnet3: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ppp
7: rmnet4: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ppp
8: rmnet5: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ppp
9: rmnet6: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ppp
10: rmnet7: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ppp
11: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default
    link/sit 0.0.0.0 brd 0.0.0.0
12: ip6tnl0@NONE: <NOARP> mtu 1452 qdisc noop state DOWN group default
    link/tunnel6 :: brd ::
13: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 3000
    link/ether 08:78:08:ac:fc:04 brd ff:ff:ff:ff:ff:ff
    inet 192.168.43.241/24 brd 192.168.43.255 scope global wlan0
       valid_lft forever preferred_lft forever
    inet6 fe80::a78:8ff:feac:fc04/64 scope link
       valid_lft forever preferred_lft forever
:/ #
:/ # ip route
19.0.0.0/8 dev rmnet1 proto kernel scope link src 19.18.242.148
192.168.43.0/24 dev wlan0 proto kernel scope link src 192.168.43.241
:/ # ip rule
0:      from all lookup local
10000:  from all fwmark 0xc0000/0xd0000 lookup legacy_system
10500:  from all iif lo oif rmnet1 uidrange 0-0 lookup rmnet1
10500:  from all iif lo oif wlan0 uidrange 0-0 lookup local_network
13000:  from all fwmark 0x10063/0x1ffff iif lo lookup local_network
13000:  from all fwmark 0x10064/0x1ffff iif lo lookup rmnet1
14000:  from all iif lo oif rmnet1 lookup rmnet1
14000:  from all iif lo oif wlan0 lookup local_network
15000:  from all fwmark 0x0/0x10000 lookup legacy_system
16000:  from all fwmark 0x0/0x10000 lookup legacy_network
17000:  from all fwmark 0x0/0x10000 lookup local_network
18000:  from all iif wlan0 lookup rmnet1
19000:  from all fwmark 0x64/0x1ffff iif lo lookup rmnet1
22000:  from all fwmark 0x0/0xffff iif lo lookup rmnet1
32000:  from all unreachable
:/ # ip rule show table local
0:      from all lookup local
:/ # ip rule show table rmnet1
10500:  from all iif lo oif rmnet1 uidrange 0-0 lookup rmnet1
13000:  from all fwmark 0x10064/0x1ffff iif lo lookup rmnet1
14000:  from all iif lo oif rmnet1 lookup rmnet1
18000:  from all iif wlan0 lookup rmnet1
19000:  from all fwmark 0x64/0x1ffff iif lo lookup rmnet1
22000:  from all fwmark 0x0/0xffff iif lo lookup rmnet1
:/ # ip rule show table wlan0
Error: argument "wlan0" is wrong: table id value is invalid

255|:/ # ip rule show table local_network
10500:  from all iif lo oif wlan0 uidrange 0-0 lookup local_network
13000:  from all fwmark 0x10063/0x1ffff iif lo lookup local_network
14000:  from all iif lo oif wlan0 lookup local_network
17000:  from all fwmark 0x0/0x10000 lookup local_network
:/ # ip rule show table legacy_network
16000:  from all fwmark 0x0/0x10000 lookup legacy_network
:/ # ip rule show table legacy_system
10000:  from all fwmark 0xc0000/0xd0000 lookup legacy_system
15000:  from all fwmark 0x0/0x10000 lookup legacy_system
:/ #
:/ # ip route show table local
broadcast 19.0.0.0 dev rmnet1 proto kernel scope link src 19.18.242.148
local 19.18.242.148 dev rmnet1 proto kernel scope host src 19.18.242.148
broadcast 19.255.255.255 dev rmnet1 proto kernel scope link src 19.18.242.148
broadcast 127.0.0.0 dev lo proto kernel scope link src 127.0.0.1
local 127.0.0.0/8 dev lo proto kernel scope host src 127.0.0.1
local 127.0.0.1 dev lo proto kernel scope host src 127.0.0.1
broadcast 127.255.255.255 dev lo proto kernel scope link src 127.0.0.1
broadcast 192.168.43.0 dev wlan0 proto kernel scope link src 192.168.43.241
local 192.168.43.241 dev wlan0 proto kernel scope host src 192.168.43.241
broadcast 192.168.43.255 dev wlan0 proto kernel scope link src 192.168.43.241
:/ # ip route show table rmnet1
default via 19.18.242.1 dev rmnet1 proto static
19.18.242.1 dev rmnet1 proto static scope link
19.18.242.148 dev rmnet1 proto static scope link
:/ # ip route show table wlan0
Error: argument "wlan0" is wrong: table id value is invalid

255|:/ # ip route show table local_network
192.168.43.0/24 dev wlan0 proto static scope link
:/ # ip route show table legacy_network
:/ # ip route show table legacy_system
:/ #

すべてを削除して単純化すればうまくいくことができると思いますが、Androidはネットワーク変更でルールを再作成するだけなので、私が見落としているルールが何であるかを調べたいと思います。

編集する

すべて解決されました。ホットスポットは2つのインターフェイス間にパスを追加し、ホットスポット接続が失われるとパスが失われます。次の2つのルールを追加できます。

:/ # ip rule add from all iif rmnet1 lookup wlan0
:/ # ip rule add from all iif wlan0 lookup rmnet1

関連情報