How to provide internet access to jetson nano from another ubuntu 20.04 pc using a usb-c cable?

Brief summary: I have a jetson nano and I can’t provide internet access to it from my ubuntu 20.04 pc using a usb-c cable when connected to wifi from my cellphone hotspot. I followed the README-usb-dev-mode (steps copied at the bottom) instructions and still I don’t have internet access in the jetson nano.

Device: reComputer J1010 -Edge AI Device with Jetson Nano

Detailed steps

  1. connected to my jetson using ssh command. This worked fine.

  2. get ip_forward value on my local pc:

cat /proc/sys/net/ipv4/ip_forward
1
  1. List network interfaces of my local pc
ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: wlp0s20f3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether f0:9e:4a:b1:b7:82 brd ff:ff:ff:ff:ff:ff
    inet 172.20.10.6/28 brd 172.20.10.15 scope global dynamic noprefixroute wlp0s20f3
       valid_lft 85737sec preferred_lft 85737sec
    inet6 2001:8004:4610:58f0:a482:82b6:3265:48d0/64 scope global temporary dynamic 
       valid_lft 604140sec preferred_lft 85524sec
    inet6 2001:8004:4610:58f0:28f7:c3e1:c592:e37a/64 scope global mngtmpaddr noprefixroute 
       valid_lft forever preferred_lft forever
    inet6 fe80::4d5:9f37:b57b:1de/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
3: gpd0: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 500
    link/none 
4: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default 
    link/ether 02:42:2f:b9:87:8a brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever
5: br-7db12790b56e: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default 
    link/ether 02:42:9b:58:7c:64 brd ff:ff:ff:ff:ff:ff
    inet 172.18.0.1/16 brd 172.18.255.255 scope global br-7db12790b56e
       valid_lft forever preferred_lft forever
7: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000
    link/ether d2:fc:2f:af:66:45 brd ff:ff:ff:ff:ff:ff
    inet 192.168.55.100/24 brd 192.168.55.255 scope global dynamic noprefixroute usb0
       valid_lft 9sec preferred_lft 9sec
    inet6 fe80::3b05:7fcb:3d4b:ee40/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
8: enxeeb3e9b762ca: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether ee:b3:e9:b7:62:ca brd ff:ff:ff:ff:ff:ff
    inet6 fe80::4efa:8687:38b0:2b93/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
9: enx00e04c6801d3: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
    link/ether 00:e0:4c:68:01:d3 brd ff:ff:ff:ff:ff:ff
  1. I assume the interface connected to the upstream network is “wlp0s20f3”
ip addr show wlp0s20f3
2: wlp0s20f3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether f0:9e:4a:b1:b7:82 brd ff:ff:ff:ff:ff:ff
    inet 172.20.10.6/28 brd 172.20.10.15 scope global dynamic noprefixroute wlp0s20f3
       valid_lft 85641sec preferred_lft 85641sec
    inet6 2001:8004:4610:58f0:a482:82b6:3265:48d0/64 scope global temporary dynamic 
       valid_lft 604044sec preferred_lft 85428sec
    inet6 2001:8004:4610:58f0:28f7:c3e1:c592:e37a/64 scope global mngtmpaddr noprefixroute 
       valid_lft forever preferred_lft forever
    inet6 fe80::4d5:9f37:b57b:1de/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
  1. Enable network address translation. I’m not sure if this has to be done in the jetson nano or local pc but this is what I did and still didn’t work.
  • First enabled NAT on my local pc → check for internet connection on jetosn → no internet
  • Tested internet connection on my local pc → works
  • Last, enable NAT on jetson nano → still no internet

This is the command I used for adding the translation:

sudo iptables -t nat -A POSTROUTING -o wlp0s20f3 -j SNAT --to 172.20.10.6

When I say there is no internet I tried 3 things:

  • clonning the repo from the Hello AI World tutorial from the ssh connection
git clone --recursive --depth=1 https://github.com/dusty-nv/jetson-inference
Cloning into 'jetson-inference'...
fatal: unable to access 'https://github.com/dusty-nv/jetson-inference/': Could not resolve host: github.com
  • do supo apt update from the ssh connection:
sudo apt update 
[sudo] password for user: 
Err:1 http://ports.ubuntu.com/ubuntu-ports bionic InRelease         
  Could not resolve 'ports.ubuntu.com'
Err:2 https://repo.download.nvidia.com/jetson/common r32.7 InRelease
  Could not resolve 'repo.download.nvidia.com'
Err:3 http://ports.ubuntu.com/ubuntu-ports bionic-updates InRelease
  Could not resolve 'ports.ubuntu.com'
Err:4 https://repo.download.nvidia.com/jetson/t210 r32.7 InRelease
  Could not resolve 'repo.download.nvidia.com'
