WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Connecting to windows shares with name rather than IP address?  (Read 2557 times)

Offline peliot

  • Newbie
  • *
  • Posts: 2
Connecting to windows shares with name rather than IP address?
« on: September 16, 2009, 04:17:55 PM »
Hi,
 Is it possible with TCL to mount a windows fileshare by name (e.g. "mount -t cifs //xyz-fileserver/foldername..." as opposed to "mount -t cifs //192.168.1.1/foldername...")? I have installed the filesystems extension, but mounting by name does not seem to work. I'm working in an environment where IP addresses change, while names are fixed, so working by name would be preferable.

I had a similar problem once with an Ubuntu installation and installing smbfs package solved the problem, but I couldn't find an equivalent in TCL. If there isn't one, no worries, I just thought I'd ask in case I was missing something that would make my life easier.

Thanks,
Pete

Offline JoXo009

  • Full Member
  • ***
  • Posts: 152
changing IP address
« Reply #1 on: September 16, 2009, 05:28:10 PM »
Quote
fileshare by name

I don't think that it's possible to replace the network IP by name.

But perhaps you can use a script which creates the needed IP dynamically.

First step: looking up the actual IP for example with ifconfig. (I don't use dynamic IPs, so perhaps somebody else could explain details.)

Second step: mounting the windows share with that IP.

Offline perthie

  • Full Member
  • ***
  • Posts: 118
Re: Connecting to windows shares with name rather than IP address?
« Reply #2 on: September 16, 2009, 07:51:11 PM »
You could use nbtscan to scan your network for shares, then extract the IP address for the desired server. For example:

Code: [Select]
IP=`nbtscan 192.168.2.0/24 | grep $SERVER | cut  -d " " -f 1`
sudo mount -t cifs //$IP/sharedfolder  myfolder  -o user=xxx

Nbtscan is simple to compile - just ./configure and make
« Last Edit: September 16, 2009, 09:05:59 PM by perthie »

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Connecting to windows shares with name rather than IP address?
« Reply #3 on: September 17, 2009, 01:29:00 AM »

Nbtscan is simple to compile - just ./configure and make


What is wrong with nbtscan already available in the repo?
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11027
Re: Connecting to windows shares with name rather than IP address?
« Reply #4 on: September 25, 2009, 02:59:18 PM »
smbfs - we have a Samba extension, it should include that functionality.
The only barriers that can stop you are the ones you create yourself.