1

I have following network structure

PC  <-- USB cable -->   Android Smartphone <--> MyWiFi
IP=192.168.42.41        IP=192.168.35.115       IP=192.168.35.254
NM=255.255.255.0        NM=???                  NM=255.255.255.0
DG=192.168.42.129       DG=???                  DG=???

Laptop <--------------> MyWiFi
IP=192.168.35.112       IP=192.168.35.254
NM=255.255.255.0        NM=255.255.255.0
DG=192.168.35.254       DG=???

... where MyWiFi is my home WiFi network

Note: The PC can "ping" the Laptop, but the Laptop cannot "ping" the PC.

When I traceroute 192.168.35.254 from the PC, I get the following:

traceroute 192.168.35.254
traceroute to 192.168.35.254 (192.168.35.254), 30 hops max, 60 byte packets
 1  192.168.42.129 (192.168.42.129)  2.163 ms  2.870 ms  3.339 ms
 2  192.168.35.254 (192.168.35.254)  14.562 ms  14.915 ms  11.876 ms

Routing from the laptop is:

ip route
default via 192.168.35.254 dev wlp2s0  proto static  metric 600 
169.254.0.0/16 dev wlp2s0  scope link  metric 1000 
192.168.35.0/24 dev wlp2s0  proto kernel  scope link  src 192.168.35.112  metric 600 

So it seems confirmed that my Android Phone stands as gateway between the PC and the WIFI router.

Both computers PC and Laptop have Ubuntu installed and Nautilus + Samba in order to share folders. The problem is that the PC cannot see the share folders of the Laptop

I have already shared folders between other computers that connect directly to MyWiFi, but I think in this case the tethering is spoiling the sharing.

How can I share folders, even though I am connecting the PC to the WiFi via tethering?

  • How is the PC tethered to the Android? Cable? Bluetooth? can the PC ping the default gateway of MyWiFi? Can it ping 1.1.1.1? Please edit your question to provide this valuable info and then leave a comment @Fabby 0:-) – Fabby Jul 18 '19 at 22:14
  • This is confusing,... are you sure you use tethering ? – Robert Riedl Jul 19 '19 at 13:25
  • @Fabby Thanks for the questions. I just did what you asked for. Every ping worked properly. – loved.by.Jesus Jul 19 '19 at 13:46
  • Ah. Please edit your question and provide the whole picture in the PC <-- USB cable --> Android Smartphone <--> MyWiFi line: all of their IP addresses and Default gateways because you don't have a samba issue but a networking issue. also add the full samba config to paste.ubuntu.com and provide a link to that in your question too. so make your question easy to understand from a full networking perspective... ;-) – Fabby Jul 19 '19 at 14:11
  • 1
    I agree with @Fabby this is a network issue, specifically having two subnets. The simple solution would be to connect the PC to the router by an Ethernet cable or a WiFi dongle. Then you will have both PC and laptop on the same subnet. – user68186 Jul 19 '19 at 22:30
2
+50

Here your Android Smartphone indeed works as gateway but partially you also have to configure routes from laptop side.

The reason behind PC cannot see the share folders of the Laptop is that Laptop routes packets through your wifi router. You need configure your android smartphone's ip address as gateway in your laptop.

Currently gateway of laptop is router. Please remove 192.168.35.254 ip address and configure smartphone as gateway 192.168.35.115 in your laptop's network configuration. After applying configuration, it should work.

You can check routes of laptop using route -n command.

| improve this answer | |
  • 1
    Thanks a lot @Ketan Patel, it really worked! Just by replacing the gateway I could access the PC from the laptop and, not only ping the PC's address, but also mount samba from the laptop by standard command smb://192.168.42.41/folder_name on nautilus – loved.by.Jesus Jul 23 '19 at 21:40
0

Because the PC can "ping" the Laptop, I can at least access the Samba shared folders of the Laptop (IP 192.168.35.112) from the PC. I have to use following command in the nautilus bar of the PC.

smb://192.168.35.112/name-of-shared-folder

In that way I can do at least exchange from the PC.

Caveat

The same as the other answers. The IP of the Laptop may change, and therefore the command should be adapted.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.