Skip to main content

Posts

Showing posts with the label CCNA

PowerShell Ping IP get status or reply

How to ping sweep a network?
How to ping sweep a subnet?
There’s a lot of ways to ping the whole subnet or do a sweep ping to the whole network, of course download any free software that can do this, or just manually ping the whole network by manually changing the IP address.
Or do an old school method, using a batch file. This link shows how to ping the whole subnet via command line. http://quickbytesstuff.blogspot.sg/2015/11/how-to-ping-whole-subnet-using-batch.html
Since PowerShell is readily available from Windows 7 up to the newer versions of Windows. Then PowerShell is the perfect choice to do this task.
Open PowerShell ISE or the PowerShell command line, then type or copy the commands below:
$ping = New-Object System.Net.Networkinformation.Ping 1..254 | % { $ping.send(“192.168.1.$_”) | select address, status | ft -auto }

Change the IP Address (192.168.X.X) to the IP address range of your network.
What the script does, is to Ping the whole network starting from 1 to 254, basically the w…

IOT – what is it about?

IOT –  an acronym for Internet of things.
What is IOT? What is it about? What does it do?
IOT composes of two components, Internet and things.
So, what are the things? Things are smart phone, Arduino, Beagle bone, Raspberry Pi, Smart TV’s, Refrigerators, air-condition system or basically any devices or appliances that are capable to be connected to the network or to the Internet.
If those thing, devices or appliances is not connected to the network or internet they are just on their own. They are just things of the people who owned them.
But once they are connected to the Internet and are controlled remotely, then it becomes an IOT the Internet of Things, since they are already part of a larger network. In which, some software or individuals can access to the things remotely.
IOT is a good thing but there will always be individuals who will abuse or do evil things. IOT devices or appliances should be safe and secure. But things are hackable and I guess it will just be a matter of time befo…

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://quickbyte…

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…