clockworkpi

Changing USB-ETH interface IP

I decided to create this tutorial because I facing a problem when I connected my GameShell in a Wireless that use the same network as usb-eth – 192.168.10.0/24 – thus generating problems such as IP conflict.

Connect on your GameShell

To do it is necessary to connect on GameShell via ssh, you can disconnect the wifi on GameShell and use just the interface usb-eth if you are on the wifi with this problem while you solve this issue.

~$ ssh cpi@192.168.1.169(your GameShell IP)

Change the interface IP

Edit the /etc/network/interfaces file on the line usb0 address , In this case I used a class A IP network rarely used 11.11.11.0/24.

cpi@DEOT:~$ sudo vim /etc/network/interfaces

from:

allow-hotplug usb0
auto usb0
iface usb0 inet static
      address 192.168.10.1
      netmask 255.255.255.0

to:

allow-hotplug usb0
auto usb0
iface usb0 inet static
	address 11.11.11.11
	netmask 255.255.255.0

Change DHCP range

The GameShell use the dhcp-server to make the connection easy, so its necessary to edit the file /etc/dhcp/dhcpd.conf and change the range of IP that will be distributed, I chose a short range of IP .100 to .105, that is more than enough.

cpi@DEOT:~$ sudo vim /etc/dhcp/dhcpd.conf 

from:

subnet 192.168.10.0 netmask 255.255.255.0 {
  range 192.168.10.10 192.168.10.250;
}

to:

subnet 11.11.11.0 netmask 255.255.255.0 {
	range 11.11.11.100 11.11.11.105;

Change CONNECT script

The CONNET app shows the USB-Ethernet interface IP as text, so it is necessary to make the change on the script manually. Edit the file __init__.py:

cpi@DEOT:~$ sudo vim /home/cpi/launcher/Menu/GameShell/60_CONNECT/__init__.py

from:

[“usb-eth-addr”,“192.168.10.1”, self._ListFontObj, self._URLColor]]

to:

[“usb-eth-addr”,“11.11.11.11”, self._ListFontObj, self._URLColor]]

— Restart you GameShell and test it!

cpi@DEOT:~$ sudo reboot

Check the UI on GameShell:

MENU > CONNECT

Connect a USB cable to test DHCP

Connect a USB cable on the GameShell and check the usb-eth connection on your computer:

:~$ sudo ifconfig

enp0s26u1u2 Link encap:Ethernet  HWaddr ▀:▀:▀:▀:▀:▀  
          inet addr:11.11.11.103  Bcast:11.11.11.255  Mask:255.255.255.0
          Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:77 errors:1 dropped:0 overruns:0 frame:0
          TX packets:192 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:10796 (10.7 KB)  TX bytes:24160 (24.1 KB)

Connect on GameShell to test the connection:

:~$ ssh cpi@11.11.11.11
cpi@DEOT:~$ sudo ifconfig
usb0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 11.11.11.11  netmask 255.255.255.0  broadcast 11.11.11.255
        ether ▀:▀:▀:▀:▀:▀  txqueuelen 1000  (Ethernet)
      RX packets 196  bytes 16380 (15.9 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 168  bytes 31292 (30.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Helpful link: https://github.com/clockworkpi/USB-Ethernet

4 Likes

Thanks for the write-up! Really useful and comprehensive !

1 Like