Syed Jahanzaib Personal Blog to Share Knowledge !

December 31, 2012

2012 in review [My Blog Report by WP]

Filed under: General IT Related — Tags: , , , — Syed Jahanzaib / Pinochio~:) @ 8:09 AM

The stats helper monkeys prepared a 2012 annual report for this blog.

Here’s an excerpt:

About 55,000 tourists visit Liechtenstein every year. This blog was viewed about 850,000 times in 2012. If it were Liechtenstein, it would take about 15 years for that many people to see it. Your blog had more visits than a small country in Europe!

Click here to see the complete report.

December 27, 2012

Howto configure GMAIL as SENDMAIL RELAY :D (Also can be used with RM to send Email Notifications)

Filed under: Linux Related, Radius Manager — Tags: , , — Syed Jahanzaib / Pinochio~:) @ 3:01 PM


If you want to use GMAIL as your sendmail relay server, Use the below configuration.

{I required it to send DMASOFTLAB RADIUS MANAGER Email notifications to all users regarding there service status, account expiry, renewal , various alerts and other info. that’s why I wrote this guide, it maybe useful for others too . . Syed Jahanzaib }

OS Used: Ubuntu 10.4 / 12.4

First install Sendmail and its utilities.

apt-get install sendmail mailutils

Now configure signed SSL certificates

 mkdir /etc/mail/certs
 chmod 700 /etc/mail/certs
 cd /etc/mail/certs

openssl dsaparam 1024 -out dsa1024 -out dsa1024.pem

(It will ask you various questiosn , just enter them accordingly, like country code, for Pakistan its PK, and other information you have)

openssl req -x509 -nodes -days 3650 -newkey dsa:dsa1024.pem -out /etc/mail/certs/mycert.pem -keyout /etc/mail/certs/mykey.pem

(It will ask you various questions , just enter them accordingly, like country code, for Pakistan its PK, and other information you have)

openssl req -x509 -new -days 3650 -key /etc/mail/certs/mykey.pem -out /etc/mail/certs/mycert.pem


