Networkinterface: Difference between revisions

From Piszczynski
piszczynski>Aleks
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Shortcuts ==
command to get to network adapters control panel in windows:<syntaxhighlight lang="powershell">
ncpa.cpl
</syntaxhighlight>


== Network Interface Issues NIC ==
== Network Interface Issues NIC ==
Line 10: Line 14:


If the issue is with NIC teaming this can be removed for all adapters with the command: "LbfoAdmin /Resetconfig"
If the issue is with NIC teaming this can be removed for all adapters with the command: "LbfoAdmin /Resetconfig"
== Enable Ping using default network rule: ==
Enable the rule with powershell:<syntaxhighlight lang="powershell">
Set-NetFirewallRule -DisplayName "Core Networking Diagnostics - ICMP Echo Request (ICMPv4-In)" -Enabled True
</syntaxhighlight>


== Enable Ping / ICMP using netsh ==
== Enable Ping / ICMP using netsh ==
Line 15: Line 24:
Use the following commands to set rule on windows firewall to allow ping on server
Use the following commands to set rule on windows firewall to allow ping on server


IPv4
IPv4<syntaxhighlight lang="powershell">
*netsh advfirewall firewall add rule name="ICMP Allow incoming V4 echo request" protocol="icmpv4:8,any" dir=in action=allow
netsh advfirewall firewall add rule name="ICMP Allow incoming V4 echo request" protocol="icmpv4:8,any" dir=in action=allow
 
</syntaxhighlight>IPv6<syntaxhighlight lang="powershell">
IPv6
netsh advfirewall firewall add rule name="ICMP Allow incoming V6 echo request" protocol="icmpv6:8,any" dir=in action=allow
*netsh advfirewall firewall add rule name="ICMP Allow incoming V6 echo request" protocol="icmpv6:8,any" dir=in action=allow
</syntaxhighlight>
 


== Network info ==
== Network info ==
Line 34: Line 42:
Get services that are bound to ports:
Get services that are bound to ports:
*netstat -ano
*netstat -ano
== Interface configuration ==
Issues with default gateway? remove unwanted routes on network interface.
Find the routes:<syntaxhighlight lang="powershell">
Get-NetRoute -AddressFamily ipv4
</syntaxhighlight>remove the routes with a destination prefix of 0.0.0.0 and next hop of 0.0.0.0<syntaxhighlight lang="powershell">
Remove-NetRoute -InterfaceIndex <ifindex eg 15> -DestinationPrefix "0.0.0.0/0" -NextHop "0.0.0.0" -PolicyStore Persistantstore
</syntaxhighlight>Remove routes to persist:<syntaxhighlight lang="powershell">
netsh interface ipv4 delete route prefix=0.0.0.0/0 interface=Ethernet0
also:
route -p delete 0.0.0.0
</syntaxhighlight>

Latest revision as of 09:59, 1 July 2024

Shortcuts

command to get to network adapters control panel in windows:

ncpa.cpl

Network Interface Issues NIC

Check DHCP settings + assigned IP address Check Cables

Check for incorrectly uninstalled network adapters in device manager > show hidden devices then uninstall

Reset the TCP/IP stack with the following command: "netsh int IP reset" (will clear all network configuration)

If the issue is with NIC teaming this can be removed for all adapters with the command: "LbfoAdmin /Resetconfig"

Enable Ping using default network rule:

Enable the rule with powershell:

Set-NetFirewallRule -DisplayName "Core Networking Diagnostics - ICMP Echo Request (ICMPv4-In)" -Enabled True

Enable Ping / ICMP using netsh

Use the following commands to set rule on windows firewall to allow ping on server

IPv4

netsh advfirewall firewall add rule name="ICMP Allow incoming V4 echo request" protocol="icmpv4:8,any" dir=in action=allow

IPv6

netsh advfirewall firewall add rule name="ICMP Allow incoming V6 echo request" protocol="icmpv6:8,any" dir=in action=allow

Network info

Get password for wifi network from netsh:

Get saved networks:

  • netsh wlan show profile

Get details for network with password in clear text:

  • netsh wlan show profile <wifi network name> key=clear

Get services that are bound to ports:

  • netstat -ano

Interface configuration

Issues with default gateway? remove unwanted routes on network interface.

Find the routes:

Get-NetRoute -AddressFamily ipv4

remove the routes with a destination prefix of 0.0.0.0 and next hop of 0.0.0.0

Remove-NetRoute -InterfaceIndex <ifindex eg 15> -DestinationPrefix "0.0.0.0/0" -NextHop "0.0.0.0" -PolicyStore Persistantstore

Remove routes to persist:

netsh interface ipv4 delete route prefix=0.0.0.0/0 interface=Ethernet0

also:

route -p delete 0.0.0.0