Thursday, September 30, 2010

Configure Zyxel router using CLI

Please check the following site:

How to configure nat port translation in a ZyXEL 661 ADSL router

Configuring Port Mapping via web interface is not possible. Use telnet commands detailed below.

If you are having problems configuring port mapping on a Zyxel router, the below instructions should help you.
There is no way of doing this using the web GUI so please use the telnet command to configure port mapping. You can only do port address translation via the command line interface (telnet):

Example 1: translate external ports 4420 through 4422 to internal ports 8080 through 8082 ip

:4420 ->
:4421 ->
:4422 ->

ip nat server load 1
ip nat server edit 2 svrport 4420 4422
ip nat server edit 2 intport 8080 8082
ip nat server edit 2 forwardip
ip nat server edit 2 active yes
ip nat server save

To display the table
ip nat server load 1
ip nat server disp 1

Notes: (1) The "load 1" is required to loading the set #1 (1st page) of rules, the "edit 2" refers to the 2nd rule (in set #1) (2) svrport refers to the ports as they appear on the WAN side before the translation (3) intport refers to the ports as they appear on the LAN side after the translation (4) if you view the port forwarding rules in the web interface (Network > NAT) the external ports (svrport) are shown in rule 1 (N-1)
If your firewall is enabled, then you will need to create a firewall rule based on the internal ports (intport).

Add WAN/LAN rule 1 Permit Source IP = any Destination IP = Service = TCP/UDP Port 8080 to 8082

Example 2: translate external; ports 4420 through 4422 to internal port 80 on IPs through

:4420 ->
:4421 ->
:4422 ->

ip nat server load 1
ip nat server edit 2 svrport 4420 4420
ip nat server edit 2 intport 80 80
ip nat server edit 2 forwardip
ip nat server edit 2 active yes
ip nat server edit 3 svrport 4421 4421
ip nat server edit 3 intport 80 80
ip nat server edit 3 forwardip
ip nat server edit 3 active yes
ip nat server edit 4 svrport 4422 4422
ip nat server edit 4 intport 80 80
ip nat server edit 4 forwardip
ip nat server edit 4 active yes
ip nat server save

The firewall is simpler
Add WAN/LAN rule 1 Permit Source IP = any Destination IP = to Service = http

A quick example
Forward port 8080 to internal server port 80
ip nat server load 1
ip nat server disp 1
ip nat server edit 2 active 1
ip nat server edit 2 svrport 8080 8080
ip nat server edit 2 intport 80 80
ip nat server edit 2 forwardip
ip nat server save

For more info take a look at

Thursday, September 23, 2010

Windows 7 / Vista loses local resources when connected to VPN

Starting with Vista there is a hidden configuration setting called UseRasCredentials.
If this is set to 1 Windows uses the credentials of the VPN connection for all further accesses (this is contrary to the behaviour of XP).
To fix this problem:
  • Locate the .pbk file that contains the entry that you dial. You can find this file in location C:\Users\Username\AppData\Roaming\Microsoft\Network\Connections\Pbk
  • Open the file in Notepad.
  • Locate the following entry: UseRasCredentials=1
  • Modify the entry to the following: UseRasCredentials=0
  • On the File menu, click Save, and the click Exit.

Tuesday, September 21, 2010

vSphere Client performs slowly on a Windows 7 system

From this KB article from VMware we read:

When running the vSphere Client on a Windows 7 machine, you experience these symptoms:

  • The performance of the vSphere Client is slow
  • Redraws are visibly noticeable, especially when maximising the vSphere Client

This issue occurs when desktop composition is enabled.
To disable desktop composition:

  • Right-click the shortcut for the vSphere Client and click Properties.
  • Click the Compatibility tab.
  • Select Disable desktop composition.
  • Click OK.

Run the vSphere Client.

Cloning and converting virtual machine disks with vmkfstools

Please read this article from VMware KB.

Monday, September 20, 2010

Thursday, September 16, 2010

Slow mouse movement in a Windows Server 2008 R2 VM hosted in ESXi 4.1

When you create a Windows 2008 Server R2 VM hosted in a vSphere 4.x hypervisor you see that the mouse is not moving as fast as it does in a Windows 2003 Server VM. This is what you must do to resolve this issue:
  1. Power off the VM and change the total video RAM assigned to this VM using the Edit Settings menu. Set the Video card Display Memory to Auto-detect video settings.
  2. Power on the VM again and after you login to the system go to the Device Manager and install the following driver for the Video-Card: C:\Program Files\Common Files\VMware\Drivers\wddm_video
  3. Reboot the VM again.

Error in vSphere HA configuration after upgrading to vCenter 4.1

