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:

1 Answers1

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.

Ingo
  • 42,107
  • 20
  • 85
  • 197
  • I found a simpler way actually, but I will also try your recommendation, thank you! – BrainTrance Jul 15 '20 at 09: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 '20 at 17:31