1

I try to share my internet connection from my nexus 5 to my computer (on ubuntu). So I enabled wifi hotspot on my phone bu following http://www.gottabemobile.com/2014/01/25/how-to-use-the-nexus-5-as-a-personal-hotspot/ but it doenst work.

The connection between my computer and my phone is working but when I tried to connect to google the connection fail.

I installed tcpdump (by cross-compiling it) and I can see the SYN packet(but there is no SYN ACK) on the wlan0 interface but not on rmnet0(which is the interface where is my internet connection) so I guess it is a routing problem.

routing is enabled:

root@hammerhead:/ # cat /proc/sys/net/ipv4/ip_forward                          
1

the interfaces :

root@hammerhead:/ # ip link | grep UP                                          
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN mode DEFAULT 
2: rmnet0: <UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN mode DEFAULT qlen 1000
21: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000

the route table:

10.8.91.76/30 dev rmnet0  proto kernel  scope link  src 10.8.91.77 
172.20.2.10 via 10.8.91.78 dev rmnet0  src 10.8.91.77 
172.20.2.39 via 10.8.91.78 dev rmnet0  src 10.8.91.77 
192.168.43.0/24 dev wlan0  proto kernel  scope link  src 192.168.43.1 


root@hammerhead:/ # ip route
A.A.A.B/30 dev rmnet0  proto kernel  scope link  src A 
172.20.2.10 via 10.8.91.78 dev rmnet0  src 10.8.91.77 
172.20.2.39 via 10.8.91.78 dev rmnet0  src 10.8.91.77 
192.168.43.0/24 dev wlan0  proto kernel  scope link  src 192.168.43.1 

the firewall :

root@hammerhead:/ # iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
bw_INPUT   all  --  anywhere             anywhere
fw_INPUT   all  --  anywhere             anywhere

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
oem_fwd    all  --  anywhere             anywhere
fw_FORWARD  all  --  anywhere             anywhere
bw_FORWARD  all  --  anywhere             anywhere
natctrl_FORWARD  all  --  anywhere             anywhere

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
oem_out    all  --  anywhere             anywhere
fw_OUTPUT  all  --  anywhere             anywhere
bw_OUTPUT  all  --  anywhere             anywhere

Chain bw_FORWARD (1 references)
target     prot opt source               destination

Chain bw_INPUT (1 references)
target     prot opt source               destination
           all  --  anywhere             anywhere             ! quota globalAlert: 2097152 bytes
bw_costly_rmnet0  all  --  anywhere             anywhere
           all  --  anywhere             anywhere             owner socket exists

Chain bw_OUTPUT (1 references)
target     prot opt source               destination
           all  --  anywhere             anywhere             ! quota globalAlert: 2097152 bytes
bw_costly_rmnet0  all  --  anywhere             anywhere
           all  --  anywhere             anywhere             owner socket exists

Chain bw_costly_rmnet0 (2 references)
target     prot opt source               destination
bw_penalty_box  all  --  anywhere             anywhere
REJECT     all  --  anywhere             anywhere             ! quota rmnet0: 9223372036854775807 bytes  reject-with icmp-port-unreachable

Chain bw_costly_shared (0 references)
target     prot opt source               destination
bw_penalty_box  all  --  anywhere             anywhere

Chain bw_happy_box (0 references)
target     prot opt source               destination

Chain bw_penalty_box (2 references)
target     prot opt source               destination
REJECT     all  --  anywhere             anywhere             owner UID match u0_a14 reject-with icmp-port-unreachable

Chain fw_FORWARD (1 references)
target     prot opt source               destination

Chain fw_INPUT (1 references)
target     prot opt source               destination

Chain fw_OUTPUT (1 references)
target     prot opt source               destination

Chain natctrl_FORWARD (1 references)
target     prot opt source               destination
DROP       all  --  anywhere             anywhere

Chain natctrl_tether_counters (0 references)
target     prot opt source               destination

Chain oem_fwd (1 references)
target     prot opt source               destination

Chain oem_out (1 references)
target     prot opt source               destination

do you know why it doens't work. Also when i do ping 8.8.8.8 from my phone all is working but i don't understand why : there is no default route so how can it decide where to go? can you explain?

thank you

  • Thank your for your answer but it doesn't work. # route add default gw 8.8.8.8 dev rmnet0 give me Network is unreachable – user3680197 Nov 22 '15 at 20:23
  • 2
    oh yes of course sorry. I executed route add default gw 8.8.8.8 dev wlan0 (wlan0 of the computer) but i have the same error which is quite logical. I think there is no problem on the configuration of the computer because when I try telnet 8.8.8.8 53 the SYN packet can be read from the wlan0 interface of the phone. The problem is it doesn't go to the rmnet0 (it seems it is not forwarded). – user3680197 Nov 22 '15 at 20:33
  • Do you have tethering on your cell plan? Otherwise, the built-in hotspot probably won't work. – derobert Nov 27 '15 at 18:27
  • (Also, to understand routing on the phone you'll have to look at ip rule; there is more than one routing table. ip route list table X to look at a different one, where X is a table number which you'll see in the ip rule output. Look up Linux policy routing for an explanation.) – derobert Nov 27 '15 at 18:30

Your Answer

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

Browse other questions tagged or ask your own question.