Tested on Ubuntu 16.04 Mate armhf installed on RPi 3. nmcli tool, version 1.2.2
- Show available wifi:
$ nmcli dev wifi
* SSID MODE CHAN RATE SIGNAL BARS SECURITY
* myconnection Infra 6 54 Mbit/s 91 ▂▄▆█ WPA2
- Connect to a wifi (and create a new network connection)
$ sudo nmcli dev wifi con "myconnection" password "mypassword" name "myconnection"
- Setup manual static IP and automatic connection :
$ sudo nmcli con edit "myconnection"
===| nmcli interactive connection editor |===
...
nmcli> set ipv4.method manual
nmcli> set ipv4.addr 192.168.43.5/24, 192.168.43.7/24, 192.168.43.55/24
nmcli> set ipv4.gateway 192.168.43.1
nmcli> set ipv4.dns 8.8.8.8, 8.8.4.4
nmcli> set connection.autoconnect yes
nmcli> save persistent
nmcli> quit
$ sudo service network-manager restart
$ ifconfig
As I understand there are at least two possibilities to achieve to our goal:
- with
/etc/network/interfaces
and a related servicenetworking
- with
Network-Manager
and usingnmcli
[2] [3]
Above the second method is described. If you want to proceed with /etc/network/interfaces
then read [1] and google. And if you have an access to a monitor, than see [4].
References:
[1] Network Configuration in CommandLine
[2] Configure using NetworkManager
[3] NMCLI manual