Projecte

General

Perfil

Actions

Mdns: mesh DNS system

This is an example of bmx6 SMS plugin utilization. It is a distributed DNS system where every node publish the domains it is managing.
The current implementation is done for working in OpenWRT with the Dnsmasq daemon.

Usage

  • /etc/init.d/mdns start -> starts the system (adds itself to the crontab)
  • /etc/init.d/mdns stop -> stops the system (removes itself from crontab)
  • /etc/init.d/mdns reload -> update the data

Files

  • /etc/mdns/public contains the list of domains we wanto to announce in the network
  • /etc/mdns/hosts contains a list of "IP -> domain" which have been obtained from the network (dnsmasq looks on it)

Executation

By default, even if there are not domains to publish in /etc/mdns/public file, the mdns script publish its own hostname.[ALL_ACCEPTED_TLDs]

The accepted TLDs can be configured in the variables DOMAINS4 and DOMAINS6, for IPv4 and IPv6 respectivelly.
So if someone publish "google.com" but your mdns instance is not accepting the ".com" TLD it will be discarted.

root@UPClab104-1677:~# /etc/init.d/mdns start
-> preparing bmx6
INFO  uci_create_section: bmx6.cfg125cb5=syncSms
INFO  uci_save_option: bmx6.cfg125cb5.syncSms=mdns
INFO  uci_save_option: bmx6.cfg125cb5.syncSms=mdns
INFO  : --syncSms                 mdns                          
-> adding addn-host entry to dnsmasq config file
-> restarting dnsmasq daemon
-> cleaning files
-> publishing own IPv4 domains: UPClab104-1677.qmp
-> publishing own IPv6 domains: UPClab104-1677.qm6
-> added remote domains google.qmp pau.qmp tita.qmp SApalafolls-ebb2.qmp = 10.228.206.65
-> added remote domains SApalafolls-ebb2.qm6 = 2012:0:0:ebb2::1

root@UPClab104-1677:~# ping google.qmp
PING google.qmp (10.228.206.65): 56 data bytes
64 bytes from 10.228.206.65: seq=0 ttl=63 time=25.248 ms
64 bytes from 10.228.206.65: seq=1 ttl=64 time=1.655 ms
64 bytes from 10.228.206.65: seq=2 ttl=64 time=1.661 ms
64 bytes from 10.228.206.65: seq=3 ttl=64 time=1.692 ms
64 bytes from 10.228.206.65: seq=4 ttl=64 time=1.593 ms
^C
--- google.qmp ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 1.593/6.369/25.248 ms

root@UPClab104-1677:~# ping SApalafolls-ebb2.qm6
PING SApalafolls-ebb2.qm6 (2012:0:0:ebb2::1): 56 data bytes
64 bytes from 2012:0:0:ebb2::1: seq=0 ttl=64 time=1.886 ms
64 bytes from 2012:0:0:ebb2::1: seq=1 ttl=64 time=1.632 ms
64 bytes from 2012:0:0:ebb2::1: seq=2 ttl=64 time=1.679 ms
64 bytes from 2012:0:0:ebb2::1: seq=3 ttl=64 time=1.801 ms
^C
--- SApalafolls-ebb2.qm6 ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 1.632/1.749/1.886 ms

Code

[[http://dev.qmp.cat/projects/qmp/repository/revisions/kalimotxo/show/packages/bmx6-mdns]]

Actualitzat per Pau Escrich fa més de 10 anys · 6 revisions