Page 1 of 1

how can I disable zeroconf ?

Posted: Thu Oct 11, 2018 4:28 am
by fromJPN
Hello.
I am stuck with this problem. Help me. :(

A system is 2017-07-05 raspbian-jessie-lite.
It works on raspberry pi zero w.

1) I connected two raspi with WiFi in ad-hoc mode.
2) Two raspi set static IP. The setting is as follows.

Code: Select all

# vi /etc/network/interfaces

    source-directory /etc/network/interfaces.d

    auto lo
    iface lo inet loopback

    #iface eth0 inet dhcp

    auto wlan0
    allow-hotplug wlan0
        iface wlan0 inet static
        address 192.168.44.63
        netmask 255.255.255.0

        wireless-channel 3         # channel number can be any number
        wireless-mode ad-hoc
        wireless-essid myname
        wireless-key 1234567890    # 10 or 26 digits as hex
3) The two raspi's were able to connect successfully! The ping command also succeeds.
4) But there is a problem.
5) In addition to the 192.168.44.63 I set, another 169.254.32.159 is automatically allocated for the IP address.
6) On the screen immediately after startup, it is displayed as follows.

Code: Select all

    My IP address is 192.168.44.63   169.254.32.159 
7) In the investigation command, it is displayed as follows.

Code: Select all

# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 wlan0
192.168.44.0    0.0.0.0         255.255.255.0   U         0 0          0 wlan0
8) When I examine it, this is a function called "zeroconf", it seems to be a function to assign an IP address in a network environment NO DHCP server.
9) In other Linux, zeroconf function seems to can disable with "NOZEROCONF = yes" etc, but related information could not be found about raspi.
10) I have execute the next command, but the phenomenon that 169.254.32.159 was automatically allocated was not improved.

Code: Select all

# systemctl disable avahi-daemon
# systemctl stop avahi-daemon
Please tell me how can I disable zeroconf function on raspi. :|

Re: how can I disable zeroconf ?

Posted: Thu Oct 11, 2018 11:58 am
by epoch1970
First Jessie is dead, you're more or less on your own if you're still using it.

The ipv4 "link-local" (aka zeroconf, bonjour, APIPA) address is probably generated by dhcpcd
Try adding "noipv4ll" in dhcpcd.conf. See "man dhcpcd.conf"

In addition, if you have an avahi-daemon scriptlet in /etc/network/if-up.d/, make sure to set AVAHI_DAEMON_DETECT_LOCAL=0 in /etc/default/avahi-daemon.
The scriptlet calls /usr/lib/avahi/avahi-daemon-check-dns.sh, which restarts avahi-daemon if it is not running. It does it old school via /etc/init.d/ and does not care if the service was disabled via systemd.

In general having multiple IP addresses per interface is not considered a problem. mDNS is often useful.

Re: how can I disable zeroconf ?

Posted: Fri Oct 12, 2018 7:06 am
by fromJPN
To epoch 1970

Thank you very much for your answers and advice.
It worked ! !
Jessie, she works very well. :D