[systemd-devel] udp socket-activation "fake-service"

Lennart Poettering lennart at poettering.net
Mon Mar 18 09:54:34 UTC 2019


On Sa, 16.03.19 05:52, Reindl Harald (h.reindl at thelounge.net) wrote:

> Hi
>
> for a firewall development setup (nested virtualization) i have running
> a tcp service like below on a VM liesting on a complete /24 network
> behind a NAT
>
>
> with "udpsvd" at least something works for "nmap -p 53 -sU -P0 host" on
> a single port and always running - is there some way to get a similar
> udp service?
>
> "ListenDatagram=53" works only without "Accept=yes" and without a
> template-serivce but even then it's finally failing
>
> goal would be listening on at least port 53 or better a ton of ports for
> udp to run port-scans and validate the fiewall ruleset without a ton of
> persistent running udpsvd-processes

I am not fully grokking what you are trying to do, but to recv UDP
dgrams you'd have to write a tiny program that calls recvfrom() (or a
similar syscall) on the sockets passed, and then replies to it with
sendto() (or a similar syscall), using the address of the source
(i.e. the struct sockaddr recvfrom() returns) to respond to the dgram.

You can easily hack that up in C or some scripting language. I am not
aware of a ready-made tool that can do that for you, in particularly
of non that is capable of doing that for more than one listening UDP
socket at a time.

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list