Err:5 http://ports.ubuntu.com/ubuntu-ports bionic-backports InRelease
  Could not resolve 'ports.ubuntu.com'
Err:6 http://ports.ubuntu.com/ubuntu-ports bionic-security InRelease
  Could not resolve 'ports.ubuntu.com'
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/bionic/InRelease  Could not resolve 'ports.ubuntu.com'
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/bionic-updates/InRelease  Could not resolve 'ports.ubuntu.com'
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/bionic-backports/InRelease  Could not resolve 'ports.ubuntu.com'
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/bionic-security/InRelease  Could not resolve 'ports.ubuntu.com'
W: Failed to fetch https://repo.download.nvidia.com/jetson/common/dists/r32.7/InRelease  Could not resolve 'repo.download.nvidia.com'
W: Failed to fetch https://repo.download.nvidia.com/jetson/t210/dists/r32.7/InRelease  Could not resolve 'repo.download.nvidia.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
  • finally connected the jetson to a monitor and tried to access different web pages in the browser and run the previous commands from within the jetson instead of the ssh from my local pc

    README-usb-dev-mode documentation from the jetson nano:

=======================================================================
README-usb-dev-mode
Linux for Tegra
USB Device Mode

The USB device mode configuration script configures the Tegra USB flashing port
to act as a USB device and implement various protocols. The script allows a USB
host system to interact with the Tegra device using a USB cable. The following
implemented protocols can be used at the same time:

  • Ethernet: allows system login using SSH and high-bandwidth file copying using
    SFTP.
  • UART/Serial: allows system login using a terminal application.
  • USB Mass Storage: Similar in concept to a USB memory stick.

Using Ethernet Protocol

Linux for Tegra implements two types of Ethernet devices to support various
operating systems running on the USB host machine. It is safe to ignore system
errors for missing drivers for an RNDIS or an NCM device. If your system
supports both devices, either device can be used. However, do not configure
both devices at the same time.

Linux for Tegra assigns a link-local IPv6 address of fe80::1 to the USB
Ethernet device(s). You should not have to configure your host machine in order
to use an IPv6 link-local address. If you connect multiple Jetson devices to
the same host machine, each Jetson device uses the same IPv6 link-local address.
You may still connect to any connected Jetson device, however, since use of IPv6
link-local addresses also requires specifying which network interface to
connect over, and there is a unique interface for each Jetson.

Linux for Tegra assigns a static IPv4 address of 192.168.55.1 to Jetson, and
runs a DHCP server to automatically assign an IPv4 address of 192.168.55.100 to
your host machine. This provides point-to-point connectivity. If a Jetson
device experiences very high CPU or disk IO load, this DHCP server may fail to
respond in a timely manner to requests from the host machine. This may cause
IPv4 connections to drop. If this problem occurs, configure your host machine
to use a static IPv4 address of 192.168.55.100 with netmask 255.255.255.0 and
no gateway or DNS servers.

Linux for Tegra configures a very low priority default IPv4 route on the USB
Ethernet device(s), and configures Google’s public DNS server (8.8.8.8) as the
fallback DNS server for use when no other network connection is available.
This allows your host machine to act as an Intranet or Internet gateway for
Jetson.

If you connect multiple Jetson devices to the same host machine, each Jetson
device uses the same IPv4 address. This prevents IPv4-based communication with
all but one Jetson device, since your host operating system determines which
Jetson device it communicates with. To solve this, edit the Jetson-based script
that sets up the network and assign a unique network address to each Jetson
device. IPv6-based communication works with any number of Jetson devices
without modifying the aforementioned script.

Once the Ethernet device is configured, use SSH to connect to the Jetson device.

SSH is natively available on Linux and Macintosh operating systems. Connect using
IPv6 with the following command:

ssh nvidia@fe80::1%usb0

Connect using IPv4 with the following command:

ssh nvidia@192.168.55.1

On Windows, use the PuTTY application.

Ethernet on Linux

Two USB Ethernet devices are created and the required drivers are automatically
activated. These devices are typically named usb0 and usb1, depending on how
your Linux distribution is configured, and what other hardware is attached to
the system. To avoid the potential for interference between the two USB
Ethernet devices, it is best, but not strictly required, to use your host’s
network configuration tool (e.g. Network Manager), to disable one of the two
USB Ethernet interfaces implemented by the Jetson device.

View available Ethernet devices with the following command:

/sbin/ifconfig -a

Knowledge of the Ethernet device name is required in order to use IPv6
link-local addresses.

