I'm having trouble getting Network Manager Command Line Interface to set the IP address method to manual. Here is the command that I expect to work:
[me@computer]$ sudo nmcli connection modify 'Wired connection 1' ipv4.method manual ipv4.addresses 192.168.2.180/24 Error: failed to modify ipv4.method: 'manual ipv4.addresses 192.168.2.180/24' not among [auto, link-local, manual, shared, disabled].
Just specifying the ipv4.method command by itself doesn't work either.
[me@computer]$ sudo nmcli connection modify 'Wired connection 1' ipv4.method manual Error: Failed to modify connection 'Wired connection 1': (32) ipv4.addresses: property is missing
Setting it to auto works as I expected.
[sri@s6000-devel gui3]$ sudo nmcli connection modify 'Wired connection 1' ipv4.method auto
The expected final result is to set the BOOTPROTO parameter in the config script.
cat /etc/sysconfig/network-scripts/ifcfg-Wired_connection_1 TYPE=Ethernet BOOTPROTO=dhcp DEFROUTE=yes IPV4_FAILURE_FATAL=no IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_FAILURE_FATAL=no NAME="Wired connection 1" UUID=1d578ea5-7164-44b2-xxxx-xxxxxxxx ONBOOT=yes HWADDR=E0:3F:49:xx:xx:xx PEERDNS=yes PEERROUTES=yes IPV6_PEERDNS=yes IPV6_PEERROUTES=yes
Can anyone tell me what I'm doing wrong? How do I get nmcli to disable DHCP on boot and use a manual ip address instead?
Here is my OS:
[me@computer]$ uname -a Linux me.computer.com 3.18.5-101.fc20.x86_64 #1 SMP Mon Feb 2 20:58:23 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Here is the version of nmcli that is installed.
[sri@s6000-devel gui3]$ nmcli -v nmcli tool, version 0.9.9.0-46.git20131003.fc20
Trying the version of the command that chexum provided gives the following answer.
sudo nmcli conn modify "Wired connection 1" ipv4.addresses 192.168.2.180/24 ipv4.gateway 192.168.2.1 ipv4.method manual Error: failed to modify ipv4.addresses: '192.168.2.180/24 ipv4.gateway 192.168.2.1 ipv4.method manual' is not valid (use ip[/prefix] [gateway]).
I bet that the solution is to upgrade to the latest version. We shall see.