Tag: port

Test-NetConnection PowerShell Portscan

SuperPing – PowerShell Test-NetConnection

With Windows 8.1 and Windows Server 2012, R2 Microsoft released PowerShell v4 with new PowerShell modules and new PowerShell cmdlets. One of them is the new Test-NetConnection cmdlet, which does replace some simple network tools like Ping, Traceroute, port scanner, and more.

First, if you just run Test-NetConnection, this will check a Microsoft edge server and will tell you if your internet is working or not.

PowerShell Test-NetConnection

You can also ping other servers.

Test-NetConnection Ping

If we have a closer look at this cmdlet, we can see that we can do much more.

get-help get-testnetconnection

What we can do is something like a port scan. In this example, I check if the RDP port is open on my webserver. Which is hopefully not ;-)

Test-NetConnection thomasmaurer.ch -CommonTCPPort RDP

Test-NetConnection PowerShell Portscan

You can also check for not so common ports by using the -Port parameter and entering the port number.
Another thing you could do would be a simple traceroute.

Test-NetConnection thomasmaurer.ch -TraceRoute

Test-NetConnection PowerShell Traceroute

If you want to do a ping -t you could use the following command

while ($true) {Test-NetConnection -InformationLevel Quiet}

Ping -t with PowerShell

I hope this helps you a little :)

Find more networking PowerShell cmdlets in my PowerShell Networking cheatsheet.

Windows PPTP VPN with Cisco Linksys RV042

Cisco Linksys RV042

Today I was setting up my little lab, I decided to create a Windows PPTP VPN for my lab network which should give me more comfort. First I installed the Network Policy and Access Services Role and did the configuration. I also enabled PPTP Passthrough, added a port forwarding and a firewall rule to my Cisco Linksys RV042. I know the RV042 is not really a big deal, but you have a lot of jobs and if you don’t really need a lot of network options, like me in my lab, this is a pretty cool device.

I now tested the VPN Connection with my Windows 7 Client. Error 800 and 807 which basically means no connection through the firewalls with the VPN Server.

I checked again the Firewall Configuration on my RV042, and could not found any mistake. After a quick search with Google and Bing ;-) I saw a lot of posts with the same problem and the Linksys RV042.

After some search I came to a solution, I deactivated the SPI Firewall on the Device, and this caused the problem. After activating the SPI Firewall again, the error was gone and the VPN worked.

Network Cisco iOS Workshop @KTSI

Small CISCO Network iOS Workshop at KTSI

Set Switch IP

Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#interface vlan 1
Switch(config-if)#ip address

Port Mirroring

Switch(config)#monitor session 1 source interface fastEthernet 0/1
Switch(config)#monitor session 1 destination interface fastEthernet 0/24
Switch(config)#no monitor session 1

MAC Address Security

Switch(config)#interface fastEthernet 0/1
--->Switch(config-if)#switchport port-security mac-address sticky
Switch(config-if)#switchport mode access
Switch(config-if)#switchport port-security
Switch#show port-security

Activate Port again

Switch(config-if)#no shutdown

Spanning Tree

Switch(config-if)#spanning-tree portfast
Switch(config)#no spanning-tree vlan 1v

CDP deactivate

Switch(config)#no cdp run

Activate Telnet

Switch(config)#line vty 0 15
Switch(config-line)#password ktsi
Switch(config-line)#transport input telnet
Switch(config-line)#transport output telnet

Webbrowser Access

Switch(config)#ip http server