RFSoC 4x2 issue with dynamic IP

Hello,

I have just purchased the RF soc 4x2. I have updated the image with pynq 3.0.1. I have connected the board to my PC with micro USB. The board is connected to a switch to the lab network that provides IP through DHCP (mac address registered).

Connecting with Putty to the board I noticed that /etc/network/interfaces.d/eth0 has the following content:


auto eth0
iface eth0 inet dhcp

auto eth0:1
iface eth0:1 inet static
address 192.168.2.99
netmask 255.255.255.0

Therefore I suppose it is configured to static. Commenting the last 4 line and restarting network services with:

sudo systemctl restart networking

I get no IP address. However, if I run: sudo dhclient eth0

I’m able to get the IP address, but If I restart the board the IP is lost and it shows NO IP Detected.

Can someone help me solving this issue?

1 Like

Hi @frp,

Welcome to the PYNQ community.

eth0 is set to dynamically get an IP address, but eth0:1 is set to 192.168.2.99, this is kind of a virtual IP.

Are you not getting the dynamic IP with the original configuration? what is the output of ifconfig?

Mario

1 Like

The original configuration was:

auto eth0
iface eth0 inet dhcp

auto eth0:1
iface eth0:1 inet static
address 192.168.2.99
netmask 255.255.255.0

The new one:

auto eth0
iface eth0 inet dhcp

But it doesn’t get the IP automatically. I need to run sudo dhclient eth0 to get it, but when I reboot the board it is not able to obtain it…

Here the output of ifconfig eth0