After upgrading to vCenter Server 4.1, when you run an ESXi 4.0 host on that vCenter Server inventory, you see these symptoms:
The ESXi host reconfigures successfully for HA, but immediately displays an error
In the Summary tab, you see the error:
HA agent on in cluster has an error: error while running health check script
The issue occurs because the management agents on the ESXi host are not upgraded properly.
To resolve this issue, you must manually remove and reinstall the agents.

To manually remove and reinstall the agents:
  • Right-click the ESXi host and click Disconnect. This disconnects the ESXi host from the VirtualCenter Inventory.
  • Log in to the ESXi host using the Tech Support mode. For more information, see Tech Support Mode for Emergency Support (1003677) article in VMware.
  • Run these commands to uninstall the vpxa and aam components from the ESXi host:

  • Right-click the ESXi host and click Connect. This re-installs the vpxa agent.
  • Add the host to the appropriate cluster. This re-installs the aam agent. 
For more details see this KB article from VMware

Monday, September 13, 2010

How to replace vCenter 4.1 SSL certificate

Please read the following articles:
How to create a self-signed certificate for VirtualCenter using OpenSSL
VirtualCenter Server Fails to Start After You Replace Default SSL Certificates with Custom SSL Certificates
VMware vCenter Server plugins fail after adding custom SSL certificates
vCenter Service Status displays an error for com.vmware.converter
 vCenter Server Service Status plug-in cannot be enabled
How to generate Domain Root CA signed certificates for vCenter Server

vCenter 4 service does not start after server reboot

This occurs if you are running the vCenter database (SQL Server) on the same server as vCenter itself.
To resolve this issue we need to create a dependency for the VMware VirtualCenter Server service for the following services:
Run regedit and go to the key
Edit the DependOnService value adding these values:
Restart the server to check if all is ok.
For more info check this post

Sunday, September 12, 2010

How to enable administrative shares in windows 7

First use Network and Sharing Center to enable File and Print Sharing
Then run regedit and go to the following key:
In this key enter a 32-bit word value named LocalAccountTokenFilterPolicy with value equal to 1.
Restart the system to activate the change.
To disable this policy delete this value or make it 0.

Saturday, September 11, 2010

Copying SQL Server databases with Backup and Restore

Please read the following articles:
Copying Databases with Backup and Restore
How to Restore a Database to a New Location and Name (Transact-SQL)
How to change recovery model of a database
alter database [Database1] set recovery  full
alter database [Database1] set recovery  simple
How to backup a database
backup database [Database1] to disk  = 'c:\Backup\back.bak' with init
How to find information about a database
SP_HELPDB [Database1]
How to find the logical name of the database
RESTORE FILELISTONLY FROM DISK='full_path_of_backup_file'
How to restore the database to a new server with a new name
FROM DISK='full_path_of_backup_file'
WITH MOVE 'Database1' TO 'C:\Customers\DBS\Database2.mdf',
MOVE 'Database1_log' TO 'C:\Customers\DBS\Database2_log.ldf'
How to restore a vcenter database
----Alter Database to single user mode
----Restore Database
FROM DISK='C:\Backup\VCDB.bak'
MOVE 'vcdb' TO 'C:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL\Data\VIM_VCDB.mdf',
MOVE 'vcdb_log' TO 'C:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL\Data\VIM_VCDB_log.ldf'
----If there is an error in statement above, enter the following 
----command to revert to multi user

Thursday, September 9, 2010

Tuesday, September 7, 2010

How to enable remote connections to an SQL Server 2005 Express VMware VCenter Database

- Enabled remote connection on SQL Server Surface Area Configuration
Open SQL Server Surface Area Configuration.
Select Surface Area Configuration for Services and Connections.
On the left side, expand your SQL Server instance -> Database Engine -> Remote Connections. On the right side, select Local and remote connections -> using both TCP/IP and named pipes.
On the left side, select SQL Server Browser -> Service.
On the right side, if the startup type is Disable, you need to change to Automatic and click Apply and click Start button to start the service. Then, click OK.
- Change this registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer\LoginMode
(MSSQL.1 relates to the instance you want to play with – it could be MSSQL.2, or .3 etc).
It’s default value is 1. Set it to 2 to allow both windows authentication and sql logins.
You have to restart the SQL services before the changes apply.
- To change sa password open a command prompt and enter this command
osql -E -S vcenter\SQLEXP_VIM
You will see this prompt:
In this prompt enter these commands (replace sapwd with your password)
Type exit to exit osql
- Try to connect to SQL Server using sa account and entering your new password
osql -U sa -S vcenter\SQLEXP_VIM


How to Customize the Windows 7 Start Menu

Read the following link:

Thursday, September 2, 2010

How to delete files older than x days in Linux

To delete files older than 30 days in folder /home/user/path enter the command:
find /home/user/path -mtime +30 -exec rm {} \;
To delete also subdirectories enter the command:
find /home/user/path -mtime +30 -exec rm -rf {} \;