{"id":2116,"date":"2015-06-25T15:17:28","date_gmt":"2015-06-25T15:17:28","guid":{"rendered":"https:\/\/raspberry-projects.com\/pi\/?p=2116"},"modified":"2020-10-08T08:23:14","modified_gmt":"2020-10-08T08:23:14","slug":"networking-commands","status":"publish","type":"post","link":"https:\/\/raspberry-projects.com\/pi\/pi-operating-systems\/raspbian\/network-settings\/networking-commands","title":{"rendered":"Networking Commands"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">List Network Adaptors<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>ifconfig<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Is Network Interface Connected<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>cat \/sys\/class\/net\/wlan0\/operstate<\/code><\/pre>\n\n\n\n<p>Indicates the interface operational state, possible values are: &#8220;unknown&#8221;, &#8220;notpresent&#8221;, &#8220;down&#8221;, &#8220;lowerlayerdown&#8221;, &#8220;testing&#8221;,&#8221;dormant&#8221;, &#8220;up&#8221;.&#8221;no such file or directory&#8221;<\/p>\n\n\n\n<p>You can test for &#8220;up&#8221;.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat \/sys\/class\/net\/wlan0\/carrier<\/code><\/pre>\n\n\n\n<p>Will give a result of 0, 1 or a &#8216;no such file or directory&#8217; error message.<\/p>\n\n\n\n<p><em>NOTE &#8211; we have seen this commant return a &#8216;1&#8217; when the WiFi adaptor is not actually connected (&#8216;ip addr&#8217; returns &#8220;wlan0: &lt;NO-CARRIER,&#8230;&#8221;. In this instance&nbsp;cat \/sys\/class\/net\/wlan0\/operstate&nbsp;returned &#8220;dormant&#8221;<\/em><\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Other commands<\/h5>\n\n\n\n<p>See&nbsp;<a href=\"https:\/\/www.kernel.org\/doc\/Documentation\/ABI\/testing\/sysfs-class-net\">https:\/\/www.kernel.org\/doc\/Documentation\/ABI\/testing\/sysfs-class-net<\/a><code> <\/code><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Restarting After Changes<\/h4>\n\n\n\n<p>See <a href=\"\/pi\/pi-operating-systems\/raspbian\/network-settings\/reset-network-interface\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>List Network Adaptors Is Network Interface Connected Indicates the interface operational state, possible values are: &#8220;unknown&#8221;, &#8220;notpresent&#8221;, &#8220;down&#8221;, &#8220;lowerlayerdown&#8221;, &#8220;testing&#8221;,&#8221;dormant&#8221;, &#8220;up&#8221;.&#8221;no such file or directory&#8221; You can test for &#8220;up&#8221;. Will give a result of 0, 1 or a &#8216;no such file or directory&#8217; error message. NOTE &#8211; we have seen this commant return a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38],"tags":[],"class_list":["post-2116","post","type-post","status-publish","format-standard","hentry","category-network-settings"],"_links":{"self":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/2116","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/comments?post=2116"}],"version-history":[{"count":9,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/2116\/revisions"}],"predecessor-version":[{"id":3453,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/2116\/revisions\/3453"}],"wp:attachment":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/media?parent=2116"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/categories?post=2116"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/tags?post=2116"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}