Provide internet through Micro USB while doing SSH

I want to connect Jetson Nano to the internet connection through the Micro USB which is being used for SSH!

If I’m not mistaken (and I could be, since i rarely connect via micro-usb), it already should work. When you ssh into your Jetson @, can you not then ping from the nano?

I tried to ping but didn’t work showed 100% packet loss!

Did you configure any firewall (eg. ufw, iptables) or change any network settings on your Ubuntu desktop?

Is your network environment special in any way (eg. outgoing restrictions on your router’s firewall)?

Can you ping your Ubuntu Desktop’s primary network interface IP address from then nano. You can find this by running “ifconfig” on your ubuntu desktop and looking for usually eth0 (wired) or wlan0 (wireless).

eg: run this on your Desktop

$ ifconfig
<b>eth0</b>: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet <b></b>  netmask  broadcast

Then ssh into the nano, and try to ping that IP address. That will at least tell us if forwarding is working.

Am using a Window 10 laptop as some of my 64bit college applications won’t run on Ubuntu wine!
I can SSH to nano through micro USB connected but can’t ping from Nano! I have a active internet connection through my mobile hotspot!
So the thing is mobile hotspot to my windows laptop then to Nano through micro USB! It is possible some way but am not able to understand how am gonna configure it!

If you have a connection to the Nano from Windows, and that works, then you would have to configure the host to forward to the internet for that connection if you want to make the internet available via Windows. On Windows I do not know how to do that, and I am not even sure if it can be done without extra software. Probably it depends on the edition/version to some extent.

You mean you are trying to run Windows apps on Ubuntu using Wine? Or do you mean you’re trying to run Linux apps on Windows using WSL 1 or 2?

Anyway, I’m curious now, are you connecting your nano to a Windows PC to try to access the internet?

That is unsupported. You would probably have to reconfigure the way the USB network is provided on the Nano to get it to work, and that’s not easy. The USB interface is intended to provide an internet connection for the Nano through a Linux machine.

You might consider connecting both your Nano and your Laptop to your phone via it’s wifi hotspot feature. That would likely work.

There are two ways I know of to share interent connections on Windows and both are precluded by the way the USB network interface is provided on the Nano.

  1. Internet connection sharing - turns your Windows PC into a router with a DHCP server for one of the interfaces. This won’t work because there is already a DHCP server on the Nano side, so the Nano would have to be configured as a DHCP client.

  2. Bridge - select two network interfaces in the control panel, right click, bridge. This is like making a virtual switch, where both interfaces appear to be plugged into. That won’t work here becuase there are DHCP servers on both sides and the Nano would need to be configured to use a DHCP client on the usb interface instead.

Either solution would work if the Nano was configured differently, but if it were, then the address wouldn’t be predictable, and wouldn’t “just work” when plugged into just about anything. Unfortunately none of this helps the poster, but somebody else who is adventurous and has time to spare might want to explore further.

To anybody reading this thread who is interested, the scripts and config for the usb device mode are found in /opt/nvidia/l4t-usb-device-mode/ and the unit file that launches all the things is nv-l4t-usb-device-mode.service

So is there any change that I can make in the script to forward the internet connection?
Let’s see… If I can change anything in that USB config file!

I don’t think so. You would have to modify the scripts as well.

Exactly I had ordered a wifi module from Amazon which didn’t come as the seller just vanished and now I need to boost my project as time is nearing.

So I simple want my nano a internet connection through the micro USB when connected to my windows machine!

So if you know which files should I make changes could you list them!

That config looks like the config for a DHCP daemon, so it probably won’t work no matter how you modify it.

If your project is on a deadline and the Amazon seller ran off, in a pinch you can plug your phone into one of the Nano’s A ports directly and it’ll likely provide a connection with USB tethering.

Then you can plug your laptop into the micro-usb port as you are doing right now and it might just work to get internet the other way around, but no guarantees. I haven’t tested it.

A bit of explanation on the USB virtual ethernet may help…

When the micro-B USB cable is used on the port the Nano looks like a device to the other side of the cable, and not a host (Nano is not wired to be a host on that port; the other Jetsons can work with either a type-B or a type-A cable and switch modes). Those scripts set up the “device” to appear to be a network device, and the host PC does not know this is a Nano. The host PC thinks this is a USB network/ethernet device.

The scripts also set up a DHCP server on the Nano. If the host PC sees the ethernet device, and then (by default) sends a DHCP query to get an address, then the Nano’s DHCP tells the PC to use address “”, with a netmask of “”. The Nano side is scripted to always use “” on the Nano. So the host PC is more or less not allowed to tell the adapter what to set up as. If your host PC can “ping” or “ping”, then you know the host PC listened to the Nano’s DHCP response.

Any behavior which forwards traffic via the host PC to the outside world over another connection is up to the host PC. Unless a lot of scripting is rewritten to tell the Jetson to request an address/netmask/route combination, versus its current setting to assign that setup, then “forwarding” or “bridging” within Windows would be the only possibility to make it work. This is trivial in Linux, but as @mdegans mentions, this is not so easy in Windows (and I am the wrong guy to suggest how to do that).