ln -s /etc/mail/certs/mycert.pem /etc/mail/certs/CAcert.pem
 chmod 600 /etc/mail/certs/*
 cd ..

Now configure gmail SMTP authentication information, This file may be blank, just paste the text showed in code box.
nano  /etc/mail/authinfo "U:root" "" "P:PASSWORD" AuthInfo: "U:root" "" "P:PASSWORD"

Save & Exit & issue below command

makemap hash /etc/mail/authinfo < /etc/mail/authinfo
Now Add the following configurations at the bottom of file
nano /etc/mail/

dnl #
dnl # SSL Settings
define(`CERT_DIR', `MAIL_SETTINGS_DIR`'certs')
define(`confCACERT_PATH', `CERT_DIR')
define(`confCACERT', `CERT_DIR/CAcert.pem')
define(`confSERVER_CERT', `CERT_DIR/mycert.pem')
define(`confSERVER_KEY', `CERT_DIR/mykey.pem')
define(`confCLIENT_CERT', `CERT_DIR/mycert.pem')
define(`confCLIENT_KEY', `CERT_DIR/mykey.pem')
dnl #
define(`RELAY_MAILER_ARGS', `TCP $h 587')dnl
define(`ESMTP_MAILER_ARGS', `TCP $h 587')dnl
define(`confAUTH_OPTIONS', `A p')dnl
FEATURE(`authinfo',`hash -o /etc/mail/authinfo.db')dnl

Now rebuild sendmail config and start the service 😀

make -C /etc/mail
service sendmail restart


Test the setup 😉

Use the below command to test the local smtp .

– – – – -??

Syed Jahanzaib

Short notes for Ubuntu 12.4 Apache Server


Following are some short notes / references for APACHE related configuration in Ubuntu
[I used Ubuntu 12.4 version in this post]

1- Howto Disable DIRECTORY BROWSING in apache2 / Ubuntu 12.4

If you want to Disable Browsing on every folder inside /var/www/ then Edit following file

nano /etc/apache2/sites-available/default

& Change the Options

‘Options Indexes FollowSymLinks MultiViews’
‘Options FollowSymLinks MultiViews’

(means Remove the Indexes word).
and restart apache2 service by

service apcahe2 restart

OR to Disable Directory Browsing for ‘specific folder’ like /var/www/backup

Remove the following directive from your required folder.


For example,  you want to remove directory browsing for /var/www/backup folder.
Edit the below file /etc/apache2/sites-enabled/000-default by using following command

nano /etc/apache2/sites-enabled/000-default

The Default config is below.

Alias /backup /var/www/backup

DirectoryIndex index.html
Options Includes Indexes FollowSymLinks MultiViews

Change it below

Alias /backup /var/www/backup

#DirectoryIndex index.html
Options Includes FollowSymLinks MultiViews

Save & Exit , then Restart APACHE Service by

service apache2 restart


4- Howto Password Protect Apache Folder with .htaccess

If you want to password protect specific folder in Apache so unauthorized users cannot access it, use the following method. There are other better methods available, You can follow them for best practices. I just achieved it this way,,,

First Create password file

htpasswd -c /etc/apache2/passwd zaibtest

(Replace zaibtest with your required username, It will ask you for password, enter password you like to set for user zaibtest. Also you can save this file anywhere you like)

Now protect your required folder, for example I want to protect /var/www/backup folder, then use the following directives in in /etc/apache2/sites-enabled/000-default

nano /etc/apache2/sites-enabled/000-default

Now in end before </Virtualhost> , add following lines …

AllowOverride All
Require all granted

Save & Exit , then Restart APACHE2 Service by

service apache2 restart

Now try to access the folder, it will ask you the password.

After providing valid id password, you can access your folder. (I use it to download backup data from remote location)




apache2: Could not reliably determine the server’s fully qualified domain name,

 … waiting ..
apache2: Could not reliably determine the server’s fully qualified name

If you see above error while restarting apache2 service, To fix that problem, you need to add and directive in the the httpd.conf file. Open the terminal and type,

nano /etc/apache2/httpd.conf

By default httpd.conf file will be blank. Now, simply add the following line to the file.

ServerName localhost

Save & EXIT.

Now restart the server.

service apache2 restart
This time, you will not see any error. 🙂

6- Howto set Default page to some other page/extension

Edit file `etc/apache2/mods-available/dir.conf` by

nano /etc/apache2/mods-available/dir.conf

and add your option like

DirectoryIndex admin.php index.html index.cgi index.php index.xhtml index.htm
Save & restart apache2 service
service apache2 restart

7- Creating Short name (ALIAS) for Radius Manager (in Ubuntu 12.4)

If you want to access your radius manager admin panel via short name (like alias)
Example: You want to use short path to actually access the

Then edit file /etc/apache2/sites-enabled/000-default

and add lines before /virtualhost directive,

Alias /panel /var/www/radiusmanager

DirectoryIndex admin.php
Options Includes FollowSymLinks MultiViews
AllowOverride None
order allow,deny
allow from all

Now restart apache by service apache2 restart and try to access the site using /panel alias.

# Creating ALIAS for folder outside www folder [Tested with Ubuntu 16.4]

[Modified on 26-DEC-2018]

Edit apache2 default config file

nano /etc/apache2/sites-enabled/000-default.conf

Paste following before </VirtualHost> word (this line is usually the last line in this config file, change the name of download1 & folder according to your local setup

Alias /download1 "/some_local_folder/"

#DirectoryIndex index.html
Options Includes FollowSymLinks MultiViews Indexes
AllowOverride None
order allow,deny
allow from all
Require all granted

& restart apache2 server

service apache2 restart

Change apache2 default port


nano /etc/apache2/ports.conf

# Change Listen 80 to some other port example 1235

Listen 1235

Save and exit.

Now edit

nano /etc/apache2/sites-enabled/000-default

and change <VirtualHost *:80> to some other port like

save and exit,

restart apache

service apache2 restart

Restrict direct file access via .htaccess

we have folder inside /var/www/html/somefolder , we want to restrict direct file view

create .htaccess file and put

order allow,deny
deny from all

Log Source Report Port in Apache’s LOG

To log source user port as well

Edit the apache config file & ADD %{remote}p directive to combined & common section

LogFormat "%h %{remote}p %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %{remote}p %l %u %t \"%r\" %>s %O" common

Now you will see the port as well…

Please refer to following URL for more information

Syed Jahanzaib

December 24, 2012

Sending Payment Reminder / Service Status SMS to Users via GAMMU using CLI/GUI

Filed under: Linux Related — Tags: , , — Syed Jahanzaib / Pinochio~:) @ 2:43 PM


Following is a short guide on how you can create your own SMS panel to send SMS to users about various Events using CLI or GUI method.

For example Payment Reminder, Service Down/Up Alert, and any other message you like to convey to all users.

If you have some prior experience with the Linux/SMS tools, I am sure you will ask why to do so much manual work if you already have open source free tools like smsplay, kannel and many others available , the answer is YES the pre made tools/applications have very nice GUI and and have other functions as well, you simply have to install it by single command and that’s it ready to use, but I always like to build my own solution rather then relying on the pre made applications, This way I can twist and modify the method as per my requirements. & yes its fun to play with the code and you feel much confident, happy and relaxed if you manage to create your own working solution that can fulfill your requirement.

Just FYI, DMASOFTLAB Radius Manager 4.1.x will have the function to send account expiry warning SMS before account expires.


Hardware Required:

# GSM Mobile / MODEM
(I used TELTONIKA GSM USB Device in this example, Picture is attached below . . .)

Software Required:

# Ubuntu 10.x or any flavor of Linux you like to use.
# GAMMU or GNOKII (you can install gammu by apt-get install gammu )

(A very good guide for GAMMU installation & configuration is available here


Connect your GSM modem to your Linux Box via USB,
Make sure it is detected properly by Identifying it using DMESG command

dmesg | grep tty
(You may see following information if device is detected OK, As showed below)

1- detect modem

As you can see that the modem have been detected as USB ACM DEVICE ttyACM0

Now run gammu config by

It will ask you that gammu configuration file exists, click YES to continue
Now configuration box will open, Select the PORT and EDIT & type your port name that is detected in the dmesg command.
2- port.
3- portname
Click on OK , then SAVE and EXIT

Now identify it by using following command.

gammu –identify
(You may see following information if its connected OK , As showed below)

root@zaib-desktop:/sms# gammu –identify
Manufacturer         :   Teltonika
Model                      :   unknown (TM3 EDGE)
Firmware                :   05.41.02
IMEI                       :   3523870xxxxxxxx
SIM IMSI               :   410012xxxxxxx62

Test the configuration by sending SMS to your number using CLI method. Use the below command to send sms to your mobile.

echo “Zaib Test Message” | gammu sendsms TEXT 03333021909

If you don’t see any error message and receive the message to your number, then we are good to GO . . .


You can also use WAMMUwhich is a nice GUI frontend for GAMMU. Using it you can perform following functions easily.

Using wammu you can read/edit/delete/copy your contacts, to-do, calendar you can read/create/save/send and Backup your sms. Some type of phone supports file sending, display message including pictures and ringtones playback. Support for backup and import in various formats (vCard, vCalendar, iCalendar, gammu own backup,…) . Export messages to mail (IMAP4, maildir and mailbox storages are supported.
To install wammu, simply issue below command from GUI terminal.
apt-get install wammu
After installation completes, Goto Applications / Accessories / >Wammu
Run its configuration wizard to detect the modem and start using it 🙂



Download following sms-panel-zaib.rar file from following location , and extract all files in a new folder /sms

Following are the contents of /sms (after extracting)

root@zaib-desktop:~# ls /sms

start = > It executes all the scripts in order, First init , then startsms
     => Contains Users Mobile Numbers and Names, Sample Numbers are included. Modify it as per your requirements
path => Contains all the paths for the scripts/dir
=> This script extracts mobile nos and data from various sources and create temporarily dunp files
message => Contains Message that will be sent to users, Modify it as per your requirements = > Automatically created via script which contain mobile nos. only
startsm => This script actually sends sms using gammu


Now first edit data file which contains the mobile numbers.

nano /sms/data

Type your user mobile number in the following manner

# User’s Mobile Numbers and there Names
03333021909 # Syed Jahanzaib-Admin No.
03331234567 # A-420, Lake View Cottages :d
03211122334 # X-20, A One Villas Bungalows :p

Now SAVE and EXIT ( By pressing CTRL+O , then ENTER, then CTRL+X )

Edit the message file, it will contain the message that will be delivered to users.

nano /sms/message

Now type your required message. For example:

Dear User,
Due to some scheduled maintenance work, Internet service will not be available from 3:00pm till 5:00pm on 25th December, 2012. 

Thank you for your co-operation & Sorry for the inconvenience.

AA Networks (Pvt) Ltd. / zaib 🙂

Now SAVE and EXIT ( By pressing CTRL+O , then ENTER, then CTRL+X )


Now type /sms/start to execute the whole process.
It will first execute init script which will extract data from the paths / files,
Then it will start sendsms script which will actually send the sms to all the numbers fetched from init scripts (Users mobile numbers are mentioned in the data file)


To use Customize GUI Panel, through which we can manage users mobile numbers list, and send sms to this list, You have to first install WEBMIN. which is a very nice multi purpose GUI tool to manage various Linux components

If you are using UBUNTU, you can install it via apt-get

First edit sources file, so that apt-get can fetch data from webmin directly.

nano /etc/apt/sources.list

Paste the following lines at end.

deb sarge contrib
deb sarge contrib

Save & Exit.

Now execute following commands to install GPG key with which the repository is signed. Use the below command.

cd /root
apt-key add jcameron-key.asc

Now you will be able to install with the commands :

apt-get update
apt-get install webmin

after successful install , you can access it using the URL  it showed you after successful message.Eample::
[Use your root ID & Password to Login],

After successful login, you will see following screen . . .



Click on Create A New File Editor
In Description, Type any EDIT USERS MOBILE NUMBER
in File to EDIT , tpye the mobile no file name  /sms/data
Click on SAVE
As showed in the image below . . .

6- Create File Editor.

Congrats, you have created a file editor which can edit the users mobile numbers,
After SAVING above file editor, you will be redirected back to main menu,
Now we will create a new file editor, which will actually send the message you type in the available box.

7- Create File Editor for message.

In Description, Type any Send SMS to ALL
In File to EDIT , tpye the message file name  /sms/message
In Command to run after saving, type /sms/start
Click on SAVE
As showed in the image below . . .

8- Create File Editor for message -2



Now you will have the menu  something like below.

9- Main menu.

Now Click on the Edit Users Mobile Nos. button
& add the required mobile numbers in following manner.

10- edit mobile numbersClick on SAVE to save the entries in /sms/data.


Now to send SMS to the list, Click on Send SMS to ALL
Type the message in the box, and click on SAVE, after saving, it will auto execute the /sms/start script which will start sending the message you just typed to the list. It may take long time to send SMS if you have large numbers of List. In my case, it took 3-4 Seconds per SMS.
As showed in the image below . . .

11- send sms


You can schedule various events alerts in CRON job by using pre defined message templates.

To be continued . . .


December 12, 2012

Howto add FTP server in ESXi 5.x to support Fast Download/Upload of VM / Images

Filed under: VMware Related — Tags: , , , — Syed Jahanzaib / Pinochio~:) @ 3:59 PM

Yesterday I was trying to upload a 450GB VMDK file to ESXi host. (Actually it was VHD file and I converted it to VMDK using starwind converter), and it was uploading dead slow and showed countless hours to complete the upload.  After some googling I found that generally it takes too much time to Upload/Download any VM/ISO File FROM/TO ESXi host. I also tried VEEAM FASTSCP free tool but no avail. It still works very slow.

However if you add FTP service to your ESXi server, and use ftp client to upload/download files, then the upload/download will be much faster.  ProFTPD runs good in ESXi 5.x and offers high transfer rate over normal transfers.
As showed in the image below . . .

Upload to ESXi Host using Vsphere Client


Upload to ESXi Host using FTP Client [After adding FTP service in ESXi]



To add FTP Service, use the following method.

First We have to Enable SSH in ESXi . Connect to your ESXi host,
Goto Configuration
Goto Security Profiles,
Click on Properties


2- enable-ssh


3- enable-ssh

SSH service is now enabled on ESXi.

Now Connect to your ESXi host using any ssh client like putty.
Navigate to your datastore folder. For example the datastore on my ESXi host name is 1TB,

 cd /vmfs/volumes/1TB/
[Change the 1TB to match your datastore name]

Create any folder where your FTP Service files can be downloaded from the internet or any other source.
[make sure internet service is enabled so file can dierctly download to esxi host, if its not possible then download the package on your client PC, then upload it using Vsphere client and skip to esxcli software install section below . . . ]

mkdir ftp
cd ftp

Now download proftpd by using wget


Now install it by using esxcli

esxcli software vib install --no-sig-check -d /vmfs/volumes/1TB/ftp/

[Change the 1TB to match your datastore name]

Later if you decide to remove proftp , simply issue following command

To uninstall the package run the following command

esxcli software vib remove -n ProFTPD

Now test it by using simple dos ftp command



Or using any ftp client like   CUTEFTP PRO


Syed Jahanzaib

December 10, 2012

Vritualization: 3 in 1 > Using Mikrotik + Squid Proxy + Radius on single machine to save resources :)

Filed under: General IT Related, Mikrotik Related, VMware Related — Tags: , , — Syed Jahanzaib / Pinochio~:) @ 1:12 PM



Its a good idea to virtualize various servers so underutilized hardware can be used more efficiently, as now a days, getting good hardware is not a big deal. It can save considerable amount of power consumption , reduced heat factor , easy to mange multiple VM using various tools like Vcenter / VEEAM (my favorite), VM Explorer , live migrations from one Virtual Server to Another, Backup & Restore becomes very easy and the list goes on . . .

Recently I did an installation of a network where they were low in hardware resources but still they wanted to utilize the benefits of Mikrotik Router OS with external Squid proxy server and also the Radius Billing Server . So in total they required at least 3 physical machines, but I managed to install all of them on single server using Virtualization technology of VMWARE ESXi 5.x (64bit) and it worked so great 🙂
Here is how I did it.

Note: Because of some time shortage, I am just giving you an idea how it can be done, I am not writing in pin point details on how to connect every machine with Virtual/Physical switches. I will write about it soon.

Hardware Used for the Example:

IBM Xseries 3650 XEON Dual Processors with Quad Cores p/p

3.5″ 15krpm SCSI in RAID 10 mode (300GB x 6) (the more Faster drives (like 10-15krpm) you have, the better result you will be able to achieve. Preferably in RAID mode, either 10 or 0, depend on your management and goals, in this example I used 15krpm SCSI HDD’s with dedicated RAID controller. I tested it on IBM xseries with RAID0 and found RAID 0 much more faster with 15krpm but its not redundant, one drive fail and your whole RAID will go down, so if you want redundancy, go with at least RAID 5 or RAID 10 (Recommended) , Raid 1 is also good as it mirrors each drive, but requires additional drives and also for proxy, its useless to use mirroring as it would be requiring more read/write burden on controller, oh GOD, in which argument I got into :p)

16GB RAM (Mikrotik doesn’t requires much RAM in fact it officially supports maximum of 2G, but Radius and Squid do requires some good amount of RAM, I dedicated 8 GB to SQUID, 4GB to Radius, 1 GB to Mikrotik)

4 Network Adapters ( In this article, due-to time shortage, I have only mentioned howto add two network adapters for LAN and WAN link using virtual Switch tech, but you can add more as per your requirements)

Software Used:

1) Vmware ESXi 5.x  64bit as a Virtual Hyper-visor Server

Guest OS installed in this virtual server’s are as following

2) Mikrotik Router-OS 5.22 [1GB Ram +100GB virtual HDD assigned to this VM]
3) Ubuntu 10.4 for SQUID Proxy (2.7) [8GB Ram +500GB virtual HDD assigned to this VM]
4) Ubuntu 10.4 for Radius Manager Billing System [4GB Ram +200GB virtual HDDassigned to this VM]

TIP: You can use the following RAID calculator to evaluate how much space you will be getting various RAID modes.

First install Vmware ESXi. You can get its free edition from  , just register and download the latest version , it would be in .iso format, Simply burn it to CD, and install it on your server , its very simple to install the ESXi, nothing more then just clicking NEXT NEXT 🙂

After ESXi installed, configure IP address on it, so you can manage it using its client called Vsphere client.

To shorten the story I am using only two interfaces for the mikrotik, LAN and WAN. in this example (shorten version) ESXi have two interfaces connected , one with the LAN user switch and other interface connected with the WAN (physically)

Creating Virtual Switch and bind Network Adapters with this switch.

Goto Configuration tab
From the list appear in Hardware section, click on Networking and click on ADD Networking
As showed in the image below , , ,


2- add network wizard

3- add network wizard

4- add network wizard

5- add network wizard

Ok, our virtual switch is created.
Now its time to bind our WAN adapter in this switch. (So it can later be used for WAN for all hosts we will requiring for)

Click on the Properties
6- add network wizard

7- add network wizard


Creating Mikrotik in VM and assigning network adapters.

Now create new Virtual Machine for your Mikrotik.

Select necessary hardware that you required as required per user load. for example
Mikrotik = 1 CPU / 1 GB RAM / 10 GB HDD /

In Network Adapter Section, by default only one adapter is added, You have to add another adapter by selecting the number of adapters in drop down listing.
As showed in the image below . . .

8- adding lan wan in host

Once the configuration is completed. Simply install the Mikrotik in newly created hosts you just created in above steps.
After configuration is complete, review once again the host settings,
As showed in the image below . . .

9- Mikrotik Network Adapters
After the installation is done, Connect to mikrotik with WINBOX  and look for interfaces
As showed in the image below . . .



I will write more on it later.

Syed Jahanzaib

December 7, 2012

HyperV to VMware conversion

Filed under: VMware Related — Tags: , , — Syed Jahanzaib / Pinochio~:) @ 4:53 PM

Howto convert Hyper-V hosts to Vmware ESXi

Task: We want to convert one of our host server running on Hyper-V (installed on Windows 2008 R2 CORE edition), you can use Vmware Vcenter Converter utility to perform this action.

First Download Vmware Vcenter convertetr 5.x from following location.
You must have vmware account to download the utlity, you can rgister it free.

After installation Done. Execute it. You may see following screen.
As showed in the image below . . .

1- vmconverter


In Source Type , Select HYPER-V
In Server, type your Hyper-V IP
In User Name/Password , type your Administrator ID and password
and click NEXT to continue . . .
As showed in the image below . . .

2- convert-hyperv-machione

If you receive the following error
Unable to contact the specified host ‘x.x.x.x’ . The host might not be available on the network, there might be a network configuration problem, or the management services on this host are not responding
then disable the firewall on HYPERV Windows 2008 by using following command (at hyper v server command prompt)

netsh firewall set opmode disable

Now it will ask you for the agent deployment,
click YES to continue.
As showed in the image below . . .

3- agent



In next screen of  SOURCE SERVER , It will give you the list of machines hosted on source Hyper-V server.
Select your desired machine ,
and click NEXT to continue
As showed in the image below . . .

4- select source-vm-hyperv



In Next Screen of  DESTINATION SYSTEM , select the destination VMWARE ESXi Server
As showed in the image below . . .

5- select destination server.


In the next screen of  DESTINATION VIRTUAL MACHINE , Click NEXT to continue (Or you can change the machine name label here)
As showed in the image below . . .

6- select name.


In the next screen of  DESTINATION LOCATION , Select the datastore location (the drive where you want upload the vm)
As showed in the image below . . .

7- select datastore.

In the next screen , it will show you all the options before finally start converting, review all the options and modify if any required. then Click NEXT , and then FINISH to start converting the machine
As showed in the image below . . .

8- final



Finally it will start conversion of the hyper v machine into Vmware Esxi.
As showed in the image below . . .

9- status.


Syed Jahanzaib

Cisco 3750: Howto enable err-disabled ports

Filed under: Cisco Related — Tags: , , — Syed Jahanzaib / Pinochio~:) @ 2:09 PM

Personnel Reference Guide:


Errdisable is a feature that automatically disables a port on a Cisco Catalyst switch and is supported on most Catalyst switches running the Cisco IOS software.

The Errdisable error disable feature was designed to inform the administrator when there is a port problem or error.  The reasons a catalyst switch can go into Errdisable mode and shutdown a port are many and include:

  • Duplex Mismatch
  • Loopback Error
  • Link Flapping (up/down)
  • Port Security Violation
  • Broadcast Storms
  • etc

When a port is in error-disabled state, it is effectively shut down and no traffic is sent or received on that port. The port LED is set to the orange color and, when you issue the show interfaces command, the port status shows as Errdisabled.

To enable err-disabled ports on Cisco 3750 switch series. Follow the below . . .

First make telnet connection with the switch


(change the ip as required,)
Enter Password to continue.

To view Disabled Ports:

show interfaces status err-disabled


NOC_SWITCH>show int status err-disabled

Port      Name               Status                    Reason               Err-disabled Vlans
Gi2/0/10                     err-disabled         link-flap


To Enable Port:

config t
int G2/0/10
no shut

Change the interface name to match your. In above example I had two 3750-e models in stack mode. so its showing G2, you may get G1 if you have single switch.

Link flap means that the specific port continuously goes up and down. The port is put into the errdisabled state if it flaps more than four-five times in few seconds or if LOOPPBACK is detected. The common cause of link flap is a Layer 1 issue such as a bad cable, duplex mismatch.


Auto recovery of port shut dueto violation

  • errdisable recovery cause loop-back

We can enable recovery loop-back only too. This is lab environment, so to make recovery faster we will configure recovery timer 30 seconds.

  • errdisable recovery interval 30

you can enable for all reason using below command-

  • errdisable recovery cause all

Use this command to disable port security, NOT RECOMMENDED

no switchport port-security

(< You probably dont need this line, its just to disable pot security feature, I used it to perform various tests)

For more detailed and brief descriptions, please visit

Syed Jahanzaib

December 4, 2012

Howto change MAC address of VM hosted in VM-Workstation

Filed under: VMware Related — Syed Jahanzaib / Pinochio~:) @ 9:02 AM



Manually Assigning a MAC Address For VM

To make sure that the same MAC address is assigned to a given virtual machine every time, even if the virtual machine is moved, you can assign the address manually instead of allowing VMware Workstation to assign it automatically. To assign the same, unique MAC address to any virtual machine manually, use a text editor to remove three lines from the configuration file and add two lines. The configuration file has a .vmx extension at the end of the file name.

To change MAC address of any virtual machine running under VM Workstation, Follow the below . . .

1- Make sure that the target VM is turned off.
2- Browse to folder where your VM is available. For example

3- Now open VMX file in NOTEPAD , the name would be something like machine_name.VMX

4- Remove the three lines from the configuration file that begin with:


[Note: Change the ethernet0 to match your’s]

Now Add a new static MAC address line to the configuration file with help of the following entries:

ethernet0.addressType = "static"
 ethernet0.address = "00:11:22:33:44:55"

5- Now Save the configuration file. & Start the VM

Syed Jahanzaib

%d bloggers like this: