February 13

Cisco Switch Configuration Sample

enable

conf  t

hostname abc

banner motd ? Unauthorized access is not ok ?

no IP domain-lookup

ip domain-name abc.com

crypto key generate rsa   (use 2048)

ip ssh version 2

enable secret abc

username admin  secret 12345

(if use command “username admin privilege 15 secret 12345″, the user admin has the “enable” access right way once login to the device without typing “enable”. note: the privilege 15 is not working when using aaa new-model, aaa authentication enable default enable )

 

line vty 0  4

logging synchronous

login local

transport input ssh (only allow ssh connection.  To enable ssh, please run hostname, ip domain-name and crypto key generate rsa first)

transport output ssh

exec-timeout 0 0 (minutes  seconds, 0 means unlimited)

(note: in Cisco packet tracer,  using “transport input ssh telnet”  packet tracer says that telnet is invalid input. If I swap ssh and telnet, it says ssh is invalid. There must be a bug in packet tracer. “transport input ssh telnet” works on cisco switch 3750 )

 

line con 0

login local

logging sync

line vty 5 15

no login

 

vlan 10

name server

interface vlan 10

ip address 1.1.1.1 255.255.255.0

 

interface vlan 1

ip address 10.10.10.10  255.255.255.0

no shutdown

 

int g1/0/1

switchport mode access

switchport access vlan 10

 

interface g1/0/23

switchport trunk encapsulation dot1q  (for older switches)

switchport mode trunk

switchport nonegeotiate

 

int g1/0/2 (for a layer 3 switch or a router, assign a physical port ip address)
no switchport
ip address 2.2.2.2 255.255.255.0

 

Vtp mode transparent

Ntp server 132.246.11.227  (or use 216.239.35.4)

Clock timezone AST -4

Clock summer-time ADT recurring

 

No vstack

Ip default-gateway 192.168.30.111    ****** (don’t use if ip route is enabled)

 

* configure and verify EtherChannel (port channel)

int range g1/0/1-2

channel-group 1 mode active  (using LACP mode, the connected partner switch needs to use passive.  choose desirable/auto if prefer PAGP mode, which is Cisco proprietary protocol)

show etherchannel summary; show etherchannel port-channel; show  interfaces port-channel 1(show etherchannel status)

service password-encryption (optional, if not using secret for enable password and use line vty password)

Category: Cisco | LEAVE A COMMENT
October 29

WdsClient: An Error Occurred While Obtaining an IP Address from the DHCP server

The Problem: Trying to deploy a VM in VMWare Esxi 6.5 using a Windows 2012 R2 WDS server, the VM pops up an error, saying “WdsClient: An error occurred while obtaining an ip address from the dhcp server. Please check to ensure that there is an operational DHCP server on this network segment.”

The cause: If you setup your VM using Vmxnet3, you will see this problem as Windows 2012 R2 boot image doesn’t have the driver. If you setup your VM using E1000e nic, it will work fine.

The Solutions: Use E1000e nic if you can. If not, here are the links

VMware KB 1038585

Here is a detail instruction from Helpful IT if you choose to use VMXNET3

Category: Vmware | LEAVE A COMMENT
October 17

How to Backup and Restore Cisco Switch Config File?

Here is the original link from cisco

Use a TFTP Server to Backup and Restore a Configuration

Before you proceed with this method, make sure you have a TFTP server on the network to which you have IP connectivity.

  1. At the Router> prompt, issue the enable command, and provide the required password when prompted.

    The prompt changes to Router#, which indicates that the router is now in privileged mode.

  2. Copy the running configuration file to the TFTP server:
    CE_2#copy running-config tftp:
    Address or name of remote host []? 64.104.207.171
    Destination filename [ce_2-confg]? backup_cfg_for_my_router
    !!
    1030 bytes copied in 2.489 secs (395 bytes/sec)
    CE_2#
  3. Open the configuration file with a text editor. Search for and remove any line that starts with “AAA”.

    Note: This step is to remove any security commands that can lock you out of the router.

  4. Copy the configuration file from the TFTP server to a new router in privileged (enable) mode which has a basic configuration.
    Router#copy tftp: running-config
    Address or name of remote host []? 64.104.207.171
    Source filename []? backup_cfg_for_my_router
    Destination filename [running-config]?
    Accessing tftp://10.66.64.10/backup_cfg_for_my_router...
    Loading backup_cfg_for_router from 64.104.207.171 (via FastEthernet0/0): !
    [OK - 1030 bytes]
    
    1030 bytes copied in 9.612 secs (107 bytes/sec)
    CE_2#
Category: Cisco | LEAVE A COMMENT
October 14

Windows 7 Windows Explorer Stopped Working When Copy File From USB Drive

Problem: 

Windows 7:  Windows Explorer has Stopped Working When Copy File From a USB Drive.

Solutions: Uninstall MyWinLocker

Or you can download ShellExView from Nirsoft and find out which extension causes the problem by disabling it.

See the picture below.

Sort the extensions by clicking “Microsoft” and right click the none Microsoft extension to disable it, until find the one that causes the problem.

Image

Category: Windows | LEAVE A COMMENT
October 6

Youtube-dl Quick Commands

Download High quality mp3 audio, and use video title as file name

youtube-dl -o '%(title)s.%(ext)s' --extract-audio --audio-format mp3 --audio-quality 0 url

 

Download High quality mp3 audios that have min view 2000, and use video title as file name, 

youtube-dl -o '%(title)s.%(ext)s' --min-view 20000 --extract-audio --audio-format mp3 --audio-quality 0 url

 

Do not download any videos with less than count views, and use video title as file name

youtube-dl  -o '%(title)s'  --min-views 1000  url

 

Download best quality video play list and use video title as file name

youtube-dl -o "%(title)s.%(ext)s" -cwi --format best --yes-playlist "url"

-cwi is a shorter alternative to –continue –no-overwrites –ignore-errors

 

Download the best video 

youtube-dl -f best url

List Available Formats

youtube-dl -F "url"

For more information:

https://github.com/rg3/youtube-dl/blob/master/README.md#readme