# Changing USB-ETH interface IP

**URL:** <https://forum.clockworkpi.com/t/changing-usb-eth-interface-ip/5175>\
**Category:** Tutorials\
**Created:** [January 18, 2020, 5:39pm UTC](https://forum.clockworkpi.com/t/changing-usb-eth-interface-ip/5175 "2020-01-18T17:39:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![madvan](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/madvan/32/3683_2.png) [@madvan](https://forum.clockworkpi.com/u/madvan)\
**Post date:** [January 18, 2020, 5:39pm UTC](https://forum.clockworkpi.com/t/changing-usb-eth-interface-ip/5175/1 "2020-01-18T17:39:59Z")

</div>

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](mailto: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

 ![DEOT_usb-eth](https://canada1.discourse-cdn.com/flex029/uploads/clockworkpi/original/2X/5/5f1c42b710f2cbc3f0fbea020ce4ceba9f504ed9.jpeg)

**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: [GitHub - clockworkpi/USB-Ethernet: Setup USB Ethernet](https://github.com/clockworkpi/USB-Ethernet)

---

<div class="post-metadata">

**Author:** ![Wizz](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/wizz/32/216_2.png) [@Wizz](https://forum.clockworkpi.com/u/Wizz)\
**Post date:** [January 19, 2020, 10:56am UTC](https://forum.clockworkpi.com/t/changing-usb-eth-interface-ip/5175/2 "2020-01-19T10:56:07Z")

</div>

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