It is often useful to have CAN interfaces automatically configured on system startup allowing them to be readily used by software. On Linux systems using systemd, networkd is the best way to do this.
# Example
Configure the interface `can0` with a 500 kbit/s bit rate with FD enabled at a 5 Mbit/s bit rate.
`/etc/systemd/network/30-can.network`
```ini
[Match]
OriginalName=can0
[CAN]
FDMode=True
BitRate=500K
DataBitRate=5M
```
Full configuration reference [here](https://www.freedesktop.org/software/systemd/man/latest/systemd.network.html#%5BCAN%5D%20Section%20Options).
You can test this using the following:
```shell
systemctl enable systemd-networkd
systemctl restart systemd-networkd
```
# References
- [Network Configuration - freedesktop.org](https://www.freedesktop.org/software/systemd/man/latest/systemd.network.html#%5BCAN%5D%20Section%20Options)