Netplan Recipe For Fixed IP address

Hi all,

For those of you who require a fixed IP address on your PYNQ. The example sets the IP address using new Ubuntu 18.04 bionic netplan utilities with the fixed IP set to, a net mask of 24 bits indicated by the /24 in the ip address and a gateway of These need to be changed to values compatible with your specific network needs.

Note, as I am unable to upload a tar, yaml and sh files on this forum, I will just give you the content of the files in this post.

First create a netplan directory in the associated packages directory for your target board. For example, for the ZCU111 the netplan directory needs to located at (assuming the PYNQ source is located at ~/PYNQ).


Two files need to be added to the netplan directory. In this example the package contains two files, my-conf.yaml and my-conf.yaml is used by netplan and therefore requires changing to support your required IP address and network settings.

Content of my-conf.yaml is (Note, tabs are not rendering in the post, so I have used<\t> to indicate a tab.)
<\t><\t> eth0:
<\t><\t><\t>addresses: []
<\t><\t><\t><\t>addresses: [,]
<\t><\t><\t> dhcp4: no

<\t>version: 2"

The content of the is

set -x
set -e

target=1 script_dir="( cd “( dirname "{BASH_SOURCE[0]}” )" && pwd )"

sudo cp $script_dir/my-conf.yaml $target/etc/netplan

The shell script is used by the Qemu tools to add the my-conf.yaml to the target image.

The associated board spec file also needs to be altered to contain the netplan package.

Hope this Helps.