Curs: | SambasobreLDAP, LinuxAdministracioAvancada |
Fitxers: | Sessio4.pdf,
Sessio5.pdf,Sessio6.pdf,AutenticacioiAutoritzacionsLinux.pdf |
Repositori SVN: | https://[email protected]/svn/iceupc/SambaSobreLDAP |
Usuari: | anonymous |
Paraula de pas: | sense paraula de pas |
Autors: | Sergi Tur Badenas, Lluís Pérez Vidal |
Suposo que tothom ha patit algun cop l'estrany comportament que a vegades té aquesta funció de Windows. Aquest apartat us pot ajudar a entendre el perquè.
Per cada grup de treball de Windows ha d'haver-hi una màquina que funcioni com a Browse-Master. Aquesta màquina és la que s'encarrega de guardar la informació de màquines de xarxa (noms) i els recursos que comparteixen. Cada cop que s'encén un sistema Windows el primer que fa el programari de xarxa es buscar un Browse Master a la xarxa:
IMPORTANT: En un sistema de xarxa amb Windows NT, el Primary Domain Dontroller (PDC) sempre és escollit com el domain master browser i només ell pot ser-ho. Si no hi ha PDC només podeu consultar la Browse List del grup de treball al que pertanyeu. El PDC també és responsable de connectar-se al servidor WINS de la xarxa cada 12 minuts per tal d'obtenir el nom de les màquines que no s'anuncien per broadcast i només es registren al WINS (nodes 1b)
Cada sistema envia la seva llista de recursos disponibles al Browse-Master cada 12 minuts.
Imatge (recurs extern):
Cada cop que ens connectem a Mis sitios de red/Red de Windows és fa una consulta al Browse-Master per tal que ens mostri la llista de màquines que comparteixen recursos.
Aquest sistema es molt poc eficient ja que el procés d'elecció d'un Brose-Master pot tardar uns minuts un cop activada la màquina. A més, un cop finalitzat el procés d'elecció, si una màquina s'afegeix a la xarxa o surt de la xarxa pot tardar en actualitzar-se la xarxa fins a 15 minuts.
Per a més informació consulteu l'article Configuració Samba Browsing.
Recursos:
Quan una màquina s'engega, envia un paquet d'anunci (registre de nom), aquest procés es repetix al 4 minuts, als 8 minuts i després als 12 minuts. A partir d'aquí cada 12 minuts.
NOTA: cal tenir en compte que els paquets que s'envien són enviats en broadcast i sense connexió per tan no són confiables
Tenint en compte possibles errors de xarxa és d'esperar de forma raonable que dintre dels 12 primers minuts en que la màquina inicia sessió aquesta es registri a la frowse List del Master Browser del Segment.
Because a server's browser role is defined dynamically with periodic elections, determining the flow of communication used to provide the browse list to a specific client computer can be difficult. If a master browser is shut down gracefully, the master browser forces an election for a new master browser during shutdown. If the backup browser that wins the election has been present on the network long enough to receive a complete browse list, it starts as a master browser with a fully populated browse list, and browse functionality continues on the network segment without interruption.
Si una màquina que està funcionant com a master Browser no s'atura correctament, no s'envia el paquet que provoca la elecció d'un nou master browser! Aleshores els servidors de backup poden tardar fins a 12 minuts en enterar-se que no hi ha Master Browser.
NOTA: To browse és traduït sovint com a explorar per part de Microsoft a les seves pàgines oficials en castellà. En canvi, estem més acostumats a utilitzar Navegar, com els Browsers web o Navegadors Web.
Browsing és l'habilitat d'examinar els servidors (o estacions de treball) que estan disponibles a la xarxa. També permet conèixer els recursos i serveis que comparteixen.
Normalment s'utilitzar una eina gràfica com l'explorador de fitxers (carpeta "Network Neighborhood") de Windows o Nautilus. Al fer doble clic al servidor o estació de treball es poden veure els serveis que ofereix.
També es pot fer des de la línia d'ordres de dos amb:
C:\> net view Servers available in workgroup SIMPLE Server name Remark ---------------------------------------------------------- \\CHIMAERA Windows NT 4.0 \\HYDRA Samba 2.0.4 on (hydra) \\PHOENIX Windows 98
NOTA: Tot i que també tenim l'ordre net a Samba té un ús i funcionalitat diferents.
El browsing o navegació és diferent segons si treballem en un grup de treball o en un domini.
L'ordre equivalent a Samba és smbtree:
$ smbtree -N
Paràmetres de Browsing a Samba:
Amb la comanda nmblookup podem cercar quin és el Master Browser d'un segment de xarxa.
$ nmblookup -M CASA querying CASA on 192.168.1.255 192.168.1.3 CASA<1d>
També podem utilitzar la comanda net:
$ net lookup master
Recursos:
Per configurar el browsing en xarxes WAN amb diferents segments (LAN) cal configurar samba de la següent forma:
[global] domain master = yes local master = yes preferred master = yes os level = 65
No s'ha de confondre DMB amb PDC (Primary Domain Controller) ni confondre WorkGroups amb dominis. Només ha d'haver-hi un DMB per cada grup de treball.Més avall podeu trobar el detall dels diferents paràmetres.
Recursos:
La configuració dels LMB és la següent:
[global] domain master = no local master = yes preferred master = yes os level = 65
IMPORTANT: Això només s'ha de fer per una sola màquina dins de cada segment de xarxa.
La resta de màquines samba haurien de tenir la següent configuració:
[global] domain master = no local master = no preferred master = no os level = 0
Recursos:
Samba pot perdrà les eleccions per a ser el Master Browser depenent de com estigui configurat. Cada paquet d'elecció conté una sèrie de paràmetres que determinen les preferències a l'hora d'escollir un Master Browser. Per fer que la màquina samba guanyi les eleccions s'ha de modificar el paràmetre os level:
$ man smb.conf os level (G) This integer value controls what level Samba advertises itself as for browse elections. The value of this parameter determines whether nmbd(8) has a chance of becoming a local master browser for the workgroup in the local broadcast area. Note :By default, Samba will win a local master browsing elec‐ tion over all Microsoft operating systems except a Windows NT 4.0/2000 Domain Controller. This means that a misconfigured Samba host can effectively isolate a subnet for browsing purposes. This parameter is largely auto-configured in the Samba-3 release series and it is seldom necessary to manually over-ride the default setting. Please refer to chapter 9 of the Samba-3 HOWTO document for further information regarding the use of this param‐ eter. Default: os level = 20 Example: os level = 65
El valor màxim és 255. Un valor de 34 farà que Samba guanyi les eleccions a totes les màquines Windows però no en altres màquines Samba (en cas d'empat guanya la màquina que port més temps a la xarxa.)
Un altre paràmetre interessant és preferred master o l'equivalent prefered master:
preferred master (G) This boolean parameter controls if nmbd(8) is a preferred master browser for its workgroup. If this is set to yes, on startup, nmbd will force an election, and it will have a slight advantage in winning the election. It is recommended that this parameter is used in conjunction with domain master = yes, so that nmbd can guarantee becoming a domain master. Use this option with caution, because if there are several hosts (whether Samba servers, Windows 95 or NT) that are preferred master browsers on the same subnet, they will each periodically and continuously attempt to become the local master browser. This will result in unnecessary broadcast traffic and reduced browsing capabilities. Default: preferred master = auto
Aquest paràmetre, si s'estableix a yes, força que al iniciar Samba, el dimoni nmdb forci una elecció de master browser.
Recursos:
El DMB és el responsable de gestionar les llistes de diferents LMB (local master browsers) situats en diferents segments de xarxa. Per fer que samba sigui un DMB cal utilitzar el paràmetre domain master:
domain master (G) Tell smbd(8) to enable WAN-wide browse list collation. Setting this option causes nmbd to claim a special domain specific NetBIOS name that identifies it as a domain master browser for its given workgroup. Local master browsers in the same workgroup on broadcast-isolated subnets will give this nmbd their local browse lists, and then ask smbd(8) for a complete copy of the browse list for the whole wide area network. Browser clients will then contact their local master browser, and will receive the domain-wide browse list, instead of just the list for their broadcast-isolated subnet. Note that Windows NT Primary Domain Controllers expect to be able to claim this workgroup specific special NetBIOS name that identifies them as domain master browsers for that workgroup by default (i.e. there is no way to prevent a Windows NT PDC from attempting to do this). This means that if this parameter is set and nmbd claims the special name for a workgroup before a Windows NT PDC is able to do so then cross subnet browsing will behave strangely and may fail. If domain logons = yes, then the default behavior is to enable the domain master parameter. If domain logons is not enabled (the default set‐ ting), then neither will domain master be enabled by default. When domain logons = Yes the default setting for this parameter is Yes, with the result that Samba will be a PDC. If domain master = No, Samba will function as a BDC. In general, this parameter should be set to ’No’ only on a BDC. Default: domain master = auto
Per defecte aquest valor esta a auto. Cal vigilar de no confondre noms de grup amb noms de domini.
Cada 12 minuts aproximadament els LMB envien informació al DMB i contacten amb aquestes màquines per actualitzar les browse lists. Aquest paràmetre suposo que tots els clients utilitzen WINS per tal de resoldre noms de NetBIOS. Si no és així poden passar dos coses:
Per tant es necessari tenir un servidor WINS per tal que el sistema de browsing funcioni a través de les subxarxes.
Podem preguntar pel master browser utilitzant la comanda nmblookup.
$ nmblookup -M casa querying casa on 192.168.1.255 192.168.1.3 casa<1d>
Dins d'una mateixa xarxa, cada grup de treball pot tenir un master browser diferent:
$ nmblookup -M mshome querying mshome on 192.168.1.255 192.168.1.2 mshome<1d>
Vegeu també:
$ nmblookup -M -- - Server's Role (logon server) NOT ADVISED with domain-level security querying __MSBROWSE__ on 192.168.1.255 192.168.1.3 __MSBROWSE__<01> 192.168.1.2 __MSBROWSE__<01>
Vegeu també:
Serveix per que la màquina samba local anuncii els seus recursos a una màquina remota. Del manual del fitxer /etc/samba/smb.conf
$ man smb.conf ... remote announce (G) This option allows you to setup nmbd(8)to periodically announce itself to arbitrary IP addresses with an arbitrary workgroup name. This is useful if you want your Samba server to appear in a remote workgroup for which the normal browse propagation rules don’t work. The remote workgroup can be anywhere that you can send IP packets to. For example: remote announce = 192.168.2.255/SERVERS 192.168.4.255/STAFF the above line would cause nmbd to announce itself to the two given IP addresses using the given workgroup names. If you leave out the work‐ group name then the one given in the workgroup parameter is used instead. The IP addresses you choose would normally be the broadcast addresses of the remote networks, but can also be the IP addresses of known browse masters if your network config is that stable. See the chapter on Network Browsing in the Samba-HOWTO book. Default: remote announce =
Com podeu veure per defecte no s'utilitza. Fixeu-vos que s'utilitzen les adreces de broadcast del segments de xarxa remots, però també es pot utilitzar una IP concreta.
Serveix per que la màquina samba local anuncii els seus recursos a una màquina remota. Del manual del fitxer /etc/samba/smb.conf
$ man smb.conf ...
remote browse sync (G) This option allows you to setup nmbd(8) to periodically request synchronization of browse lists with the master browser of a Samba server that is on a remote segment. This option will allow you to gain browse lists for multiple workgroups across routed networks. This is done in a manner that does not work with any non-Samba servers. This is useful if you want your Samba server and all local clients to appear in a remote workgroup for which the normal browse propagation rules don’t work. The remote workgroup can be anywhere that you can send IP packets to. For example: remote browse sync = 192.168.2.255 192.168.4.255 the above line would cause nmbd to request the master browser on the specified subnets or addresses to synchronize their browse lists with the local server. The IP addresses you choose would normally be the broadcast addresses of the remote networks, but can also be the IP addresses of known browse masters if your network config is that stable. If a machine IP address is given Samba makes NO attempt to validate that the remote machine is available, is listening, nor that it is in fact the browse master on its segment. The remote browse sync may be used on networks where there is no WINS server, and may be used on disjoint networks where each network has its own WINS server.
Aquest paràmetre esta per defecte a yes i implementa una serie de millores per al browsing a través de diferents segments de xarxa que no es troben a les implementacions per defecte de Windows.
enhanced browsing (G) This option enables a couple of enhancements to cross-subnet browse propagation that have been added in Samba but which are not standard in Microsoft implementations. The first enhancement to browse propagation consists of a regular wildcard query to a Samba WINS server for all Domain Master Browsers, fol‐ lowed by a browse synchronization with each of the returned DMBs. The second enhancement consists of a regular randomised browse synchroniza‐ tion with all currently known DMBs. You may wish to disable this option if you have a problem with empty workgroups not disappearing from browse lists. Due to the restrictions of the browse protocols these enhancements can cause a empty workgroup to stay around forever which can be annoying. In general you should leave this option enabled as it makes cross-subnet browse propagation much more reliable.
lm announce (G) This parameter determines if nmbd(8) will produce Lanman announce broadcasts that are needed by OS/2 clients in order for them to see the Samba server in their browse list. This parameter can have three values, yes, no, or auto. The default is auto. If set to no Samba will never produce these broadcasts. If set to yes Samba will produce Lanman announce broadcasts at a frequency set by the parameter lm interval. If set to auto Samba will not send Lanman announce broadcasts by default but will listen for them. If it hears such a broadcast on the wire it will then start sending them at a frequency set by the parameter lm interval. Default: lm announce = auto Example: lm announce = yes lm interval (G) If Samba is set to produce Lanman announce broadcasts needed by OS/2 clients (see the lm announce parameter) then this parameter defines the frequency in seconds with which they will be made. If this is set to zero then no Lanman announcements will be made despite the setting of the lm announce parameter. Default: lm interval = 60 Example: lm interval = 120