Windows Networking
Windows Networking
Network Issues TroubleShooting :-
ipconfig /release
ipconfig /renew
arp -d *
nbtstat -R
nbtstat -RR
ipconfig /flushdns
ipconfig /registerdns
1. ping
Purpose:
Tests connectivity between your system and a remote device by sending ICMP Echo Request packets.
Usage:
ping [IP address or hostname]
Example:
ping google.com
ping 192.168.1.1
When to Use:
- To check if a device is reachable over the network.
- To measure response time (latency).
- Diagnose basic network connectivity issues.
2. ipconfig (Windows) / ifconfig (Linux/macOS)
Purpose:
Displays and manages the IP configuration of your system.
Usage:
ipconfig
ipconfig /all
ipconfig /release
ipconfig /renew
Example:
ipconfig /all
When to Use:
- To view your system’s IP address, subnet mask, and default gateway.
- Use /release and /renew to reset your IP configuration if you suspect IP conflicts or network issues.
3. tracert (Windows) / traceroute (Linux/macOS)
Purpose:
Traces the route packets take to reach a destination and identifies delays at specific network hops.
Usage:
tracert [IP address or hostname]
Example:
tracert google.com
When to Use:
- To diagnose where packets are being delayed or dropped along the route.
- To identify network bottlenecks or unreachable hops.
4. nslookup
Purpose:
Queries DNS servers to resolve domain names to IP addresses and vice versa.
Usage:
nslookup [domain name or IP address]
Example:
nslookup google.com
When to Use:
- To verify if DNS resolution is working correctly.
- Troubleshoot issues with accessing websites or services by name.
5. netstat
Purpose:
Displays active connections, listening ports, and network statistics.
Usage:
netstat
netstat -a
netstat -n
netstat -b
netstat -an
Example:
netstat -an
When to Use:
- To check all active network connections and their states.
- Diagnose issues with specific ports or identify open/listening ports.
- Spot unauthorized connections or network intrusions.
6. arp
Purpose:
Displays and manages the ARP (Address Resolution Protocol) cache, which maps IP addresses to MAC addresses.
Usage:
arp -a
arp -d [IP address]
arp -s [IP address] [MAC address]
Example:
arp -a
When to Use:
- To resolve IP-to-MAC address mapping issues.
- Troubleshoot duplicate IP addresses or misconfigured devices.
7. pathping (Windows)
Purpose:
Combines ping and tracert to analyze network paths and measure packet loss at each hop.
Usage:
pathping [IP address or hostname]
Example:
pathping google.com
When to Use:
- To determine packet loss and latency at various points along a route.
- Troubleshoot intermittent network performance issues.
8. telnet
Purpose:
Tests connectivity to a specific port on a remote system.
Usage:
telnet [hostname or IP] [port]
Example:
telnet google.com 80
When to Use:
- To check if a specific port on a remote server is open and accessible.
- Useful for diagnosing services like web servers, databases, or email servers.
9. netsh (Windows)
Purpose:
A versatile command for managing network configurations, including firewall, IP settings, and wireless networks.
Usage:
netsh interface ip show config
netsh wlan show profiles
netsh wlan disconnect
Example:
netsh wlan show profiles
When to Use:
- To manage or reset network configurations.
- Troubleshoot issues with wireless networks or IP settings.
10. route
Purpose:
Displays or modifies the IP routing table.
Usage:
route print
route add [destination] [mask] [gateway]
route delete [destination]
Example:
route print
When to Use:
- To view or change the route a packet takes to reach its destination.
- Resolve routing issues or test static routes.
11. systeminfo
Purpose:
Provides detailed information about the system, including network configuration, uptime, and installed updates.
Usage:
systeminfo
Example:
systeminfo
When to Use:
- To get an overview of the system’s configuration and network-related information for troubleshooting.
12. netsh winsock reset
Purpose:
Resets the Winsock catalog to default settings to resolve network socket-related issues.
Usage:
netsh winsock reset
When to Use:
- When experiencing issues like "Limited or No Connectivity" or "DNS errors."
- Useful after malware removal or misconfigured software affecting network connections.
13. getmac
Purpose:
Displays the MAC addresses of network interfaces.
Usage:
getmac
Example:
getmac
When to Use:
- To verify MAC address for troubleshooting or network setup.
- Helps in resolving device identity issues on the network.
14. ftp
Purpose:
Tests FTP server connectivity or uploads/downloads files via the command line.
Usage:
ftp [hostname or IP address]
Example:
ftp 192.168.1.10
When to Use:
- To troubleshoot FTP server connection or data transfer issues.
15. powershell Network Commands
Purpose:
PowerShell provides advanced networking commands for detailed diagnostics.
Usage:
powershell
Test-NetConnection -ComputerName [hostname or IP]
Get-NetIPAddress
Example:
powershell
Test-NetConnection google.com -Port 80
When to Use:
- Advanced network diagnostics.
- Test specific ports and connectivity.
Opening and Closing Network Firewall Port through Command Prompt (CMD) :-
OPEN: --
NETSH ADVFIREWALL FIREWALL ADD RULE NAME="RULE NAME" DIR=IN ACTION=ALLOW PROTOCOL=TCP OR UDP LOCALPORT=PORT NUMBER
DELETE:--
NETSH ADVFIREWALL FIREWALL DELETE RULE NAME="RULE NAME" PROTOCAL=TCP OR UDP LOCALPORT=PORT NUMBERReset Wifi Connection :-
To reset all Wi-Fi connections on a Windows PC, you can use the netsh command to remove all saved Wi-Fi networks. Here's how:
Command to Reset Wi-Fi Connections
Open Command Prompt or Windows PowerShell as an administrator:
- Press
Windows + Xand select Command Prompt (Admin) or Windows Terminal (Admin).
- Press
Run the following command to delete all saved Wi-Fi profiles:
This removes all saved Wi-Fi networks from your system.
Additional Steps (if needed):
If you want to reset the network completely (including Wi-Fi adapters and other settings), use the following command:
Reset all network configurations:
Flush the DNS cache (optional):
Restart your computer to apply the changes.
What Happens?
- All saved Wi-Fi networks will be erased.
- You will need to reconnect to Wi-Fi networks by entering their passwords again.
Adding VPN Route Configuration for a Specific Subnet :-
Overview
When working with a VPN setup, there might be cases where specific subnets are not accessible through the VPN by default. In such situations, you can add custom routes to ensure proper connectivity. This guide explains how to add a VPN route to a subnet using PowerShell and troubleshoot related connectivity issues.
Scenario
You are using a VPN connection named VPN India Azure and need to access a remote subnet, 192.168.37.0/24. After configuring the subnet, you find that it is not reachable. This can be resolved by adding a route to your VPN configuration.
Steps to Add a VPN Route
1. Run the PowerShell Command
To add the route, open PowerShell with administrator privileges and run the following command:
Add-VpnConnectionRoute -ConnectionName "VPN India Azure" -DestinationPrefix 192.168.37.0/24 -PassThru
Command Breakdown:
Add-VpnConnectionRoute: Adds a route to the VPN configuration.
ConnectionName: The name of the VPN connection (in this case,
VPN India Azure).DestinationPrefix: Specifies the subnet to route (e.g.,
192.168.37.0/24).-PassThru: Outputs the result of the command.
2. Expected Output
After running the command, you should see an output like this:
DestinationPrefix : 192.168.37.0/24 InterfaceIndex : InterfaceAlias : VPN India Azure AddressFamily : IPv4 NextHop : 0.0.0.0 Publish : 0 RouteMetric : 1 PolicyStore :This confirms that the route has been added successfully.
3. Reconnect the VPN
To apply the changes, disconnect from the VPN and reconnect:
Open your VPN application or settings.
Disconnect and reconnect to
VPN India Azure.
4. Verify the Route
To confirm that the route has been added, run:
Get-VpnConnectionRoute -ConnectionName "VPN India Azure"You should see the subnet (
192.168.37.0/24) listed under the VPN routes.5. Test Connectivity
Once the VPN is reconnected:
Open Command Prompt and ping a device in the subnet:
Open Command Prompt and ping a device in the subnet:
ping 192.168.37.<specific IP>If the ping is successful, the route is working correctly.
6. Access Remote Desktop
Try connecting to remote systems in the
192.168.37.xsubnet. If successful, the VPN route is correctly configured.Troubleshooting Tips :-
If you still cannot connect to the subnet:
Verify VPN Server Configuration: Ensure the
192.168.37.0/24subnet is configured on the VPN server.Check Firewall Settings:
Ensure there are no local or remote firewall rules blocking the connection.
Allow RDP or other required ports for the subnet.
Re-run the Route Command: Ensure the PowerShell command was entered correctly.
Network Routing Configuration: Verify routing settings on your local network and VPN server.
Contact IT Support: If the issue persists, consult your IT manager or network administrator.
Key Benefits of Adding VPN Routes
Ensures seamless connectivity to additional subnets through a VPN.
Simplifies access to remote resources without reconfiguring the VPN server.
Provides flexibility for dynamic network setups.
Summary
Adding a custom route to a VPN connection is a straightforward process using PowerShell. By following this guide, you can resolve subnet connectivity issues and ensure uninterrupted remote access. Save this guide for future reference to streamline your troubleshooting efforts.
ACCESS POINT :-
Part 1: Check Which Access Point You’re Connected ToEven though all your access points use the same SSID, they have different BSSIDs (MAC addresses). Here’s how you can find the exact AP your laptop is connected to:
✅ On Windows:
Open Command Prompt and run:
Look for:
-
SSID – The Wi-Fi name (same across APs)
-
BSSID – This is the MAC address of the current AP your laptop is connected to.
-
Signal – Shows the strength (helps guess proximity)
-
Radio type and channel – Useful to know if you’re on 2.4GHz or 5GHz band
You can compare the BSSID with your access points' MAC addresses (if you have access to them) to identify which AP it is.
๐ถ♂️ Part 2: Moving Around & Seamless Roaming
Now, regarding Wi-Fi roaming:
๐ค Why doesn't it disconnect when switching APs?
-
Devices don’t necessarily disconnect and reconnect when roaming.
-
Instead, Wi-Fi roaming is managed by your laptop’s wireless adapter.
-
When signal strength drops below a threshold, your device automatically hands off to another AP with stronger signal — without interrupting the connection.
This handover is seamless in most cases, especially in enterprise-grade setups, and it may take just milliseconds.
๐ Key Things That Enable Smooth Roaming:
-
Same SSID across all access points
-
Fast Roaming Support (802.11r/k/v) – Advanced features for seamless roaming
-
Same Security Settings (WPA2/WPA3, etc.)
-
AP Controller – If you have managed APs (like from Cisco, Aruba, UniFi, etc.), the controller coordinates roaming
๐งช Bonus Tip – Live Monitor Roaming
If you want to see roaming live:
-
Run
netsh wlan show interfacesin a loop with PowerShell: -
Walk around the office and watch the BSSID field — you’ll see it change when roaming to another AP.
Comments
Post a Comment