Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker: Add dnsmasq and avahi-daemon #55

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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

Expand Down
49 changes: 49 additions & 0 deletions docker/avahi-daemon.conf
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions docker/avahi-daemon.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

ip link set eth0 multicast on

avahi-daemon -f /etc/avahi-daemon.conf
15 changes: 15 additions & 0 deletions docker/dnsmasq.conf
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions docker/dnsmasq.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

dnsmasq -C /etc/dnsmasq.conf