Tag Archives: Networking

Powershell oneliner to check network connections used on current machine based on Mike Robin’s blog post

Mike Robins had a nice tip yesterday about using powershell to see what your system is talking to and I thought I would tweak it slightly to potentially make it even more useful.

When I ran the command on my machine it took a while to run and I also thought it would be nice to tweak it so that the machine does a reverse dns lookup to retrieve the host names that the system is talking to. This might provide an indication of whether the connection is good or not.

I saved the output of the command to a variable so if I need to tweak the display output I can do so easily without running the script again.

$a=Get-NetTCPConnection -State Established | `
Select-Object -Property LocalPort, RemoteAddress, RemotePort, State,`
@{name='Process';expression={(Get-Process -Id $_.OwningProcess).Name}}, `
@{name='fqdn';expression={([System.Net.Dns]::GetHostByAddress($_.Remoteaddress).Hostname)}},`
 CreationTime
$a

This is a very quick and dirty hack and takes ages to run on my computer. It probably doesn’t help that I have a ton of chrome tabs open which will require a lot of dns lookups and several of them are the same host but this method will lookup them all up individually. IP  and dns lookup on active network connections

 

Yes, I split this ‘one-liner’ into multiple lines to make it easier to read on the screen but if you have to do that, then it’s not really a one-liner and even more so if you are unlikely to remember it.

Fixed: Remove extra ip address from commandline.

Occasionally you may have a need to remove an additional ip address that has been assigned to a network card. For example you might have a card listening on two ip address’s – say 192.168.1.2 and 192.168.1.3
You can remove this from the gui but there may be reasons where the gui is not available but access to the server via psexec (or the Windows 2008R2 core mode) is the only access to the server that you have.
To remove the ip address just type in
netsh interface ipv4 delete address “Local Area Connection” addr=192.168.1.3

Simple as that but it took a while stepping through the netsh commands to get the correct syntax for this. I use netsh for switching my laptop to customer ip ranges for troubleshooting when on their lan or when configuring switches, but this is the first time I’ve had the requirement to remove an extra ip address.

Fixed – unable to connect to vpn with Verizon wireless cards

After about 3 weeks and many calls with Verizon technical support we finally got to the bottom of being unable to connect via a VPN on USB Verizon wireless cards (an older PCMCIA card was still working fine).

It turns out that the IP Code was set to general – which is normally placed on residential air cards to restrict ip traffic. The tech removed this “feature” and we confirmed vpn worked again.

So, if you are having this problem, contact Verizon Technical support and ask them to remove General IP code from the phone. If the Tier1 support person doesn’t know what you are talking about, request they instant message level 3 support who will know what you are talking about.

Good luck and I hope this prevents 3 weeks of VPN failure for other people.

Thanks to Eric for persevering and finally getting an answer

Preparing Network Connections message at startup of SBS – solved.

Today of all days we’ve had two clients that have had their server reboot for a couple of valid reasons but after reboot the server just sat at “preparing network connections” screen and would not continue. We’re not sure right now what caused this issue but the solution was to reboot the server, press F8 and choose the Last Known Good to be able to get into the server.

Today has not been a good day for this to happen as some clients have been closed so they’ve not been around to let us in to look at the server on site but at the same time we don’t really want to wait until Monday to get access to the server, yet this is a holiday weekend.

For me, it’s been a long week . I’ve started work at 4am twice this week and was working at 1am until 2.30am last night so I doubt I’ll be staying up for NewYear – but I think I can make it until 7pm when I’ll be able to watch BigBen strike midnight.

Happy New Year everyone and I hope 2010 starts off better than 2009 finished!