2

I am trying to use the Mobile Network interface rmnet_data0 while Wi-Fi wlan0 is enabled. You can read my progress with the developer JsBergbau of BindToInterface at this link https://github.com/JsBergbau/BindToInterface/issues/3. He referred me here to request help with what is preventing with binding to interface rmnet_data0 while Wi-Fi enabled used with curl. The phone is running ofono with UBports.

With wlan0 disabled:

curl --interface rmnet_data0 ifconfig.me
"MY IP ADDRESS OUTPUT"

With wlan0 enabled:

curl --interface rmnet_data0 ifconfig.me
curl: (7) Failed to connect to ifconfig.me port 80: Connection timed out

Substituted IP address for my real ones:

ip route list table local

broadcast 10.0.0.0 dev usb0 proto kernel scope link src 10.25.52.96 linkdown local 10.25.52.96 dev usb0 proto kernel scope host src 10.25.52.96 local 10.75.188.126 dev rmnet_data0 proto kernel scope host src 10.75.188.126 broadcast 10.75.188.127 dev rmnet_data0 proto kernel scope link src 10.75.188.126 broadcast 10.255.255.255 dev usb0 proto kernel scope link src 10.25.52.96 linkdown 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.266.10.0 dev wlan0 proto kernel scope link src 192.266.10.25 local 192.266.10.25 dev wlan0 proto kernel scope host src 192.266.10.254 broadcast 192.266.10.255 dev wlan0 proto kernel scope link src 192.266.10.25

ip route show table 0

default via 192.266.10.1  dev wlan0                      proto static                                       metric 600
default via 10.75.188.125 dev rmnet_data0                proto static                                       metric 700
10.0.0.0/8                dev usb0                       proto kernel  scope link  src 10.25.52.96 linkdown
10.75.188.125             dev rmnet_data0                proto static  scope link                           metric 700
192.266.10.0/24           dev wlan0                      proto kernel  scope link  src 192.266.10.25        metric 600
broadcast 10.0.0.0        dev usb0         table local   proto kernel  scope link  src 10.25.52.96 linkdown
local 10.25.52.96         dev usb0         table local   proto kernel  scope host  src 10.25.52.96
local 10.75.188.126       dev rmnet_data0  table local   proto kernel  scope host  src 10.75.188.126
broadcast 10.75.188.127   dev rmnet_data0  table local   proto kernel  scope link  src 10.75.188.126
broadcast 10.255.255.255  dev usb0         table local   proto kernel  scope link  src 10.25.52.96 linkdown
broadcast 127.0.0.0       dev lo           table local   proto kernel  scope link  src 127.0.0.1
local 127.0.0.0/8         dev lo           table local   proto kernel  scope host  src 127.0.0.1
local 127.0.0.1           dev lo           table local   proto kernel  scope host  src 127.0.0.1
broadcast 127.255.255.255 dev lo           table local   proto kernel  scope link  src 127.0.0.1
broadcast 192.168.1.0     dev wlan0        table local   proto kernel  scope link  src 192.266.10.25
local 192.266.10.25       dev wlan0        table local   proto kernel  scope host  src 192.266.10.25
broadcast 192.266.10.255  dev wlan0        table local   proto kernel  scope link  src 192.266.10.25
ip route list table main

default via 192.266.10.1  dev wlan0        proto static                 metric 600
default via 10.75.188.126 dev rmnet_data0  proto static                 metric 700
10.0.0.0/8                dev usb0         proto kernel  scope link  src 10.25.52.96 linkdown
10.75.188.125             dev rmnet_data0  proto static  scope link     metric 700
192.266.10.0/24           dev wlan0        proto kernel  scope link  src 192.266.10.164  metric 600
ip rule

0:      from all lookup local
32766:  from all lookup main
32767:  from all lookup default
Joe Cowboy
  • 21
  • 2
  • Most probably due to routing policy. When WiFi is enabled, Android sets wlan0 as the default gateway, and blocks traffic to rmnet_data0. – Irfan Latif Oct 07 '21 at 21:51
  • Looking at the IP route it shows they are both default:

    default via AAA.AAA.AAA.AAA dev wlan0 proto static metric 600 default via BBB.BBB.BBB.BBB dev rmnet_data0 proto static metric 700

    – Joe Cowboy Oct 08 '21 at 01:11
  • And ip rule?? – Irfan Latif Oct 08 '21 at 05:41
  • @IrfanLatif My post has been updated with the IP rules you asked for. – Joe Cowboy Oct 08 '21 at 21:06
  • ip route and ip rule are different commands. – Irfan Latif Oct 08 '21 at 21:48
  • @IrfanLatif I apologize, I know they are different commands and I have updated the post with the output. – Joe Cowboy Oct 09 '21 at 01:33
  • It's quite evident that the network traffic never reaches the second default route. The first one with lower metric value is always used. // Btw which device is it? In recent Android versions main table is not used, and RPDB is quite complex due to excessive use of fwmark and uid based filtering. – Irfan Latif Oct 09 '21 at 09:10
  • 1
    @IrfanLatif This is a Sprint OnePlus 7 Pro 5G running ofono with Ubports – Joe Cowboy Oct 09 '21 at 09:50
  • Alright. So this is Ubuntu, not Android. You must have root access then. Simply inject your own rule / route. Follow any Linux guide. See this recent answer of mine for a quick reference. – Irfan Latif Oct 09 '21 at 10:27

0 Answers0