Network management
Beckhoff RT Linux® uses systemd-networkd as a service for network management. The service can be controlled via the command systemctl, as described in the section Manage services.
systemd-networkd uses configuration files in the directories /usr/lib/systemd/network/ and /etc/systemd/network/ to define network interfaces and their settings.
Beckhoff RT Linux® is supplied with predefined network configuration files for common applications. These are located in the directory /usr/lib/systemd/network/. To display and configure network interfaces, you can create or customize configuration files in these directories. Alternatively, you can use the command networkctl to display the status of the network interfaces and their configurations.
To list all network interfaces and their status, execute the following command:
sudo networkctl statusThe output could look like this:
● Interfaces: 1, 2, 3, 4
State: routable
Online state: partial
Address: 192.168.10.132 on eno1
169.254.221.74 on enp2s0
fe80::201:5ff:fe9d:431f on eno1
fe80::201:5ff:fe9d:4320 on enp2s0
Gateway: 192.168.10.1 on eno1
DNS: 192.168.10.2
Jan 19 12:29:19 BTN-000tr42t systemd-networkd[668]: enp2s0: Gained carrier
Jan 19 12:29:19 BTN-000tr42t systemd[1]: Started systemd-networkd.service - Network Configuration.
Jan 19 12:29:19 BTN-000tr42t systemd-networkd[668]: eno1: Configuring with /usr/lib/systemd/network/20-wired.network.
Jan 19 12:29:19 BTN-000tr42t systemd-networkd[668]: enp3s0: Configuring with /usr/lib/systemd/network/20-wired.network.
Jan 19 12:29:19 BTN-000tr42t systemd-networkd[668]: enp2s0: Configuring with /usr/lib/systemd/network/20-wired.network.
Jan 19 12:29:19 BTN-000tr42t systemd-networkd[668]: enp3s0: Link UP
Jan 19 12:29:20 BTN-000tr42t systemd-networkd[668]: eno1: Gained carrier
Jan 19 12:29:20 BTN-000tr42t systemd-networkd[668]: enp2s0: Gained IPv6LL
Jan 19 12:29:21 BTN-000tr42t systemd-networkd[668]: eno1: Gained IPv6LL
Jan 19 12:29:24 BTN-000tr42t systemd-networkd[668]: eno1: DHCPv4 address 192.168.10.132/22, gateway 192.168.10.1 acquired from 172.17.0.64The output provides an overview of the network interfaces, their status, assigned addresses, gateways and DNS servers.
Element | Purpose | Typical use |
|---|---|---|
Systemd-networkd | Manages network interfaces (IP addresses, routing and gateway configuration) | Starts automatically at system startup and applies rules from the configuration directories |
systemctl | Controls systemd services | Management of systemd-networkd, e.g. start, stop or check status |
/usr/lib/systemd/network/ | Contains predefined network configuration files | Used for standard configurations supplied with the system |
/etc/systemd/network/ | Contains user-defined or customized network configuration files | Used for project-specific or customer-specific network configurations |
networkctl | Displays status information on network interfaces and their configuration | Display of interface status, addresses, routing status and connection status |