Use the following procedure to configure your host as a gateway for Jetson.

  1. Enable IP forwarding with your host’s configuration tools, or by running
    the following command as root:

    echo 1 > /proc/sys/net/ipv4/ip_forward

    If your host system is connected to multiple networks at the same time,
    please consider any security implications of this configuration change.

    Depending on your Linux distribution, you may be able to make this change
    permanent by editing /etc/sysctl.conf.

  2. Enable Network Address Translation (NAT) using your host’s configuration
    tools to do this, or by running the following command as root:

    iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to 192.168.1.100

    where:
    eth0 is the name of your host’s upstream Ethernet interface.
    192.168.1.100 is your host’s IP address on that interface.

Depending on your Linux distribution, you may have to run this command every
time your host is rebooted.

Ethernet on Windows

An RNDIS USB Ethernet device is created, and the required driver is
automatically installed. You can safely ignore the message that the NCM device
is unknown.

Ethernet on Mac

An NCM USB Ethernet device is created, and the required driver is automatically
activated. Since the Mac operating system does not support the RNDIS device,
the device is not activated by default.

Changing the IPv4 Address

Edit /opt/nvidia/l4t-usb-device-mode/nv-l4t-usb-device-mode-config.sh on Jetson
to change the IPv4 network parameters. The following variables must be changed,
and must maintain consistent values:

  • net_ip
  • net_mask
  • net_net
  • net_dhcp_start
  • net_dhcp_end

Using the Serial Port

Linux for Tegra implements a single USB serial port, and presents a login
prompt on the port. You may log into the system and run shell commands over
this port.

Any standard serial terminal application may be used with the port. For
example:

  • Screen (Linux/Mac)
  • Picocom (Linux)
  • Tera Term (Windows)
  • HyperTerminal (Windows)

Since this is an emulated serial port, any baud rate will work. The port must
be configured for 8N1 (8-bits per character, no stop bit, 1 parity bit).

Serial Port on Linux

Linux creates a device such as /dev/ttyACM0 for the serial port. To locate the
exact name:

  1. Launch a shell prompt.
  2. Run the command: ls /dev.
  3. Search for “ACM”.

Serial Port on Windows

Windows creates a standard COM port device for the serial port.

On systems using an operating system prior to Windows 10, you must manually
install the driver for the serial port. To install the driver:

  1. Open Device Manager.
  2. Locate the “CDC Serial” device.
  3. Right-click the device and select “update Driver Software”.
  4. Select to Browse for the driver software.
  5. Set the path to the USB disk drive that is implemented by your Linux for
    Tegra device.

Windows will locate the required .inf file and install the relevant drivers for
the serial port.

Serial Port on Mac

Mac OS creates a device such as /dev/tty.usbmodem1232 for the serial port. To
locate the exact name:

  1. Launch a shell prompt.
  2. Run the command: ls /dev.
  3. Search for “tty.usbmodem”.

Using USB Mass Storage

Linux for Tegra implements a USB Mass Storage device, known as a USB disk or
USB memory stick, that is natively supported by all operating systems. The USB
disk automatically appears in the graphical filesystem browser such as:

  • Linux desktop
  • Windows Explorer
  • Mac Finder

On Linux or Mac, you can manually mount the disk from the command line, just
like a USB storage device.

The USB storage device is read-only and contains various driver files and Linux
for Tegra documentation.


Disabling USB Device Mode Temporarily

To disable USB device mode temporarily:

  1. On the Linux for Tegra system, launch a shell prompt.
  2. Log in as root.
  3. Execute the command:
    service nv-l4t-usb-device-mode stop

To re-enable USB device mode:

  1. On the Linux for Tegra system, launch a shell prompt.
  2. Log in as root.
  3. Execute the command:
    service nv-l4t-usb-device-mode start

USB device mode will be re-enabled automatically the next time the system is
rebooted.


Disabling USB Device Mode Permanently

To disable USB device mode permanently:

  1. On the Linux for Tegra system, launch a shell prompt.
  2. Log in as root.
  3. Execute the commands:
    service nv-l4t-usb-device-mode stop
    systemctl disable nv-l4t-usb-device-mode.service

This is equivalent to deleting the following files:

/etc/systemd/system/nv-l4t-usb-device-mode.service
/etc/systemd/system/multi-user.target.wants/nv-l4t-usb-device-mode.service

To re-enable USB device mode, execute the commands:

systemctl enable /opt/nvidia/l4t-usb-device-mode/nv-l4t-usb-device-mode.service
service nv-l4t-usb-device-mode start

Hi,
Please try USB tethering. There was an issue but it is fixed in latest Jetpack 4 release. Please give it a try. May refer to discussion in
Android USB tethering not working - #10 by DaneLLL

I just flashed my jetson nano with Jetson Linux R32.7.4 which is part of JetPack 4.6.4.

  1. Can you please tell me exactly in which JetPack version this problem is fixed?

  2. Can you briefly explain what the problem is since the link you provided is a 4-year-old post with a lot of content, many links, and a different setup than mine?

  3. For the same reason as the previous point, can you briefly describe the high-level steps for the fix?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.