{"id":1778,"date":"2021-12-03T12:15:16","date_gmt":"2021-12-03T17:15:16","guid":{"rendered":"https:\/\/www.xavignu.com\/?p=1778"},"modified":"2021-12-03T12:15:16","modified_gmt":"2021-12-03T17:15:16","slug":"static-ip-with-networkmanager","status":"publish","type":"post","link":"https:\/\/www.xavignu.com\/?p=1778","title":{"rendered":"Static IP with NetworkManager"},"content":{"rendered":"\n<p>Couple of days ago I had to configure a static IP on the <a href=\"http:\/\/www.orangepi.org\/Orange%20Pi%20Lite%202\/\" target=\"_blank\" rel=\"noopener\">Orange PI<\/a> wifi interface. Had to use cli, since it is running as a server and there&#8217;s no need for a graphical interface. Below is the <a href=\"https:\/\/www.gnu.org\/software\/bash\/\" target=\"_blank\" rel=\"noopener\">bash<\/a> script I made:\n<pre>\n#!\/bin\/bash\n\nCONN=\"conn_name\" # Enter connection name\nSSID=\"myessid\" # Define WIFI SSID\nIP=\"192.168.1.15\/24\" # Enter IP, example \"192.168.0.100\/24\"\nGW=\"192.168.1.1\" # Enter gateway\nDNS=\"1.1.1.1,9.9.9.9\" # Define DNS servers\n\nnmcli dev wifi list\necho \"Adding wifi ${CONN} to SSID ${SSID}.\"\nnmcli connection add type wifi con-name ${CONN} ifname wlan0 ssid ${SSID}\necho \"Configuring ${CONN} IP, GW and DNS.\"\nnmcli connection modify ${CONN} ipv4.method manual ipv4.addresses ${IP} ipv4.gateway ${GW} ipv4.dns ${DNS}\necho \"Configuring wifi security.\"\nnmcli connection modify ${CONN} wifi-sec.key-mgmt wpa-psk\nread -s -p \"Enter wifi password: \" PASSWORD\nnmcli connection modify ${CONN} wifi-sec.psk  ${PASSWORD}\necho \"Bringing up connection ${CONN}.\"\nnmcli connection up ${CONN} \n\n<\/pre>\n<\/p>\n\n\n\n<p>Here are some resources I used: <\/p>\n\n\n\n<p><a href=\"https:\/\/wiki.debian.org\/WiFi\/HowToUse\" target=\"_blank\" rel=\"noopener\">Debian Wifi HowTo<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/wiki.debian.org\/NetworkManager\" target=\"_blank\" rel=\"noopener\">Debian NetworkManager<\/a> <\/p>\n\n\n\n<p><a href=\"https:\/\/docs.fedoraproject.org\/en-US\/quick-docs\/configuring-ip-networking-with-nmcli\/\" target=\"_blank\" rel=\"noopener\">networking with nmcli<\/a> <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Couple of days ago I had to configure a static IP on the Orange PI wifi interface. Had to use cli, since it is running as a server and there&#8217;s no need for a graphical interface. Below is the bash script I made: #!\/bin\/bash CONN=&#8221;conn_name&#8221; # Enter connection name SSID=&#8221;myessid&#8221; # Define WIFI SSID IP=&#8221;192.168.1.15\/24&#8243; [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[92],"tags":[56,22,6,116,23,47],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/pTQgt-sG","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/posts\/1778"}],"collection":[{"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1778"}],"version-history":[{"count":4,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/posts\/1778\/revisions"}],"predecessor-version":[{"id":1782,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/posts\/1778\/revisions\/1782"}],"wp:attachment":[{"href":"https:\/\/www.xavignu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1778"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1778"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1778"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}