Score:1

Why does my Ethernet interface not get assigned an IP address by the DHCP server?

us flag

My machine has 1 built-in Ethernet port and I also plugged in a USB-Ethernet adapter. It looks like Linux correctly identified the new device, but it has no IP address.

Here is the output from ifconfig:

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.203.47  netmask 255.255.255.0  broadcast 192.168.203.255
        inet6 fe80::a5d:1df2:bcb0:eb9e  prefixlen 64  scopeid 0x20<link>
        ether e4:5f:01:df:77:92  txqueuelen 1000  (Ethernet)
        RX packets 14340  bytes 2287405 (2.1 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 10415  bytes 6577080 (6.2 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth1: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether f8:e4:3b:9f:e7:d6  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

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 1033  bytes 112633 (109.9 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1033  bytes 112633 (109.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Here is the output from ip addr:

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: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether e4:5f:01:df:77:92 brd ff:ff:ff:ff:ff:ff
    inet 192.168.203.47/24 brd 192.168.203.255 scope global dynamic noprefixroute eth0
       valid_lft 8638252sec preferred_lft 7558252sec
    inet6 fe80::a5d:1df2:bcb0:eb9e/64 scope link
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether e4:5f:01:df:77:93 brd ff:ff:ff:ff:ff:ff
6: eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether f8:e4:3b:9f:e7:d6 brd ff:ff:ff:ff:ff:ff

Here is the output from route:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.203.1   0.0.0.0         UG    202    0        0 eth0
192.168.203.0   0.0.0.0         255.255.255.0   U     202    0        0 eth0

What do I need to do to enable eth1?

EDIT

I tried unplugging the connection to the built-in interface (eth0) and only plugging in the cable for eth1. This caused me to get an IP address for that interface, and now both interfaces have IP addresses. The question still remains though, how can I force this behavior without unplugging the cables?

UPDATE

When I plug everything in before boot then I get both interfaces working. So it seems there is something in the boot sequence that also handles the adapter correctly. The only time it seems to not work is when I plug the adapter in while the other interface is already connected and working.

Artur Meinild avatar
vn flag
Which version of Ubuntu are you using?
nullromo avatar
us flag
This is on custom Raspbian built with pi-gen. My mistake, I thought it was Ubuntu but it's plain Debian. I should have posted this to unix.stackexchange.com instead... should I move the question? Or maybe it can still be answered here. I don't know if this is specific to Ubuntu or not.
Artur Meinild avatar
vn flag
It should be posted on [unix.se] and this will be closed - sorry.
nullromo avatar
us flag
Ok, I moved the question here https://unix.stackexchange.com/q/721657/384822
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.