1

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

EDIT

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.

1

The property is missing error suggests it needs more properties changed at once. There's also a section in the nmcli-examples(5) manual showing this message:

Do you also want to set 'ipv4.method' to 'manual'? [yes]: yes

So I'd rather change all the properties at the same time, and this seems to work for me:

# nmcli conn modify "Wired connection 1" ipv4.addresses 192.2.0.100/24 ipv4.gateway 192.0.2.254 ipv4.method manual

To revert though, it's easier:

# nmcli conn modify "Wired connection 1" ipv4.method auto

Perhaps you want to change more of the properties (like DNS, or ipv6 related configuration), so check all the available ones on the interface with:

# nmcli conn show "Wired connection 1"
  • Yeah, I saw that in the manual and other documentation but that's in an interactive mode. A command line solution is critical. Now, I tried what you sent me thinking, "bloody hells! its an order of options issue." Sadly no, I get an error using your version of the command as well. Specifically, "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])." – shrewmouse Dec 21 '15 at 13:58
  • so, checxum, what version of nmcli are you running? "nmcli -v" – shrewmouse Dec 21 '15 at 13:59
  • Oh, mine is 1.0.4 much, newer. Have you tried ipv4.addresses 192.168.2.180/24 192.168.2.1 as the error message suggests? An RH bug discusses a similar error in a similar version, bugzilla.redhat.com/show_bug.cgi?id=998929 - from what I can tell, yours is the fixed one as it prints an usage for it. – chexum Dec 21 '15 at 14:59
  • Yes, I used the new syntax. Still no joy. – shrewmouse Dec 21 '15 at 15:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.