xilinx@pynq:~$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::fec2:3dff:fe37:8c9  prefixlen 64  scopeid 0x20<link>
        ether fc:c2:3d:37:08:c8  txqueuelen 1000  (Ethernet)
        RX packets 975  bytes 80964 (80.9 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 12  bytes 2072 (2.0 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 37

Here the output after running dhclient eth0:

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.165.235  netmask 255.255.255.0  broadcast 192.168.165.255
        inet6 fe80::fec2:3dff:fe37:8c9  prefixlen 64  scopeid 0x20<link>
        ether fc:c2:3d:37:08:c8  txqueuelen 1000  (Ethernet)
        RX packets 39733  bytes 4197817 (4.1 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2674  bytes 3562349 (3.5 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 37
...

Best,

1 Like

To confirm, did you get a dynamic IP with the original configuration?

Mario

1 Like

Hi @marioruiz ,

no with the original configuration the display showed NO IP Detected.

1 Like

That’s interesting.

Are you familiar with netplan? You could try to setup a YAML file with the configuration and see if it works. How to enable DHCP on an interface - Netplan documentation

You should put the file in /etc/netplan/

Mario

1 Like

Hi @marioruiz ,

I’m not familiar with netplan but I’ll try today.

By looking at journalcl with journalctl | grep -Ei 'dhcp' I get the following.

Jul 12 06:37:45 pynq dhclient[395]: Internet Systems Consortium DHCP Client 4.4.1
Jul 12 06:37:45 pynq sh[395]: Internet Systems Consortium DHCP Client 4.4.1
Jul 12 06:37:45 pynq sh[395]: For info, please visit https://www.isc.org/software/dhcp/
Jul 12 06:37:45 pynq dhclient[395]: For info, please visit https://www.isc.org/software/dhcp/
Jul 12 06:37:45 pynq sh[395]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3 (xid=0xa0a08f4a)
Jul 12 06:37:45 pynq dhclient[395]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3 (xid=0xa0a08f4a)
Jul 12 06:37:48 pynq dhclient[395]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4 (xid=0xa0a08f4a)
Jul 12 06:37:48 pynq sh[395]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4 (xid=0xa0a08f4a)
Jul 12 06:37:52 pynq dhclient[395]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4 (xid=0xa0a08f4a)
Jul 12 06:37:52 pynq sh[395]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4 (xid=0xa0a08f4a)
Jul 12 06:37:56 pynq dhclient[395]: No DHCPOFFERS received.
Jul 12 06:37:56 pynq sh[395]: No DHCPOFFERS received.
Jul 12 06:37:57 pynq systemd[1]: Started ISC DHCP IPv4 server.
Jul 12 06:37:57 pynq systemd[1]: Started ISC DHCP IPv6 server.
Jul 12 06:37:57 pynq dhcpd[737]: Internet Systems Consortium DHCP Server 4.4.1
Jul 12 06:37:57 pynq dhcpd[741]: Internet Systems Consortium DHCP Server 4.4.1
Jul 12 06:37:57 pynq sh[737]: Internet Systems Consortium DHCP Server 4.4.1
Jul 12 06:37:57 pynq sh[737]: For info, please visit https://www.isc.org/software/dhcp/
Jul 12 06:37:57 pynq dhcpd[737]: Copyright 2004-2018 Internet Systems Consortium.
Jul 12 06:37:57 pynq sh[741]: Internet Systems Consortium DHCP Server 4.4.1
Jul 12 06:37:57 pynq sh[741]: For info, please visit https://www.isc.org/software/dhcp/
Jul 12 06:37:57 pynq dhcpd[741]: Copyright 2004-2018 Internet Systems Consortium.
Jul 12 06:37:57 pynq dhcpd[741]: All rights reserved.
Jul 12 06:37:57 pynq dhcpd[737]: All rights reserved.
Jul 12 06:37:57 pynq dhcpd[737]: For info, please visit https://www.isc.org/software/dhcp/
Jul 12 06:37:57 pynq dhcpd[741]: For info, please visit https://www.isc.org/software/dhcp/
Jul 12 06:37:57 pynq dhcpd[741]: Config file: /etc/dhcp/dhcpd6.conf
Jul 12 06:37:57 pynq sh[737]: Config file: /etc/dhcp/dhcpd.conf
Jul 12 06:37:57 pynq sh[737]: Database file: /var/lib/dhcp/dhcpd.leases
Jul 12 06:37:57 pynq sh[737]: PID file: /run/dhcp-server/dhcpd.pid
Jul 12 06:37:57 pynq sh[741]: Config file: /etc/dhcp/dhcpd6.conf
Jul 12 06:37:57 pynq sh[741]: Database file: /var/lib/dhcp/dhcpd6.leases
Jul 12 06:37:57 pynq sh[741]: PID file: /run/dhcp-server/dhcpd6.pid
Jul 12 06:37:57 pynq dhcpd[741]: Database file: /var/lib/dhcp/dhcpd6.leases
Jul 12 06:37:57 pynq dhcpd[741]: PID file: /run/dhcp-server/dhcpd6.pid
Jul 12 06:37:57 pynq dhcpd[737]: Config file: /etc/dhcp/dhcpd.conf
Jul 12 06:37:57 pynq dhcpd[737]: Database file: /var/lib/dhcp/dhcpd.leases
Jul 12 06:37:57 pynq dhcpd[737]: PID file: /run/dhcp-server/dhcpd.pid
Jul 12 06:37:57 pynq dhcpd[737]: Wrote 0 leases to leases file.
Jul 12 06:37:57 pynq dhcpd[741]: Wrote 0 NA, 0 TA, 0 PD leases to lease file.
Jul 12 06:37:57 pynq dhcpd[741]:
Jul 12 06:37:57 pynq sh[741]:    in your dhcpd.conf file for the network segment
Jul 12 06:37:57 pynq sh[741]:    in your dhcpd.conf file for the network segment
Jul 12 06:37:57 pynq dhcpd[741]: No subnet6 declaration for usb0 (no IPv6 addresses).
Jul 12 06:37:57 pynq dhcpd[741]: ** Ignoring requests on usb0.  If this is not what
Jul 12 06:37:57 pynq dhcpd[741]:    you want, please write a subnet6 declaration
Jul 12 06:37:57 pynq dhcpd[741]:    in your dhcpd.conf file for the network segment
Jul 12 06:37:57 pynq dhcpd[741]:    to which interface usb0 is attached. **
Jul 12 06:37:57 pynq dhcpd[741]:
Jul 12 06:37:57 pynq dhcpd[741]:
Jul 12 06:37:57 pynq dhcpd[741]: No subnet6 declaration for eth0 (fe80::fec2:3dff:fe37:8c9).
Jul 12 06:37:57 pynq dhcpd[741]: ** Ignoring requests on eth0.  If this is not what
Jul 12 06:37:57 pynq dhcpd[741]:    you want, please write a subnet6 declaration
Jul 12 06:37:57 pynq dhcpd[741]:    in your dhcpd.conf file for the network segment
Jul 12 06:37:57 pynq dhcpd[741]:    to which interface eth0 is attached. **
Jul 12 06:37:57 pynq dhcpd[741]:
Jul 12 06:37:57 pynq systemd[1]: isc-dhcp-server6.service: Main process exited, code=exited, status=1/FAILURE
Jul 12 06:37:57 pynq dhcpd[741]:
Jul 12 06:37:57 pynq systemd[1]: isc-dhcp-server6.service: Failed with result 'exit-code'.
Jul 12 06:37:57 pynq dhcpd[741]: Not configured to listen on any interfaces!
Jul 12 06:37:57 pynq dhcpd[741]:
Jul 12 06:37:57 pynq dhcpd[741]: If you think you have received this message due to a bug rather
Jul 12 06:37:57 pynq dhcpd[741]: than a configuration issue please read the section on submitting
Jul 12 06:37:57 pynq dhcpd[741]: bugs on either our web page at www.isc.org or in the README file
Jul 12 06:37:57 pynq dhcpd[741]: before submitting a bug.  These pages explain the proper
Jul 12 06:37:57 pynq dhcpd[741]: process and the information we find helpful for debugging.
Jul 12 06:37:57 pynq dhcpd[741]:
Jul 12 06:37:57 pynq dhcpd[741]: exiting.
Jul 12 06:37:57 pynq dhcpd[737]: Listening on LPF/usb0/2e:23:e3:88:26:5d/192.168.3.0/24
Jul 12 06:37:57 pynq sh[737]:    in your dhcpd.conf file for the network segment
Jul 12 06:37:57 pynq sh[737]: Can't create PID file /run/dhcp-server/dhcpd.pid: No such file or directory.
Jul 12 06:37:57 pynq dhcpd[737]: Sending on   LPF/usb0/2e:23:e3:88:26:5d/192.168.3.0/24
Jul 12 06:37:57 pynq dhcpd[737]:
Jul 12 06:37:57 pynq dhcpd[737]: No subnet declaration for eth0 (no IPv4 addresses).
Jul 12 06:37:57 pynq dhcpd[737]: ** Ignoring requests on eth0.  If this is not what
Jul 12 06:37:57 pynq dhcpd[737]:    you want, please write a subnet declaration
Jul 12 06:37:57 pynq dhcpd[737]:    in your dhcpd.conf file for the network segment
Jul 12 06:37:57 pynq dhcpd[737]:    to which interface eth0 is attached. **
Jul 12 06:37:57 pynq dhcpd[737]:
Jul 12 06:37:57 pynq dhcpd[737]: Sending on   Socket/fallback/fallback-net
Jul 12 06:37:57 pynq dhcpd[737]: Can't create PID file /run/dhcp-server/dhcpd.pid: No such file or directory.
Jul 12 06:37:57 pynq dhcpd[737]: Server starting service.
Jul 12 06:37:57 pynq dhclient[395]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3 (xid=0x8b237b03)
Jul 12 06:38:00 pynq dhclient[395]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3 (xid=0x8b237b03)
Jul 12 06:38:03 pynq dhclient[395]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 5 (xid=0x8b237b03)
Jul 12 06:38:08 pynq dhclient[395]: No DHCPOFFERS received.

1 Like

Hi @marioruiz ,

I also add the output of sudo systemctl status networking

× networking.service - Raise network interfaces
     Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor pr>
     Active: failed (Result: timeout) since Fri 2024-07-12 07:34:27 UTC; 6h ago
       Docs: man:interfaces(5)
    Process: 410 ExecStart=/sbin/ifup -a --read-environment (code=exited, statu>
   Main PID: 410 (code=exited, status=0/SUCCESS)
        CPU: 81ms

Jul 12 07:29:25 pynq systemd[1]: Starting Raise network interfaces...
Jul 12 07:29:26 pynq ifup[538]: /etc/network/if-up.d/resolved: 12: mystatedir: >
Jul 12 07:29:26 pynq ifup[410]: ifup: waiting for lock on /run/network/ifstate.>
Jul 12 07:34:25 pynq systemd[1]: networking.service: start operation timed out.>
Jul 12 07:34:25 pynq ifup[410]: Got signal Terminated, terminating...
Jul 12 07:34:27 pynq systemd[1]: networking.service: Failed with result 'timeou>
Jul 12 07:34:27 pynq systemd[1]: Failed to start Raise network interfaces.

That clearly shows some issue with the network service

Hi @marioruiz ,

the issue seems to be related to this problem mentioned here: linux - Debian 11 no longer automatically receiving static DHCP IP address, dhclient must be started manually - Server Fault

Adding send dhcp-client-identifier = hardware; to /etc/dhcp/dhclient.conf solved the problem.
Now rebooting I’m able to get the IP from DHCP server.

1 Like

This is great to know. Thank you for posting back the solution.