Skip to main content

Networking

OpenSTLinux configures networking with systemd-networkd. Configuration files live in /lib/systemd/network (the shipped defaults) or /etc/systemd/network (your overrides). A file in /etc wins over one of the same name in /lib.

dhclient is not installed, because systemd-networkd already embeds a DHCP client. Configure DHCP through a .network file, not by running a separate daemon.

Wired, static IP

The default .network files use a glob so the config applies whether the interface is named eth0 or end0:

# /lib/systemd/network/52-wired-static.network
[Match]
Name=eth[0-9] end[0-9]

For a fixed address on one interface:

# /lib/systemd/network/52-wired-static.network
[Match]
Name=end0

[Network]
Address=192.168.50.20/24

Do not configure the same interface twice. If you add a static config for end0, exclude it from the default DHCP config (50-wired.network) — two files matching the same interface produce an unpredictable result, with the address sometimes taken and sometimes not.

Check what networkd sees:

networkctl --no-pager # state of every interface

Wireless

The iw tool only handles open and WEP networks. For WPA/WPA2 you need wpa_supplicant.

Bring the interface up and scan:

ifconfig wlan0 up
ifconfig wlan0 # look for UP in the flags
iw dev wlan0 scan | grep SSID

Assign an address, either statically or by leaving it to DHCP:

ifconfig wlan0 192.168.43.21 broadcast 192.168.43.255 netmask 255.255.255.0

Connect with wpa_supplicant

# Append the network block; wpa_passphrase stores the PSK, not the plaintext
wpa_passphrase SSID_NAME SSID_PASSWORD >> /etc/wpa_supplicant.conf
cat /etc/wpa_supplicant.conf

wpa_supplicant -B -iwlan0 -c /etc/wpa_supplicant.conf # -B: background
iw wlan0 link # confirm association

wpa_passphrase hashes the passphrase into a psk= line, so the plaintext is not stored — but it also appends a comment containing the plaintext, so review and trim the file if that matters.

Automatic Wi-Fi at boot

Two pieces: a networkd .network file for the interface, and a wpa_supplicant config it can start from.

# Interface config
cat > /lib/systemd/network/51-wireless.network <<'EOF'
[Match]
Name=wlan0

[Network]
DHCP=ipv4
# Or, for a static address instead of DHCP:
# Address=192.168.43.20/24
EOF

wpa_supplicant also needs a writable filesystem for its control-interface directory, which it creates under /var/run/wpa_supplicant/wlan0:

mkdir -p /etc/wpa_supplicant/
cat > /etc/wpa_supplicant/wpa_supplicant-wlan0.conf <<'EOF'
ctrl_interface=/var/run/wpa_supplicant
eapol_version=1
ap_scan=1
fast_reauth=1
EOF
wpa_passphrase SSID_NAME SSID_PASSWORD >> /etc/wpa_supplicant/wpa_supplicant-wlan0.conf

The file name matters: systemd starts wpa_supplicant@wlan0, which reads wpa_supplicant-wlan0.conf. A file named otherwise is ignored, and the interface comes up with no association.

Host bridge for a VM

To reach the board from a Linux guest in VMware while the host owns the physical NIC, bridge a second VMnet to that NIC:

NodeAddress
Windows host, physical Ethernet192.168.50.1
Ubuntu guest, VMnet2 adapter192.168.50.10
Board, Ethernet192.168.50.20
  • In VMware, add VMnet2 as Bridged to the physical Ethernet adapter.
  • Add a second network adapter to the VM, Custom ▸ VMnet2.
  • Give the Ubuntu guest 192.168.50.10 on that interface.

The guest can then ping the board directly. All three must share the subnet, and the board's lack of Auto-MDIX means a switch between host and board is the reliable topology — see Starter Package.

Demo launcher

The shipped image runs Netdata for live system metrics:

http://192.168.50.20:19999/