Posts

Showing posts with the label Basic Network Tools

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

Set IP Address using Netsh and PowerShell

How to set IP Address of the remote computer using PowerShell?
How to set DNS IP Address of the remote computer using PowerShell?
How to set static IP and DNS address in local or remote computer via PowerShell?

Script below will set local IP or set remote IP Address using PowerShell with the help of Netsh command.

For the script to work Winrm or Windows Remote Management must be enabled either on the local PC or remote computer or server.
The script of course needs to run at an elevated mode with the proper rights or privileges or in simple words the script will work only if you have the administrator rights.

Here’s the script:
#===============================
$set_IP= { netshinterfaceipsetaddress"Wi-Fi"static192.168.1.107255.255.255.0192.168.1.254}
$set_DNS1= {netshinterfaceipadddns"Wi-Fi"8.8.8.8 }
$SET_DNS2= { netshinterfaceipadddns"Wi-Fi"4.2.2.2index=2  }
$show_ipconfig= { ipconfig/all }

Invoke-Command-ScriptBlock$set_IP-ComputerName. Invoke-Command-ScriptBl…

PowerShell get network adapter Speed

How to check network adapter speed installed on a computer using PowerShell?
Code snippet below will get the name of all the network adapter installed on a computer and also the speed.
To use the script on a remote computer supply the computer name and run the script with appropriate privileges to get the data on the remote computer.
#===========================
$computer_name="." $Net_adapter=gwmi-classWin32_NetworkAdapter-namespace"root\CIMV2" ` -computername$computer_name

foreach ($objItemin$Net_adapter) {
"Adapter is: "+$objItem.name +" -- "+"Adapter Speed is: "+[math]::truncate($objItem.speed/1MB) +" MB"
}
#===========================
Change the 1MB to 1GB if you need the output in GB.

Sample Output:
Adapter is: Teredo Tunneling Pseudo-Interface -- Adapter Speed is: 0 MB Adapter is: Microsoft ISATAP Adapter #3 -- Adapter Speed is: 0 MB Adapter is: VMware Virtual Ethernet Adapter for VMnet1 -- Adapter Speed is: 95 MB Adapter is:…

JunOS DHCP set MAC or static binding

How to set a static binding in JunOS? How to set a reservation of MAC address in DHCP? How to configure DHCP manual bindings? Different ways of asking on how to do but only one  specific goal, to assign an IP Address to a specific MAC or hardware. In JunOS SRX firewalls type this command: set system services dhcp static-binding 01:02:03:09:0A:0B fixed-address 192.168.1.1 IP Address of 192.168.1.1 will be assigned to a device with this MAC or hardware identifier of 01:02:03:09:0A:0B . See reference below for more details: http://www.juniper.net/documentation/en_US/junos12.1/topics/example/security-device-dhcp-server-configuring.html To do a reservation of MAC Address on Windows see below: Using Windows GUI see this link: https://technet.microsoft.com/en-us/library/dd759190.aspx The GUI instruction may change from version of the operating system but the logic on how to do it stays the same, you need to know the MAC address which will serve as an identifier so DHCP will know what IP Address will be …

Juniper JunOS show configuration

Windows export firewall policy

Use netsh in Windows 7 to export firewall policy using command line.

Open an elevated command prompt and type the netshell command below.

netsh advfirewall export d:\myfirewall.txt


If everything works fine it will display "Ok."

It's exported using a filename with ".txt" extension, but the output is not readable using any text editor.

You can save the file to a USB drive as a backup or import the firewall policy to another computer.


To import the exported firewall policy use this command:

netsh advfirewall import d:\myfirewall.txt


Just replace the word export with "import" and specified the path location of the file.

A very simple way to export firewall policies.


If you want to dig further check out Technet link below:

https://technet.microsoft.com/en-us/library/cc770887%28v=ws.10%29.aspx

If you don't like doing it using command line, exporting firewall policy can also be done using GUI.

Open "Windows Firewall with Advance Security" and loo…

Show interfaces via command line

Netstat to check listening ports

To check listening ports on windows, netstat is a tool that is quite handy.

And not only windows uses this tool, Linux system use this tool also. In windows to check listening ports and the application that uses the port type:

netstat -abn

The command needs to run at an elevated command prompt.

netstat -ano  is able to check listening and established ports.

Check out this link on how to open an elevated command prompt:
http://quickbytesstuff.blogspot.sg/2014/10/open-elevated-command-prompt.html

The command will list the local address the foreign address or the public ip and the state.

Example output will be like this:

[chrome.exe]
 TCP    192.168.1.50:3101    0.0.117.1:443     ESTABLISHED

In Linux this command would come handy:

netstat -tulpn

It will list the udp, tcp ports that are listening and also the daemon service listening or using the port.

Check out link below how to use netstat and Powershell to check open ports in Windows.
http://quickbytesstuff.blogspot.sg/2014/08/check-for-op…

Unable to connect wireless network

Image