Posts

Showing posts with the label CCNA

Cisco block telnet and SSH access

Block telnet and SSH access to the Cisco router.

The user must have the privilege to change the settings or basically the admin user account.

block all (telnet and ssh):

  line vty 0 4
  transport input none

sh startup-config (save config and will persist after reboot or shutdown)

sh running-config (config is save but will not persist after reboot or shutdown)

To enable or unblock:

line vty 0 4
 privilege level 15
 login local
 line vty 0 4
transport input telnet ssh

Before rolling out to production be sure to test it out or else you will leave a vulnerability in your network.

Cheers..till next time!

================================ Free Android Apps:
Click on links below to find out more:
Linux Android App cheat sheet: https://play.google.com/store/apps/details?id=com.LinuxMobileKit
Multiplication Table for early learnershttps://play.google.com/store/apps/details?id=com.TableMultiplication
Catholic Rosary Guide  for Android:
https://play.google.com/store/apps/details?id=com.myrosaryapp
http:…

Delete Directories with Wildcards using rd or rmdir

Deleting files in command prompt using wildcards is quite straight forward.
Command below will delete all text (".txt") files on the specified path.
Del D:\txtlog\*.txt
Command above will delete all files with ".txt" extension in d:\txtlog directory.
Easy enough to delete all matching files.
Using the same method with rmdir or rd command this will not work.

For example, if we have a directory on d drive that is auto-generated by an application and the filename is consistent with a pattern plus incrementing number at the end to differentiate the folder from other folders.

   D:\baklogs\log1\    D:\baklogs\log2\    D:\baklogs\log3\    Etc..    D:\baklogs\log100\

The folder name has a consistent pattern that is preceded by the word “log” plus incrementing number.
If the command below is executed to remove the directories in one go, an error is shown which has this message: "The filename, directory name, or volume label syntax is incorrect."
rmdir D:\baklogs\…

Get network interfaces description in Windows

Netsh is a command line tool that is very useful provided of course you know exactly on how to use it.
Below is an example on how to display the GUID and the description of the network interface card.
   netsh trace show interfaces
Sample output: Ethernet adapter Ethernet: Description:Intel(R) I350 Gigabit Network Connection Interface GUID:{1C8DC74A-0BCD-48FF-F3B7-26B1FF4D5650} Interface Index: 12 Interface Luid:0x8000008000000

Tunnel adapter isatap.{BCF65C9D-CB58-49F7-8BA1-88DBF2A6FBCE}: Description:Microsoft ISATAP Adapter #3 Interface GUID:{F8BB0A84-D5A4-CA93-BA100-27EF2898CC82} Interface Index: 19 Interface Luid:0x12000005000000
The GUID (globally unique identifier) is used to identify objects in Windows registry. The above command shows the description and the interface GUID, but the above command also can be used to sniff or capture traffic.
netsh trace start capture=YES report=YES persistent=YES
Netsh packet sniffing is quite handy because it's already built-in on the system and no …

Rename interface or network adapter name using PowerShell or Command line

How to rename interface or network adapter name using command line or Powershell?


In  Windows network connection window, it shows the list of available network card on the computer, NICs are listed with its name, interface card vendor name (like Intel(R) I350 Gigabit) and its connection name whether it's domain network, local network, private or other network connection name.

Network connections window can be access by typing "ncpa.cpl" from windows run box. Or typing "control cpa.cpl" from command line. Of course it can also be access via GUI from the control panel or task bar.

To rename Interface name using netsh via command line:

Netsh interface set interface name="Local Network" newname="Private LAN Network"


If the server or computer has multiple nics; its better to set the interface name with identifiable name that best describes the interface connection.

Netsh interface set interface name="Local Network" newname="NIC 1 W…

PowerShell Get IP Address and Subnet mask

Get IP Address, MAC Address and Subnet mask.

It also displays the CIDR (Classless InterDomain Routing) notation.

Here's the script:
 ======================================

$nic_configuration = gwmi -computer .  -class "win32_networkadapterconfiguration" | Where-Object {$_.defaultIPGateway -ne $null}
$IP = $nic_configuration.ipaddress
write-output " IP Address : $IP"

$MAC_Address = $nic_configuration.MACAddress
write-output " MAC Address :  $MAC_Address"

$SubnetMask = $nic_configuration.ipsubnet

switch ($SubnetMask) {
255.255.255.255   {" Subnet mask is: 255.255.255.255 or /32 "}
255.255.255.254   {" Subnet mask is: 255.255.255.254  or   /31 "}
255.255.255.252   {" Subnet mask is:  255.255.255.252 or   /30 "}
255.255.255.248   {" Subnet mask is: 255.255.255.248 or  /29 "}
255.255.255.240   {" Subnet mask is:   255.255.255.240   or   /28"}
255.255.255.224   {" Subnet mask is:   255.255.255.224   or   /27&q…

PowerShell check network adapters error

How to check network adapters for error?
How to whether network device is working properly?
How to diagnose specific errors in network adapters?

How to check whether network device driver registry is corrupted?

To all of the questions above, PowerShell will come to the rescue.
In Windows Task Scheduler the only thing you want to see 0X0, which basically means operation has completed successfully. Other than 0X0 means something went wrong and needs to hone your troubleshooting skills.
For network adapters it goes the same way as well. PowerShell script below reads the Windows 
Configuration Manager error code and display specific errors for network adapters issue.
Below is the table from MSDN that shows values for Windows Configuration Manager errors.
MSDN link:https://msdn.microsoft.com/en-s/library/aa394216%28v=vs.85%29.aspx#properties
Windows Configuration Manager error code. Value Meaning 0 (0x0) Device is working properly. 1 (0x1) Device is not configured correctly. 2 (0x2) Windows cann…