Networking Commands Need to start a "Windows Command Prompt", i.e. DOS box: Windows-R | cmd Start | Windows Sytem | Command Prompt Rt. click Start | Command Prompt [(Admin)] Windows-X | Command Prompt [(Admin)] C:\Windows\System32\cmd.exe See my "CMD tips" web page. Mac: Terminal Linux: Terminal shell ---------------------------------------------------------------------- IPCONFIG Windows-only (displays info. the only configuration is lease renewal/release :( ipconfig /all ipconfig /renew renew IP address. (then do /all to see obtained time) ipconfig /release release IP address. disconnects from net. ipconfig /displaydns DNS resolver cache ipconfig /flushdns flush DNS resolver cache Linux: ifconfig ip addr ---------------------------------------------------------------------- PING sends an ICMP Echo Request to, and gets ICMP Echo Response from, a host Connectivity (bi-directional), latency (rountrip), make traffic. ping is the simplest communication. No data is exchanged. ping is the basic networking troubleshooting tool. You can use it to track down a problem by starting at the computer and moving progressively outward. ping ip_addr|hostname -t continually -n count send count pings -l bytesize dummy data amount. ping maxes at 400Kbps? -a reverse DNS lookup -4 force version 4 -w ms timeout in ms. any effect? Exs. ping localhost|loopback|127.0.0.1|::1|myIPaddress ping host_on_LAN ping default_gateway ping farsideDG ping distant_host_IP ping distant_host_DNS example.com Windows 8/10 Firewall allow incoming ping: Control Panel | Windows Firewall | Advanced settings | Inbound | New Rule | ... Rule Type: Custom | Protocols & Ports | Protocol Type: ICMPv4 | ... ICMP Settings Customize | Specific ICMP types Echo Request. | Next Next Next... Name it maybe "ping request" PATHPING similar to traceroute fping.exe of/from www.kwakkelflap.com does sub-ms times. ---------------------------------------------------------------------- ARP displays ARP table entries (of all NICs) -a -a -N myIPaddress Ignore the static entries. Try: apr -a to see current table, then ping one or more hosts of local LAN, then arp -a again to see the new (dynamic) entries. ping sweep to get IPs and MACs of all hosts. find MACs of hosts not responding to pings. -s adds permanent entries -d deletes entries GETMAC --display MAC address of NIC. even if TCP/IP not configured? ---------------------------------------------------------------------- NETSTAT established connections: protocol, local and remote ports and IPs. -n show IP addresses and port numbers instead of hostnames and services. -f show the FQDN (override column width limitation) -a and listening ports (ie. servers) too. -o PID of connection. -b program of connection. -e Ethernet stats -s protocols stats -p prot restrict to this protocol (i.e. TCP UDP ICMP IP, and v6s) -r display routing table (same as Route print) Exs. netstat show all connections netstat -n show all connections numerically netstat -f don't truncate the names to fit column width netstat -a show connections and listening servers netstat -aob w/PID and program netstat -ano show all connections and listeners numerically w/PID netstat -sp udp 2 show UDP stats every 2 seconds netstat -e 5 show Ethernet stats every 5 seconds netstat -sp icmp show ICMP stats Linux: -t for TCP ---------------------------------------------------------------------- TRACERT traceroute tracert ip_addr|hostname -d no name resolution: quicker Name, type (core or edge), location sometimes. Asymmetric paths maybe, and is blind to the return path. Router slow to handle ICMPs. Buffer bloat, up to 250ms delay. tcptraceroute to use TCP to bypass firewalls that block ICMP ---------------------------------------------------------------------- TELNET --remote login to telnet server --not installed in 7/8/10, so install it by: Start | Windows System | Control Panel | Programs and Features | Turn Windows features on or off | Telnet Client telnet IP_OR_DNS_NAME telnet IP_OR_DNS_NAME PORT can open TCP Connection on any port Mac and Linux also have nc: nc IP_OR_DNS_NAME 23 ---------------------------------------------------------------------- ROUTE route print display routing table on 192.168.1.10 Network Destination Netmask Gateway Interface Metric 0.0.0.0 0.0.0.0 192.168.1.1 192.168.1.10 20 192.168.1.0 255.255.255.0 192.168.1.10 192.168.1.10 20 Default Gateway: 192.168.1.1 route ADD 192.168.50.0 MASK 255.255.255.0 192.168.1.123 METRIC 3 Adds a route to the 192.168.200.0 network via router at 192.168.1.123 192.168.50.0 255.255.255.0 192.168.1.123 192.168.1.10 1 route ADD 10.0.0.0 MASK 255.255.255.0 192.168.200.1 METRIC 3 adds a route to the 10.0.0.0 net via router at 192.168.200.1: 10.0.0.0 255.255.255.0 192.168.200.1 192.168.200.103 38 ---------------------------------------------------------------------- NSLOOKUP --query DNS servers about domain or host. nslookup mydomain.com use primary DNS server nslookup www.mydomain.com nslookup mydomain.com 202.239.128.3 use other DNS server nslookup -q=mx yahoo.com nslookup yahoo.com 68.142.196.63 use authoritative DNS server of domain Public DNS servers: Google 8.8.8.8 8.8.4.4 Quad9 9.9.9.9 --my public IP address: nslookup myip.opendns.com resolver1.opendns.com dig ---------------------------------------------------------------------- NetBIOS, WINS etc: NBTSTAT nbtstat -n self NetBIOS names information nbtstat -a nbt_name other NetBIOS names information, MAC nbtstat -A ip_addr nbtstat -s sessions (shared folders viewing etc) NET net statistics workstation SMBs sent/received. uptime. net send * message_here send a popup message to all in ?workgroup echo %path% %prompt% %random%