September 2008

Win NT – Logon Script Network MAP

Script semplice e veloce per mappare le unita’ di rete nei domini active directory, c’e’ chi usa ancora il “net use” ma purtroppo hanno anche inventato il VBS:

Notare che la terza mappatura mappa la home prendendo come variabili dallo username.
Nominare .vbs

Option Explicit
Dim objNetwork, strRemotePath1, strRemotePath2, strRemotePath3
Dim strUserName, strDriveLetter1, strDriveLetter2, strDriveLetter3

strDriveLetter1 = "S:"
strDriveLetter2 = "P:"
strDriveLetter3 = "X:"

strRemotePath1 = "\\server\share"
strRemotePath2 = "\\server\driver"
strRemotePath3 = "\\server"

Set objNetwork = CreateObject("WScript.Network")

objNetwork.MapNetworkDrive strDriveLetter1, strRemotePath1
objNetwork.MapNetworkDrive strDriveLetter2, strRemotePath2

Set objNetwork = WScript.CreateObject("WScript.Network")
strUserName = objNetwork.UserName
objNetwork.MapNetworkDrive strDriveLetter3, strRemotePath3 _
& "\" & strUserName & "$"

Wscript.Quit

Solaris – Inetd SVC

Breve memo sull’attivazione del servizio tftpd su solaris.

#svcs tftp/udp6
svcs: Pattern ‘tftp/udp6′ doesn’t match any instances
STATE STIME FMRI
#grep tftp /etc/inetd.conf
#tftp dgram udp6 wait root /usr/sbin/in.tftpd in.tftpd -s /tftpboot

Decommentare “#tftp dgram udp6 …” nel file /etc/inetd.conf

# grep tftp /etc/inetd.conf
# TFTPD – tftp server (primarily used for booting)
tftp dgram udp6 wait root /usr/sbin/in.tftpd in.tftpd -s /tftpboot

# inetconv
inetconv: Notice: Service manifest for 100235/1 already generated as /var/svc/manifest/network/rpc/100235_1-rpc_ticotsord.xml, skipped
inetconv: Notice: Service manifest for 100083/1 already generated as /var/svc/manifest/network/rpc/100083_1-rpc_tcp.xml, skipped
inetconv: Notice: Service manifest for 100068/2-5 already generated as /var/svc/manifest/network/rpc/100068_2-5-rpc_udp.xml, skipped
tftp -> /var/svc/manifest/network/tftp-udp6.xml Importing tftp-udp6.xml …Done

server # svcs tftp/udp6
STATE STIME FMRI
online 12:56:05 svc:/network/tftp/udp6:default

Cisco – Kerberos and telnet

Questa e’ una cosa che spesso riguarda piu’ in client telnet che non gli OS Cisco, che durante la procedura di login tentano la procedura di automatic login, generando questo questo errore:

leobook:~ leonardorizzi$ telnet route01-nov.stars.deepreflect.net

Trying xxx.xxx.xxx.xxx…
Connected to route01-nov.stars.deepreflect.net.
Escape character is ‘^]’.

User Access Verification

Username: Kerberos:     No default realm defined for Kerberos!

Questo ovviamente deriva dalla mancanza di configurazione dell’autenticazione kerberos sul sistema, cosa che ovviamente non e’ strettamente necessaria;
Per evitare di vedere e creare nei log righe di errore, semplicemente basta usare il parametro -K di telnet che corrisponde citando il man “-K Specifies no automatic login to the remote system.”

leobook:~ leonardorizzi$ telnet -K route01-nov.stars.deepreflect.net
Trying xxx.xxx.xxx.xxx…
Connected to route01-nov.stars.deepreflect.net.
Escape character is ‘^]’.

User Access Verification

Username:

Altra alternativa disattivare l’autologin dalle impostazioni di telnet con:

leobook:~ leonardorizzi$ echo default unset autologin >> ~/.telnetrc

Cisco – Change Dynamic NAT

Vi sara’ mai capitato di dover riconfigurare il NAT, Route MAP o simili su router in condizioni di nat dinamico, nella maggior parte dei casi si ricevono questi errori:

  • Dynamic mapping in use, cannot remove
  • %Pool outpool in use, cannot destroy

Si risolve usando il comando “clear” nello specifico:

clear ip nat translation *

dopodiche’ si puo’ agire sul nat indisturbati

conf t
no ip nat pool old pool name
ip nat pool new pool

Ricordo che in molti casi per poter agire su alcune configurazioni e’ necessario mettere in modalita’ “shutdown” le interfacce direttamente interessate nelle procedure di NAT