Avahi is a library which enables programs to publish and discover services and hosts running on a local network. This library use the protocols Zeroconf and Bonjour with Multicast DNS (mDNS).
sudo apt-get install avahi-daemon libavahi-client-dev
sudo update-rc.d avahi-daemon defaults
Add service ssh :
sudo vim /etc/avahi/services/ssh.service
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h SSH</name>
<service>
<type>_ssh._tcp</type>
<port>22</port>
</service>
</service-group>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h SSH</name>
<service>
<type>_ssh._tcp</type>
<port>22</port>
</service>
</service-group>
Modify the Avahi configuration file :
domain-name=local
use-ipv4=yes
use-ipv6=yes
allow-interfaces=eth0,wlan0
ratelimit-interval-usec=1000000
ratelimit-burst=1000
sudo vim /etc/avahi/avahi-daemon.conf[server]
domain-name=local
use-ipv4=yes
use-ipv6=yes
allow-interfaces=eth0,wlan0
ratelimit-interval-usec=1000000
ratelimit-burst=1000
[publish]
publish-hinfo=no
publish-workstation=no
[reflector]
#enable-reflector=no
#reflect-ipv=no
#reflect-filters=_airplay._tcp.local,_raop._tcp.local
[rlimits]
#rlimit-as=
rlimit-core=0
#rlimit-data=8388608
rlimit-fsize=0
rlimit-nofile=768
rlimit-stack=8388608
rlimit-nproc=3
Install tools to debug avahi :
sudo mdns-scan
publish-hinfo=no
publish-workstation=no
[reflector]
#enable-reflector=no
#reflect-ipv=no
#reflect-filters=_airplay._tcp.local,_raop._tcp.local
[rlimits]
#rlimit-as=
rlimit-core=0
#rlimit-data=8388608
rlimit-fsize=0
rlimit-nofile=768
rlimit-stack=8388608
rlimit-nproc=3
sudo service avahi-daemon restart
sudo systemctl status avahi-daemon.service
Command to know
start service : sudo systemctl start avahi-daemon.service
restart service : sudo systemctl restrart avahi-daemon.service
stop service : sudo systemctl stop avahi-daemon.service
logfile : sudo journalctl -u avahi-daemon.service
sudo apt install avahi-utils mdns-scansudo avahi-browse -arp
sudo mdns-scan
Comments
Post a Comment