# Statische IP
netsh interface ip set address name="LAN-Verbindung" static 192.168.1.100 255.255.255.0 192.168.1.1
# DHCP IP
netsh interface ip set address name="LAN-Verbindung" source=dhcp
# DNS Server anzeigen
netsh interface ip show dnsservers
# DNS Server (ip set)
netsh interface ip set dns name="LAN-Verbindung" static 8.8.8.8
# Zusätzlicher DNS Server (ipv4 add)
netsh interface ipv4 add dnsservers name="Ethernet 6" address=1.1.1.1 index=2
# Search Domain setzen/anzeigen (Powershell)
PS C:\Users\admin> Set-DnsClientGlobalSetting -SuffixSearchList @("d2000.local")
PS C:\Users\admin> Get-DnsClientGlobalSetting
UseSuffixSearchList : True
SuffixSearchList : {d2000.local}
UseDevolution : True
DevolutionLevel : 0
PS C:\Users\admin>
# Interfaces anzeigen netsh interface ipv4 show interfaces # Route hinzufügen netsh interface ipv4 add route 10.10.10.10/32 "Ethernet 6" 10.0.0.1 store=persistent # Route entfernen route delete 10.10.10.10
Routing über Interface Index (print route)
C:\Users\admin_zarat>route add 1.2.3.4 mask 255.255.255.255 1.2.3.1 IF 14 OK! C:\Users\admin_zarat>tracert 1.2.3.4 1 1 ms 1 ms 3 ms 10.85.185.109 C:\Users\admin_zarat>route delete 1.2.3.4 OK! C:\Users\admin_zarat>route add 1.2.3.4 mask 255.255.255.255 1.2.3.1 IF 22 OK! C:\Users\admin_zarat>tracert 1.2.3.4 1 18 ms 22 ms 29 ms VIE-NB-GBI16.d2000.local [10.242.5.10]
netsh trace start capture=yes IPv4.Address=X.X.X.X Ablaufverfolgungskonfiguration: ------------------------------------------------------------------- Status: Wird ausgefhrt Ablaufverfolgungsdatei: C:\Users\ADMIN_~4\AppData\Local\Temp\NetTraces\NetTrace.etl Anfgen: Aus Kreisf”rmig: Ein Maximale Gr”áe: 512 MB Bericht: Aus netsh trace stop Ablaufverfolgungen werden zusammengefhrt... fertig Die Datensammlung wird generiert... fertig Die Ablaufverfolgungsdatei und zus„tzliche Problembehandlungsinformationen wurden als "C:\Users\ADMIN_~4\AppData\Local\Temp\NetTraces\NetTrace.cab " kompiliert. Dateispeicherort = C:\Users\ADMIN_~4\AppData\Local\Temp\NetTraces\NetTrace.etl Die Ablaufverfolgungssitzung wurde erfolgreich beendet. etl2pcapng.exe PktMon.etl -o P=ktMon.pcapng
// reset advfirewall netsh advfirewall reset // show all profiles netsh advfirewall show allprofiles //activate/deactivate a profile netsh advfirewall set <currentprofile|privateprofile|domainprofile> state <on|off> // add a rule for a specific program netsh advfirewall firewall add rule name="My Application" dir=in action=allow program="C:\MyApp.exe" enable=yes [remoteip=<157.60.0.1|172.16.0.0/16|LocalSubnet|157.60.0.1,172.16.0.0/16,LocalSubnet>] [profile=domain|private|public>] // add a rule for specific protocol or port netsh advfirewall firewall add rule name="My Rule" protocol=<TCP|UDP|ICMP|...> dir=<in|out> localport=<500> action=<allow|block> // list all rules netsh advfirewall firewall show rule status=enabled name=all // change rule netsh advfirewall firewall set rule name="My Rule" new <param>=<value> // change parameters // delete rule netsh advfirewall firewall delete rule name="My Rule" // delete rule // set logging netsh advfirewall set currentprofile logging filename <PATH>
https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/dd734783(v=ws.10), https://www.simplified.guide/microsoft-windows/firewall-command
Wenn mehrere Adapter vorhanden sind, alle bis auf den gewünschten während des Start deaktivieren.
netsh wlan set hostednetwork mode=allow ssid=MyNetwork key=MySecret netsh wlan [start/stop] hostednetwork // troubleshoot netsh wlan show profiles netsh wlan show wlanreport