{"id":621,"date":"2015-10-18T14:37:00","date_gmt":"2015-10-18T06:37:00","guid":{"rendered":"http:\/\/note.systw.net\/note\/?p=621"},"modified":"2023-11-04T14:48:50","modified_gmt":"2023-11-04T06:48:50","slug":"win-network-command","status":"publish","type":"post","link":"https:\/\/systw.net\/note\/archives\/621","title":{"rendered":"Win Network Command"},"content":{"rendered":"\n<p><strong>ipconfig<\/strong><\/p>\n\n\n\n<p>\u5217\u51fa\u6240\u6709\u7db2\u5361\u4e0a\u7684\u8cc7\u8a0a,\u5305\u62ecIP\u548cMAC<br>ipconfig \/all<\/p>\n\n\n\n<p>ps:<br>ipconfig Options:<br>\u3000\/? Display this help message<br>\u3000\/all Display full configuration information.<br>\u3000\/release Release the IPv4 address for the specified adapter.<br>\u3000\/release6 Release the IPv6 address for the specified adapter.<br>\u3000\/renew Renew the IPv4 address for the specified adapter.<br>\u3000\/renew6 Renew the IPv6 address for the specified adapter.<br>\u3000\/flushdns Purges the DNS Resolver cache.<br>\u3000\/registerdns Refreshes all DHCP leases and re-registers DNS names<br>\u3000\/displaydns Display the contents of the DNS Resolver Cache.<br>\u3000\/showclassid Displays all the dhcp class IDs allowed for adapter.<br>\u3000setclassid Modifies the dhcp class id.<br>\u3000\/showclassid6 Displays all the IPv6 DHCP class IDs allowed for adapter.<br>\u3000\/setclassid6 Modifies the IPv6 DHCP class id.<\/p>\n\n\n\n<p><br>&#8230;<br><strong>netsh<\/strong><\/p>\n\n\n\n<p>\u8a2d\u5b9a\u975c\u614bip,mask,gateway<br>netsh interface ip set address &lt; LANstring&gt;&nbsp;static &lt; static IP&gt; &lt; net mask&gt; &lt; gateway&gt;&nbsp;1<br>ex:<br>netsh interface ip set address &#8220;\u5340\u57df\u9023\u7dda&#8221; static 61.11.22.33 255.255.255.0 61.11.22.254 1<\/p>\n\n\n\n<p>\u8a2d\u5b9a\u52d5\u614bip<br>netsh interface ip set address &lt; LANstring&gt;&nbsp;dhcp<br>ex:<br>netsh interface ip set address &#8220;\u5340\u57df\u9023\u7dda&#8221; dhcp<br>ipconfig \/release<br>ipconfig \/renew<\/p>\n\n\n\n<p>\u8a2d\u5b9adns<br>netsh interface ip set dns &lt; LANstring&gt;&nbsp;static &lt; static IP&gt;&nbsp;primary<\/p>\n\n\n\n<p>\u65b0\u589e\u6b21\u8981dns<br>netsh interface ip add dns &lt; LANstring&gt; &lt; static IP&gt;<\/p>\n\n\n\n<p>&#8230;<\/p>\n\n\n\n<p><strong>netstat<\/strong><br>a tool for collecting Information regarding network connections<br>It provides a simple view of TCP and UDP connections, and their state and network traffic statistics.<\/p>\n\n\n\n<p>ps<br>netstat used port tcp\/udp 15<br>refer<br>http:\/\/www.speedguide.net\/port.php?port=15<\/p>\n\n\n\n<p><strong>netstat -ano<\/strong><br>display the tcp and udp network ,listening ports,PID<br>information as below<br>Active Connections<br>Proto Local Address Foreign Address State PID<br>TCP 0.0.0.0:135 0.0.0.0:0 LISTENING 340<br>TCP 127.0.0.1:49668 0.0.0.0:0 LISTENING 7424<br>TCP 127.0.0.1:52739 127.0.0.1:52740 ESTABLISHED 3452<br>TCP 127.0.0.1:52740 127.0.0.1:52739 ESTABLISHED 3452<br>TCP 192.168.100.133:139 0.0.0.0:0 LISTENING 4<br>TCP 192.168.100.133:53786 111.221.29.253:443 TIME_WAIT 0<br>TCP 192.168.100.133:53795 74.125.34.46:443 ESTABLISHED 4588<br>TCP 192.168.119.1:139 0.0.0.0:0 LISTENING 4<br>TCP 192.168.157.1:139 0.0.0.0:0 LISTENING 4<br>TCP [::]:135 [::]:0 LISTENING 340<br>TCP [::1]:49663 [::]:0 LISTENING 8076<br>UDP 0.0.0.0:500 *:* 848<br>UDP 0.0.0.0:63139 *:* 1080<br>UDP 127.0.0.1:1900 *:* 1120<br>UDP 127.0.0.1:53451 *:* 1120<br>UDP 192.168.100.133:137 *:* 4<br>UDP 192.168.157.1:53448 *:* 1120<br>UDP [::]:500 *:* 848<br>UDP [::1]:53447 *:* 1120<\/p>\n\n\n\n<p><strong>netstat -b<\/strong><br>display binary<br>information as below<br>Active Connections<br>Proto Local Address Foreign Address State<br>TCP 127.0.0.1:52739 raymond:52740 ESTABLISHED<br>[vmware-hostd.exe]<br>TCP 192.168.100.133:53342 104.244.42.200:https ESTABLISHED<br>[chrome.exe]<br>&#8230;omit&#8230;<\/p>\n\n\n\n<p><strong>netstat -r<\/strong><br>information as below<br>==============================================&nbsp;<br>Interface List<br>12&#8230;00 0c 29 e9 91 21 &#8230;&#8230;Realtek PCIe GBE Family Controller<br>9&#8230;52 10 b3 0a 35 ad &#8230;&#8230;Microsoft Hosted Network Virtual Adapter<br>&#8230;omit&#8230;<br>==============================================&nbsp;<br>&nbsp;<br>IPv4 Route Table<br>==============================================&nbsp;<br>Active Routes:<br>Network Destination Netmask Gateway Interface Metric<br>0.0.0.0 0.0.0.0 192.168.100.1 192.168.100.133 25<br>127.0.0.0 255.0.0.0 On-link 127.0.0.1 306<br>127.0.0.1 255.255.255.255 On-link 127.0.0.1 306<br>127.255.255.255 255.255.255.255 On-link 127.0.0.1 306<br>&#8230;omit&#8230;<br>==============================================&nbsp;<br>Persistent Routes:<br>None<br>&nbsp;<br>IPv6 Route Table<br>==============================================&nbsp;<br>Active Routes:<br>If Metric Network Destination Gateway<br>18 306 ::\/0 On-link<br>1 306 ::1\/128 On-link<br>&#8230;omit&#8230;<br>==============================================&nbsp;<br>Persistent Routes:<br>None<\/p>\n\n\n\n<p><strong>netstat -s<\/strong><br>information as below<br>IPv4 Statistics<br>Packets Received = 1648870<br>&#8230;omit&#8230;<br>IPv6 Statistics<br>Packets Received = 3654<br>&#8230;omit&#8230;<br>ICMPv4 Statistics<br>Received Sent<br>Messages 1252 319<br>&#8230;omit&#8230;<br>ICMPv6 Statistics<br>Received Sent<br>Messages 772 48<br>&#8230;omit&#8230;<br>TCP Statistics for IPv4<br>Active Opens = 4150<br>&#8230;omit&#8230;<br>TCP Statistics for IPv6<br>Active Opens = 19<br>&#8230;omit&#8230;<br>UDP Statistics for IPv4<br>Datagrams Received = 86359<br>&#8230;omit&#8230;<br>UDP Statistics for IPv6<br>Datagrams Received = 2021<br>&#8230;omit&#8230;<\/p>\n\n\n\n<p><br><strong>netstat -anob<\/strong><br>display binary<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ipconfig \u5217\u51fa\u6240\u6709\u7db2\u5361\u4e0a\u7684\u8cc7\u8a0a,\u5305\u62ecIP\u548cMACip &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"","fifu_image_alt":"","_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[18],"tags":[],"class_list":["post-621","post","type-post","status-publish","format-standard","hentry","category-windows"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts\/621","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/comments?post=621"}],"version-history":[{"count":0,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts\/621\/revisions"}],"wp:attachment":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/media?parent=621"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/categories?post=621"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/tags?post=621"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}