[Android Q&A, Help & Troubleshooting] peoro:
I have a computer connected to the Internet. I'd like to connect my rooted Nexus 5X to it, get internet on my mobile through USB (reverse tethering) and share it wirelessly creating a hotspot. The Nexus 5X is running the stock ROM, Android 6.0.1.

The computer with an Internet connection (let's call it gateway) is correctly configured to share internet to its usb0 interface.

Android is receiving internet (from the USB interface: rndis0) but only the command line applications are able to use it: I can download anything using busybox's wget, but the graphical apps (e.g. Google services - I don't have any other app installed ATM) cannot.

Android is also able to share the connection through its hotspot on wlan0, but it doesn't work properly: the devices connected to my mobile's WiFi (let's call them clients) can resolve hostnames and ping IPs on the Internet (thus ICMP and UDP packets are working), but cannot download anything (TCP connections are broken).

I tried to monitor the traffic on the gateway's usb0 and on a client's wlan0 while trying to download some HTTP data..

On the client's wlan0 I can only see the TCP SYN packets and nothing else, while on the gateway I see many ICPM, DNS (UDP) and ARP packets flying through, but nothing about the HTTP connection. Something unusual that I noticed is that the gateway sees some ICMP "Destination unreachable (Port unreachable)" packets going from android to my DNS server (8.8.8.8).

In order to configure Android to share Internet from rndis0 to wlan0 I did the following:

# flushing iptables
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
# forwarding (natting) the traffic
iptables -t nat -A POSTROUTING -o rndis0 -j MASQUERADE
iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i wlan0 -o rndis0 -j ACCEPT

I found some threads on the internet suggesting to set the IP address of the 3G interface on the mobile to 0.0.0.0 (this, if I understood correctly, should fool Android's graphical apps into believing there's internet, through 3G), but I couldn't find what interface would be the 3G one... The following interfaces are up (I believe also sit0 was up, but I pulled it down to experiment):

# # ifconfig | grep '^[^ ]'
dummy0 Link encap:Ethernet HWaddr 02:EF:5A:*CENSORED*
lo Link encap:Local Loopback
rmnet_ipa0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
rndis0 Link encap:Ethernet HWaddr 6A:EE:F8:*CENSORED*
wlan0 Link encap:Ethernet HWaddr 64:BC:0C:*CENSORED*

And the following are all the interfaces

# ifconfig -a | grep '^[^ ]'
dummy0 Link encap:Ethernet HWaddr 02:EF:5A:*CENSORED*
lo Link encap:Local Loopback
r_rmnet_data0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
r_rmnet_data1 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
r_rmnet_data2 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
r_rmnet_data3 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
r_rmnet_data4 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
r_rmnet_data5 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
r_rmnet_data6 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
r_rmnet_data7 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
r_rmnet_data8 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
rmnet_data0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
rmnet_data1 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
rmnet_data2 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
rmnet_data3 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
rmnet_data4 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
rmnet_data5 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
rmnet_data6 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
rmnet_data7 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
rmnet_ipa0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
rndis0 Link encap:Ethernet HWaddr 6A:EE:F8:*CENSORED*
sit0 Link encap:IPv6-in-IPv4
wlan0 Link encap:Ethernet HWaddr 64:BC:0C:*CENSORED*

No idea what the rmnet interfaces are; I tried to set the IP of rmnet_ipa0 to 0.0.0.0, but it seemed to have no effect...

Any clues?