# RFSoC 4x2 issue with dynamic IP

**URL:** <https://discuss.pynq.io/t/rfsoc-4x2-issue-with-dynamic-ip/7262>\
**Category:** Support\
**Created:** [July 10, 2024, 9:18am UTC](https://discuss.pynq.io/t/rfsoc-4x2-issue-with-dynamic-ip/7262 "2024-07-10T09:18:38Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![frp](https://avatars.discourse-cdn.com/v4/letter/f/a183cd/32.png) [@frp](https://discuss.pynq.io/u/frp)\
**Post date:** [July 10, 2024, 9:18am UTC](https://discuss.pynq.io/t/rfsoc-4x2-issue-with-dynamic-ip/7262/1 "2024-07-10T09:18:38Z")

</div>

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

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?

---

<div class="post-metadata">

**Author:** ![marioruiz](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/marioruiz/32/2177_2.png) [@marioruiz](https://discuss.pynq.io/u/marioruiz)\
**Post date:** [July 10, 2024, 3:01pm UTC](https://discuss.pynq.io/t/rfsoc-4x2-issue-with-dynamic-ip/7262/2 "2024-07-10T15:01:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![frp](https://avatars.discourse-cdn.com/v4/letter/f/a183cd/32.png) [@frp](https://discuss.pynq.io/u/frp)\
**Post date:** [July 10, 2024, 4:12pm UTC](https://discuss.pynq.io/t/rfsoc-4x2-issue-with-dynamic-ip/7262/3 "2024-07-10T16:12:59Z")

</div>

The original configuration was:

```auto
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
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`

```auto
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:

```auto
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,

---

<div class="post-metadata">

**Author:** ![marioruiz](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/marioruiz/32/2177_2.png) [@marioruiz](https://discuss.pynq.io/u/marioruiz)\
**Post date:** [July 11, 2024, 5:34am UTC](https://discuss.pynq.io/t/rfsoc-4x2-issue-with-dynamic-ip/7262/4 "2024-07-11T05:34:55Z")

</div>

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

Mario

---

<div class="post-metadata">

**Author:** ![frp](https://avatars.discourse-cdn.com/v4/letter/f/a183cd/32.png) [@frp](https://discuss.pynq.io/u/frp)\
**Post date:** [July 11, 2024, 6:58am UTC](https://discuss.pynq.io/t/rfsoc-4x2-issue-with-dynamic-ip/7262/5 "2024-07-11T06:58:00Z")

</div>

Hi @marioruiz ,

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

---

<div class="post-metadata">

**Author:** ![marioruiz](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/marioruiz/32/2177_2.png) [@marioruiz](https://discuss.pynq.io/u/marioruiz)\
**Post date:** [July 11, 2024, 4:47pm UTC](https://discuss.pynq.io/t/rfsoc-4x2-issue-with-dynamic-ip/7262/6 "2024-07-11T16:47:29Z")

</div>

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](https://netplan.readthedocs.io/en/latest/examples/#how-to-enable-dhcp-on-an-interface)

You should put the file in `/etc/netplan/`

Mario

---

<div class="post-metadata">

**Author:** ![frp](https://avatars.discourse-cdn.com/v4/letter/f/a183cd/32.png) [@frp](https://discuss.pynq.io/u/frp)\
**Post date:** [July 12, 2024, 6:44am UTC](https://discuss.pynq.io/t/rfsoc-4x2-issue-with-dynamic-ip/7262/7 "2024-07-12T06:44:59Z")

</div>

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.

```auto
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.

```

---

<div class="post-metadata">

**Author:** ![frp](https://avatars.discourse-cdn.com/v4/letter/f/a183cd/32.png) [@frp](https://discuss.pynq.io/u/frp)\
**Post date:** [July 12, 2024, 1:44pm UTC](https://discuss.pynq.io/t/rfsoc-4x2-issue-with-dynamic-ip/7262/8 "2024-07-12T13:44:59Z")

</div>

Hi @marioruiz ,

I also add the output of `sudo systemctl status networking`

```auto
× 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

---

<div class="post-metadata">

**Author:** ![frp](https://avatars.discourse-cdn.com/v4/letter/f/a183cd/32.png) [@frp](https://discuss.pynq.io/u/frp)\
**Post date:** [July 16, 2024, 12:33pm UTC](https://discuss.pynq.io/t/rfsoc-4x2-issue-with-dynamic-ip/7262/9 "2024-07-16T12:33:01Z")

</div>

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](https://serverfault.com/questions/1102403/debian-11-no-longer-automatically-receiving-static-dhcp-ip-address-dhclient-mus)

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.

---

<div class="post-metadata">

**Author:** ![marioruiz](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/marioruiz/32/2177_2.png) [@marioruiz](https://discuss.pynq.io/u/marioruiz)\
**Post date:** [July 16, 2024, 1:01pm UTC](https://discuss.pynq.io/t/rfsoc-4x2-issue-with-dynamic-ip/7262/10 "2024-07-16T13:01:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![marioruiz](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/marioruiz/32/2177_2.png) [@marioruiz](https://discuss.pynq.io/u/marioruiz)\
**Post date:** [July 16, 2024, 1:01pm UTC](https://discuss.pynq.io/t/rfsoc-4x2-issue-with-dynamic-ip/7262/11 "2024-07-16T13:01:24Z")

</div>


