3

I have an Orangepi5b running Android 12. I want to use Wi-Fi for internet connection and Ethernet to communicate to other network devices connected to it simultaneously.

I've read a lot of questions about it but there were no answers, or answers are outdated:

  1. Connect Android device to Wifi for internet and ethernet simultaneously
  2. https://stackoverflow.com/questions/63499840/android-9-ethernet-and-wifi-simulataneously
  3. https://stackoverflow.com/questions/18143534/android-ethernet-and-wi-fi-at-the-same-time?rq=4
  4. https://stackoverflow.com/questions/28991965/getting-wrong-network-interface-in-android?rq=4
  5. https://stackoverflow.com/questions/31713781/connect-to-lan-and-internet-at-same-time?rq=4
  6. How to make Ethernet work on Android over OTG?

I connected my Ubuntu laptop to debug connection. I used static IP on Ubuntu and configured static IP on Android for Ethernet connection. In Android terminal I can ping my laptop

ping 172.XXX.XXX.XXX

After that I connect to Wi-Fi, I'm able to ping sites like Google but can not ping my laptop. But I can ping my Android device from my laptop. In my opinion it means that this is problem with routes in Android

I've checked routes on Android:

busybox route

And this is the output:

Destination       Gateway     Genmask        Flags  Metric  Ref   Use  Iface
172.XXX.XXX.XXX   *           255.255.254.0    U      0      0     0    eth0
192.XXX.XXX.XXX   *           255.255.255.0    U      0      0     0    wlan0

It seams that routes are configured properly. If I want to ping my laptop I should explicit use interface for that:

ping -I eth0 172.XXX.XXX.XXX

I can use

su
ip route add 172.XXX.XXX.XXX dev eth0 table local

After that I can ping my laptop and use internet from Wi-Fi.

But it not works when I reboot the Android device. If rebooted I need to disable Wi-Fi, connect to Ethernet, after that connect to Wi-Fi and add route again.

Is it way to save routes to work after reboot, or may be another way to add route to work permanently?

Kracozebr
  • 131
  • 2
  • Android 13 has introduced a possibility to be connected to multiple networks at the same time, but I don't know if this has an effect on a Wifi/Ethernet set-up, as usually the only concurrent networks are mobile and Wifi. – Robert Sep 22 '23 at 07:10
  • Unfortunately orangepi5b is coming with android12, and there is no option to switch. The only way to switch is to build custom android from source. But I have no experience in this( – Kracozebr Sep 22 '23 at 07:16

0 Answers0