LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Samba on notebook with 2 NICs (https://www.linuxquestions.org/questions/linux-networking-3/samba-on-notebook-with-2-nics-890335/)

dimm0k 07-06-2011 08:15 PM

Samba on notebook with 2 NICs
 
I currently have Samba working properly using the eth0 interface on my notebook computer. More importantly, I can browse the network and see the shares set up in Samba. If I disconnect and go wireless using the wlan0 interface I can no longer browse the shares on Samba via name. I can however browse via IP address of the wlan0 interface. How can I make it so that Samba is accessible by name when I switch between interfaces?

Code:

[global]
  workgroup = startrek
  server string = NCC-1701 Enterprise
  bind interfaces only = yes
  interfaces = lo 192.168.4.0/255.255.255.0
  hosts allow = 192.168.4.0/255.255.255.0 127.0.0.1
  printcap name = /etc/printcap
  load printers = yes
  printing = lprng
  log file = /var/log/samba/%m.log
  max log size = 50
  security = user
  encrypt passwords = yes
  smb passwd file = /etc/samba/smbpasswd
  username map = /etc/samba/smbusers
  map to guest = Bad User
  socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
  dns proxy = no
#  netbios name = enterprise-e
  local master = no
  domain master = no
  preferred master = no
  wins proxy = yes
  name resolve order = lmhosts, host, wins, bcast

# Samba now defaults to denying symlinks found in exported shares per
# http://www.samba.org/samba/news/symlink_attack.html
# To allow symlinks to be followed in Windows clients, the below three are needed
  follow symlinks = yes
  wide links = yes
  unix extensions = no

#============================ Share Definitions ==============================
[homes]
  comment = Home Directories
  browseable = no
  writable = yes
  valid users = %S
  create mode = 0600
  directory mode = 0700


Lexus45 07-06-2011 10:00 PM

Do your eth0 and wlan0 have different IP-addresses?
Try to ping your Samba-server from another PC by hostname. What IP do you see?

The hostname is associated with that IP. If you use a DNS server in your LAN, you have to edit the config file and add the second IP address to the Samba server hostname.

dimm0k 07-06-2011 10:57 PM

Yes, my eth0 has 192.168.4.10 while my wlan0 gets 192.168.4.11. When I ping this Samba-server from another machine, the resulting IP address is 192.168.4.10. Say I don't have a DNS server on my network, which means I would have to accomplish this using the hosts file on each Windows machine that I would like to connect to this Samba-server. Would the correct hosts file be as follows:

192.168.4.10 enterprise-e
192.168.4.11 enterprise-e

To put aside any worries, are there ANY issues to assigning 2 IP addresses to one hostname?

Lexus45 07-06-2011 11:27 PM

I even do not know if it's possible in MS Windows to assign the same hostname to two different IP addresses.
But I'm also interested in.

Try to edit your hosts file and then write here if everything is OK. :)

dimm0k 07-06-2011 11:44 PM

Whoa, that worked! Well browsing the Samba-server worked using the name, but if I were to ping enterprise-e I see that's it reaching 192.168.4.10 and times out. I wonder if there are anything drawbacks to assigning 2 IP addresses to one hostname...


All times are GMT -5. The time now is 08:11 AM.