1

I need to establish a TCP/IP and/or UDP connection between Raspberry Pi and a special sensor which is not very configurable, but it has Ethernet. Normally, this sensor is connected to a PC or PC-like device (through Ethernet, directly) which runs a special software. Neither Raspberry Pi nor the sensor have access to the internet.

So, in order to get them to communicate I need Raspberry Pi to assign a local IP to this sensor. I tried to set up a DHCP server with no luck, service fails to start. This is my configuration:

2

You can use systemd-networkd to simply configure the wired ethernet interface. Please follow to Use systemd-networkd for general networking. You can just use section ♦ Quick Step there and then come back here. To configure the eth0 interface, create this file:

rpi ~$ cat > /etc/systemd/network/04-wired.network <<EOF
[Match]
Name=e*
[Network]
Address=192.168.50.1/24
DHCPServer=yes
EOF

Connect the sensor and reboot.

| improve this answer | |
  • I found a simpler way actually, but I will also try your recommendation, thank you! – BrainTrance Jul 15 at 9:57
  • @BrainTrance It would be nice if you make an answer about your solution to share it with the community. I'm also interested in a simpler solution. – Ingo Jul 16 at 17:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.