The netsh
(Network
Shell) command is a command-line utility in Windows that allows you to
configure and manage various network-related settings on a local or remote
computer. Below are some common examples of netsh
commands:
1. Display IP Configuration
To view the current IP configuration:
netsh
interface
ip
show
config
2. Set Static IP Address
To assign a static IP address to a specific interface (replace Local Area Connection
and 192.168.1.10
with your interface name
and desired IP):
netsh
interface ip
set address name=
"Local Area Connection"
static
192.168.
1.10
255.255.
255.0
192.168.
1.1
3. Set DNS Server
To configure the DNS server for a network interface (replace Local Area Connection
and 8.8.8.8
with your interface name and DNS
server):
netsh
interface ip
set dns name=
"Local Area Connection"
static
8.8.
8.8
4. Enable/Disable Network Interface
To disable a network interface:
netsh
interface
set
interface
"Ethernet" admin=disable
To enable it again:
netsh
interface
set
interface
"Ethernet" admin=enable
5. View Firewall Settings
To display the status of Windows Firewall:
netsh advfirewall
show allprofiles
6. Enable/Disable Windows Firewall
To disable the firewall for all profiles:
netsh advfirewall
set allprofiles state
off
To enable it again:
netsh advfirewall
set allprofiles state
on
7. Configure IP Routing
To enable IP routing:
netsh
interface ipv4
set
interface
"Local Area Connection" forwarding=enabled
To disable it:
netsh
interface ipv4
set
interface
"Local Area Connection" forwarding=disabled
8. Flush DNS Cache
To clear the DNS resolver cache:
netsh
int ip
reset
9. Set Proxy Settings
To configure a proxy server:
netsh winhttp set proxy proxy-server=
"http=proxy.example.com:8080" bypass-list=
"*.example.com"
10. View Wireless Networks
To display available wireless networks:
netsh wlan
show networks
11. Export/Import Network Settings
To export network configuration settings to a file:
netsh
interface
ipv4
export
filename="
C:
\networkconfig.txt"
To import configuration settings from a file:
netsh interface ipv4 import filename="C:\networkconfig.txt"
12. Reset TCP/IP Stack
To reset the TCP/IP stack:
netsh
int ip
reset
These are just a few examples of what netsh
can do. It is a powerful tool for network administration and configuration in
Windows systems.
0 Comments