0

I connected two Linux PCs with local-link directly. I now want one to know e.g. ipv6 address assigned by local-link connection. I've tried web search for discover and make discoverable, etc. and found a number of QAs, https://askubuntu.com/questions/947639/how-to-find-the-ip-address-for-a-device-on-a-network, How to make a machine accessible from the LAN using its hostname, https://serverfault.com/questions/1036362/how-to-nicely-make-a-neighbors-discovery-solicitation-on-linux, How can I make my linux machine broadcast its IP address dynamically?, https://askubuntu.com/questions/460371/trouble-using-ssh-and-avahi.

Solutions either advice to use something like nmap which as I've understood by running nmap -v -sn 192.168.0.0/16 10.0.0.0/8 tries to contact every IP on the net from a range (runs long and and range for ipv6 is large), install DNS server, cover discovery by hosthame when ip is known and lastly advise avahi.

I need only ip, no need for hostname, I prefer not install DHCP and DNS servers.

I've tried avahi and I can see ip and hostname of service via GUI in avahi-discover, but in avahi-browse only service name, no ip. How to get ip address in terminal for use in scripting?

Apart from avahi, it is my guess that in order for two PCs when local-linked not to assign themselves same ip addresses, they exchange their addresses for checking. Am I right here? Maybe in such case it is possible to obtain ip addresses at time of local-link connection being established, isn't it?

Martian2020
  • 1,167

0 Answers0