How to use WiFi and Ethernet connection simultaneously on Android 12?
3
votes
0
answers
1830
views
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. https://android.stackexchange.com/questions/219398/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. https://android.stackexchange.com/questions/225643/how-to-make-ethernet-work-on-android-over-otg/225741#225741
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?
Asked by Kracozebr
(131 rep)
Sep 22, 2023, 05:55 AM
Last activity: Sep 25, 2023, 06:17 AM
Last activity: Sep 25, 2023, 06:17 AM