windows_networking

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
windows_networking [2022/04/12 12:21] – created mguptonwindows_networking [2023/10/09 22:47] (current) mgupton
Line 2: Line 2:
  
 ====== Handy Commands ====== ====== Handy Commands ======
 +
 +===== List Listening Ports  =====
 +<code powershell>
 +Get-NetTCPConnection -state listen | Select-Object -Property *,@{'Name' = 'ProcessName';'Expression'={(Get-Process -Id $_.OwningProcess).Name}} | select-object OwningProcess,ProcessName,LocalPort
 +</code>
 +
 +
 +=====Get host IP addresses=====
 Example of getting all IPv4 IP Addresses with Powershell Example of getting all IPv4 IP Addresses with Powershell
 <code powershell> <code powershell>
 Get-NetIPAddress -AddressFamily ipv4 | foreach {$_.IPAddress} Get-NetIPAddress -AddressFamily ipv4 | foreach {$_.IPAddress}
 +</code>
 +
 +<code>
 +ipconfig /all | findstr /i ipv4
 +</code>
 +
 +<code>
 +ipconfig /all | sls ipv4
 +</code>
 +
 +===Get public IP===
 +<code powershell>
 +(curl ifconfig.me).Content
 +</code>
 +
 +=== Reset Network Stack ===
 +<code>
 +netsh winsock reset
 +netsh int IP reset
 +ipconfig /flushdns
 </code> </code>
  
  • windows_networking.1649766104.txt.gz
  • Last modified: 2022/04/12 12:21
  • by mgupton