I have an unrooted Android device and a desktop PC running Ubuntu 18.04 with no built-in WiFi. I want to bring both the devices to the same network.
I tried USB tethering from Android to desktop PC. It is getting connected, but the network IDs are different (IP of Android device is 100.81.X.X and IP of desktop PC is 192.168.42.X).
I also tried reverse tethering with gnirehtet (https://www.ubuntubuzz.com/2019/09/android-reverse-tethering-with-ubuntu-1804.html). Using this, I am able to connect to internet from my Android, but still the desktop PC and Android are in different networks (IP of Android is 10.X.X.X and IP of desktop PC is 192.168.2.X)
Is there any way I can bring both devices to the same network so that I can ping the Android device from desktop PC without any additional hardware?
EDIT : This is the output of route
command, where enp0s29u1u5
is the interface corresponding to USB tethering:
Output of adb shell ip route
:
192.168.42.0/24 dev rndis0 proto kernel scope link src 192.168.42.129