gounthar
Posts: 29
Joined: Mon Jul 29, 2013 1:39 pm

Raspbian Stretch: Setting a static IP for an USB to Ethernet adapter

Wed Oct 03, 2018 4:47 pm

Hi,

I have read quite a few tutorials regarding setting up a static IP for the Pi.
Unfortunately, I haven't been successful in implementing it yet.
My use case is:
  • a device is flooding my local network with a video broadcast (my ISP box can't handle it and I lose my wifi network)
  • I'd like to use the Pi to catch the broadcast, and reroute it maybe thanks to netcat
  • I thought of linking directly the flooding device to the Ethernet to USB adapter... but I don't know if this could work with a straight cable
Anyway... If the straight cable doesn't work, I can still use a small RJ45 switch.

My Raspbian version is:

Code: Select all

lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 9.4 (stretch)
Release:        9.4
Codename:       stretch
The USB to Ethernet device is a ASIX Electronics Corp. AX88772A Fast Ethernet.
I can see it in ifconfig:

Code: Select all

enx00010a0abc98: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 00:01:0a:0a:bc:98  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
The last tutorial I followed is https://raspberrypi.stackexchange.com/q ... 4428#74428.
So my /etc/dhcpcd.conf looks like:

Code: Select all

interface enx00010a0abc98
static ip_address 192.168.0.16/24
static routers=192.168.0.254
static domain_name_servers=212.27.40.241
I must have missed something, as ifconfig keeps telling me that there is no IP address for enx00010a0abc98.
Could anyone help?
Thanks.
2*3B at home for the kids
7*3B+ at work for serious business (gitlab-runner, broadcasting conference, openSTF server...)
Hoping to get a few hats in the following weeks

drgeoff
Posts: 11382
Joined: Wed Jan 25, 2012 6:39 pm

Re: Raspbian Stretch: Setting a static IP for an USB to Ethernet adapter

Wed Oct 03, 2018 5:05 pm

gounthar wrote:
Wed Oct 03, 2018 4:47 pm
Hi,
So my /etc/dhcpcd.conf looks like:

Code: Select all

interface enx00010a0abc98
static ip_address 192.168.0.16/24
static routers=192.168.0.254
static domain_name_servers=212.27.40.241
If that is a true representation, you have omitted the equals sign in the IP address assignment line.
Quis custodiet ipsos custodes?

gounthar
Posts: 29
Joined: Mon Jul 29, 2013 1:39 pm

Re: Raspbian Stretch: Setting a static IP for an USB to Ethernet adapter

Wed Oct 03, 2018 5:45 pm

Thanks. I corrected, so that I now have

Code: Select all

interface enx00010a0abc98
static ip_address=192.168.0.16/24
static routers=192.168.0.254
static domain_name_servers=212.27.40.241
Unfortunately, I still have

Code: Select all

 ifconfig
enx00010a0abc98: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 00:01:0a:0a:bc:98  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enxb827eb30e66b: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.15  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::7872:26c5:40e6:2515  prefixlen 64  scopeid 0x20<link>
        inet6 2a01:e34:eea8:9b50:9b46:1205:f5c:3b0  prefixlen 64  scopeid 0x0<global>
        ether b8:27:eb:30:e6:6b  txqueuelen 1000  (Ethernet)
        RX packets 171  bytes 13095 (12.7 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 132  bytes 21952 (21.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
Does the Ethernet to USB have to be connected to anything to get a fixed IP address?
2*3B at home for the kids
7*3B+ at work for serious business (gitlab-runner, broadcasting conference, openSTF server...)
Hoping to get a few hats in the following weeks

BrendenCom
Posts: 1
Joined: Mon Sep 14, 2020 3:19 am

Re: Raspbian Stretch: Setting a static IP for an USB to Ethernet adapter

Mon Sep 14, 2020 4:28 am

"Does the Ethernet to USB have to be connected to anything to get a fixed IP address?"

Mine does. 10.4 on pi4b

Return to “Troubleshooting”