Set Up a Static IP Address¶
When you install ACRN on your system following Getting Started, a
acrn-br0 is created and attached to the Ethernet network
interface of the platform. By default, the bridge gets its network configuration
using DHCP. This guide explains how to modify the system to use a static IP
address. You need
root privileges to make these changes to the system.
ACRN Network Setup¶
The ACRN Service VM is based on Clear Linux OS and it uses systemd-networkd
to set up the Service VM networking. A few files are responsible for setting up the
ACRN bridge (
acrn-br0), the TAP device (
tap0), and how these are all
connected. Those files are installed in
on the target device and can also be found under
misc/acrnbridge in the source code.
Setting up the static IP address¶
You can set up a static IP address by copying the
/usr/lib/systemd/network/50-eth.network file to
/etc/systemd/network/ directory. You can create this directory and
copy the file with the following command:
mkdir -p /etc/systemd/network cp /usr/lib/systemd/network/50-eth.network /etc/systemd/network
[Network] section in the
/etc/systemd/network/50-eth.network file you just created.
This is the content of the file used in ACRN by default.
[Match] Name=acrn-br0 [Network] DHCP=ipv4
Edit the file to remove the line highlighted above and add your network settings in
[Network] section. You will typically need to add the
DNS= parameters in there. There are many more parameters that can be used and
detailing them is beyond the scope of this document. For an extensive list of those,
please visit the official systemd-network page.
This is an example of what a typical
[Network] section would look like, specifying
a static IP address:
[Network] Address=192.168.1.87/24 Gateway=192.168.1.254 DNS=192.168.1.254
Activate the new configuration¶
You do not need to reboot the machine after making the changes to the system, the
following steps that restart the
systemd-networkd service will suffice (run as
systemctl daemon-reload systemctl restart systemd-networkd
If you encounter connectivity issues after following this guide, please contact us on the
ACRN-users mailing list or file an issue in ACRN hypervisor issues. Provide the details
of the configuration you are trying to set up, the modifications you have made to your system, and
the output of
journalctl -b -u systemd-networkd so we can best assist you.