1 Reply Latest reply on Feb 4, 2015 9:39 AM by dylanTachyon

    USB network configuration

    mdw

      When Edison is not connected to WiFi but only over the USB host network, the network-gadget-init service may be used to configure the default gateway and the DNS resolution. Obviously the host needs to permit USB networking (eg. interface enp0s29f7u1 with network 192.168.3.0/24) and packet forwarding (net.ipv4.ip_forward = 1 in /etc/sysctl.conf with correct iptables configuration - Masquerading) when accessing other networks like Internet.

      I just wanted to share this for others.

       

      /etc/systemd/system/basic.target.wants/network-gadget-init.service:

      [Unit]

       

      Description=USB Ethernet gadget

       

       

       

       

       

      [Service]

       

      Type=oneshot

       

      ExecStartPre=-/bin/sh -c "echo 'connect' > /sys/class/udc/dwc3-device.1/soft_connect"

       

      ExecStart=-/bin/sh -c " ifconfig usb0 192.168.3.15; route add default gw 192.168.3.1; echo 'nameserver 192.168.10.206' > /etc/resolv.conf"

       

      ExecReload=-/bin/sh -c " ifconfig usb0 192.168.3.15"

       

      StandardError=syslog

       

      RemainAfterExit=no

       

       

       

      [Install]

       

      WantedBy=basic.target

        • 1. Re: USB network configuration
          dylanTachyon

          Hello,

          I was looking to accomplish USB network sharing. However, the host computer and Edison are sharing the same IP address over USB. How do I configure the network-gadget file you posted if that happens? In addition, do I use the same nameserver?

           

          -Thank you,

          Dylan