From b4a4cca7da99bd8420a9fbf2f8897a3c0183e031 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Wed, 16 Dec 2020 14:58:41 +0200 Subject: [PATCH] docker: Add dnsmasq and avahi-daemon dnsmasq and avahi-daemon are needed to test DNS and mDNS. Signed-off-by: Jukka Rissanen --- docker/Dockerfile | 8 ++++--- docker/avahi-daemon.conf | 49 ++++++++++++++++++++++++++++++++++++++++ docker/avahi-daemon.sh | 5 ++++ docker/dnsmasq.conf | 15 ++++++++++++ docker/dnsmasq.sh | 3 +++ 5 files changed, 77 insertions(+), 3 deletions(-) create mode 100644 docker/avahi-daemon.conf create mode 100755 docker/avahi-daemon.sh create mode 100644 docker/dnsmasq.conf create mode 100755 docker/dnsmasq.sh diff --git a/docker/Dockerfile b/docker/Dockerfile index 0dc5f64..135ac91 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -8,7 +8,9 @@ RUN apt update && apt install -y \ dante-server \ curl \ netcat \ - tcpdump + tcpdump \ + dnsmasq \ + avahi-daemon # We need the net-tools project as it contains helper apps needed # in testing. @@ -62,11 +64,11 @@ COPY mosquitto.conf mosquitto-tls.conf /usr/local/etc/mosquitto/ # network sample. # The syslog-receiver.py will test syslog-net sample COPY http-server.py https-server.py http-get-file-test.sh \ - syslog-receiver.py /usr/local/bin/ + syslog-receiver.py dnsmasq.sh avahi-daemon.sh /usr/local/bin/ COPY http-get-file-test.sh /usr/local/bin/https-get-file-test.sh # Dante is SOCKS proxy. The gptp.conf is conf file for linuxptp. -COPY danted.conf gptp.cfg /etc/ +COPY danted.conf gptp.cfg dnsmasq.conf avahi-daemon.conf /etc/ WORKDIR /net-tools diff --git a/docker/avahi-daemon.conf b/docker/avahi-daemon.conf new file mode 100644 index 0000000..a1bbd76 --- /dev/null +++ b/docker/avahi-daemon.conf @@ -0,0 +1,49 @@ +# See avahi-daemon.conf(5) for more information on this configuration +# file! +# This is specifically tailored for testing mDNS in Zephyr OS. + +[server] +host-name=zephyr +domain-name=local +use-ipv4=yes +use-ipv6=yes +allow-interfaces=eth0 +enable-dbus=no +#browse-domains=0pointer.de, zeroconf.org +#disallow-other-stacks=no +#allow-point-to-point=no +#cache-entries-max=4096 +#clients-max=4096 +#objects-per-client-max=1024 +#entries-per-entry-group-max=32 +ratelimit-interval-usec=1000000 +ratelimit-burst=1000 + +[wide-area] +enable-wide-area=no + +[publish] +#disable-publishing=yes +#disable-user-service-publishing=no +#add-service-cookie=no +#publish-addresses=yes +publish-hinfo=no +publish-workstation=no +#publish-domain=yes +#publish-dns-servers=192.168.50.1, 192.168.50.2 +#publish-resolv-conf-dns-servers=yes +#publish-aaaa-on-ipv4=yes +#publish-a-on-ipv6=no + +[reflector] +#enable-reflector=no +#reflect-ipv=no + +[rlimits] +#rlimit-as= +rlimit-core=0 +rlimit-data=4194304 +rlimit-fsize=0 +rlimit-nofile=768 +rlimit-stack=4194304 +rlimit-nproc=3 diff --git a/docker/avahi-daemon.sh b/docker/avahi-daemon.sh new file mode 100755 index 0000000..c6f5332 --- /dev/null +++ b/docker/avahi-daemon.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +ip link set eth0 multicast on + +avahi-daemon -f /etc/avahi-daemon.conf diff --git a/docker/dnsmasq.conf b/docker/dnsmasq.conf new file mode 100644 index 0000000..af4454a --- /dev/null +++ b/docker/dnsmasq.conf @@ -0,0 +1,15 @@ +# Sample dnsmasq for testing DNS and DHCPv4 + +interface=eth0 +port=5353 +bind-interfaces +no-resolv + +address=/www.zephyrproject.org/192.0.2.2 +address=/www.zephyrproject.org/2001:db8::2 + +domain=zephyr.test +dhcp-range=192.0.2.16,192.0.2.32,1h +log-dhcp + +user=root diff --git a/docker/dnsmasq.sh b/docker/dnsmasq.sh new file mode 100755 index 0000000..75f8296 --- /dev/null +++ b/docker/dnsmasq.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +dnsmasq -C /etc/dnsmasq.conf