How can I find the IP of a NAS connected via SMB?

11,598

Solution 1

If you want a sophisticated or permanent solution, Bonjour protocol may fit, you can see its implementation in Linux Avahi. So you can point to your NAS as hostname.local or use Avahi Discover to get IP's and all services published in the network. (printers, ftp, smb, ssh...)

  • Minimum installation for client side (your machine):

    sudo apt-get install avahi-daemon avahi-dnsconfd avahi-discover avahi-utils
    

    avahi-dnsconfd listens to the publishing and passes them to resolvconf. So you can point to the server as nashostname.local. as any other real public domain name. You can use it with http (firefox), samba share, ftp,...

    examples:

    $ ping salah-Aspire-5738.local
    
    PING salah-Aspire-5738.local (192.168.1.3) 56(84) bytes of data.
    64 bytes from salah-Aspire-5738.local (192.168.1.3): icmp_seq=1 ttl=64 time=6.09 ms
    
    $ nmap salah-Aspire-5738.local
    
    Starting Nmap 6.40 ( http://nmap.org ) at 2014-01-30 15:31 CET
    Nmap scan report for salah-Aspire-5738.local (192.168.1.3)
    Host is up (0.066s latency).
    All 1000 scanned ports on salah-Aspire-5738.local (192.168.1.3) are closed
    
    Nmap done: 1 IP address (1 host up) scanned in 4.91 seconds
    

    avahi-discover & avahi-utils, GUI & CLI, are the user interact tool. They are optional in case you want to list all services published on the network.

    Avahi Discover showcase

    Avahi Discover showcase

  • For NAS server side, if it is a Ubuntu base (Linux/BSD you can build source):

    sudo apt-get install avahi-daemon
    

    avahi-daemon provide services publishing.

    In case you are using Commercial NAS, many of them support service publishing using Bonjour.

See Avahi (Wikipedia) or its official website.

Solution 2

You could scan your network to see where it is up, e.g.

nmap -sP 192.168.1.0/24

where obviously you should change the network to your own. Then you'll get a list of devices which are up and running on current LAN.

To find your LAN IP you can use ip addr. If you are on WiFi the IP address will be near right to inet on something like wlp2s0 network interface.

Share:
11,598

Related videos on Youtube

don.joey
Author by

don.joey

Before I was called Private, but due to namespace polution I am henceforth known as don.joey! For my real avatar (.gif): check here.

Updated on September 18, 2022

Comments

  • don.joey
    don.joey over 1 year

    The question says it all. I have a NAS which was working quite well for quite some time. For some or other reason I started using smb instead of ftp.

    Now I can no longer access the configuration dashboard of the NAS. I am not sure what I messed up, but I do not know the IP address of the NAS anymore.

    How can I find the IP address of the NAS?

    • web.learner
      web.learner over 10 years
      Still looking for a nicer answer or something?
    • don.joey
      don.joey over 10 years
      @Seth I was hoping geeMc would upgrade his answer. You're right let me accept an answer.
  • don.joey
    don.joey over 10 years
    Excellent. Your answer would be even better if you'd explain how to find the ip address of one's own network.
  • don.joey
    don.joey over 10 years
    I think you mean to say, "for NAS: avahi-discover". Then browse to your NAS in the popup window.
  • user.dz
    user.dz over 10 years
    @don.joey, I meant the NAS server side, if it is a Ubuntu or Linux machine in general. The avahi-daemon provided publishing service. On client side (your machine), avahi-dnsconfd listens to the publishing and add passes them to resolvconf. So he can point to the server as nashostname.local. avahi-discover & avahi-utils are the user interact tool. Please, let me know if I missed anything or I wasn't clear enough. May be I should add that step on client side?