nmcli con modify my-profile ipv4.addr " "
nmcli con modify my-profile ipv6.addr " "
Note:
Empty string should be used to remove IPs, and 'method' might be needed to set
to 'auto' simultaneously, as well.
$ nmcli con modify profile1 ipv4.addr "" ipv4.method auto
https://bugzilla.redhat.com/show_bug.cgi?id=1071394
The --help option (or its aliases -help/help) is only allowed at as
first argument. Fix completion to account for this.
Signed-off-by: Thomas Haller <thaller@redhat.com>
It works both in 'nmcli con modify' and 'nmcli con edit'.
The following properties are supported (all container-type properties except
properties with option names):
ipv4.dns
ipv4.dns-searches
ipv4.addresses
ipv4.routes
ipv6.dns
ipv6.dns-searches
ipv6.addresses
ipv6.routes
802-1x.eap
802-1x.altsubject-matches
802-1x.phase2-altsubject-matches
connection.permissions
connection.secondary
802-3-ethernet.mac-address-blacklist
802-11-wireless.mac-address-blacklist
802-11-wireless-security.proto
802-11-wireless-security.pairwise
802-11-wireless-security.group
vlan.ingress-priority-map
vlan.egress-priority-map
nm_setting_wired_remove_mac_blacklist_item_by_value()
Also add missing function nm_setting_wired_clear_mac_blacklist_items() and notify
about mac-address-blacklist changes.
Synopsis:
nmcli con modify -<property>.<setting> <value>
'value' can be empty ("") to remove the whole property value value (in this
case the behaviour is the same as without '-').
Or the 'value' is an index of the item to remove, or an option name (for a few
properties that have option names, like bond.options or ethernet.s390-options).
$ nmcli con mod myeth ipv4.dns "10.0.0.55 10.0.0.66 8.8.8.8 8.8.4.4"
---> ipv4.dns: 10.0.0.55, 10.0.0.66, 8.8.8.8, 8.8.4.4
$ nmcli con mod myeth -ipv4.dns 1
---> ipv4.dns: 10.0.0.55, 8.8.8.8, 8.8.4.4
---> bond.options: mode=balance-rr
$ nmcli con mod bond0 +bond.options "mii=500, downdelay=800"
---> bond.options: downdelay=800,miimon=500,mode=balance-rr
$ nmcli con mod bond0 -bond.options downdelay
---> bond.options: miimon=500,mode=balance-rr
This is necessary especially for cases where properties depend on each other.
So you need to set them in one command, else the profile won't validate.
Examples:
nmcli con mod em1-1 ipv4.method manual ipv4.addr "192.168.1.2/24,10.10.1.5/8"
nmcli con mod profile ipv4.method link-local ipv4.addr ""
Previously 'nmcli con modify' appended values for multi-value properties.
This commit makes 'nmcli con modify' overwrite the whole value. You can
choose appending values by prefixing the setting.property with '+' sign.
For simple (not container) properties the behaviour is the same both with
and without the '+', of course.
Synopsis:
nmcli connection modify [+]<setting>.<property <value>
Example:
---> ipv4.dns = 1.2.3.4
$ nmcli connection modify my-em1 ipv4.dns 8.8.8.8
---> ipv4.dns = 8.8.8.8
$ nmcli connection modify my-em1 +ipv4.dns 8.8.4.4
---> ipv4.dns = 8.8.8.8 8.8.4.4
https://bugzilla.redhat.com/show_bug.cgi?id=1044027
We don't want the kernel to do IPv6 addrconf, but we do want it to
notice the non-router-related fields in the RA (eg, Retrans Timer) and
update the interface state to reflect them. So instead of turning off
accept_ra, we leave it turned on, and turn off accept_ra_defrtr,
accept_ra_rtr_pref, and accept_ra_pinfo instead.
Remove the "silent_on_error" flag from nm_platform_sysctl_get(), and
make both get() and set() log at debug level on ENOENT and error level
on all other errors, always.
Also ensure that we don't sometimes write "failed to set 'x' to 'y':
Success" when a partial write occurs.
get_best_ip4_device() and get_best_ip6_device() iterate over
the list of devices to find the device with the default route.
The order of iteration is arbitrarly choosen.
Before, if two devices had the same priority, it would choose
the first one. Change it so that the device which currently has
the default route keeps it -- until it gets deactivated or a higher
priorty device gets connected.
Signed-off-by: Thomas Haller <thaller@redhat.com>
e19f48ec was incomplete; it failed to handle device disconnections.
NMDevice will clear its internal activation request *before*
emitting the state change, which meant that when the
NMActRequest processes the DISCONNECTED state change, the:
if (NM_ACTIVE_CONNECTION (nm_device_get_act_request (device)) != active)
return;
statement triggered and the DISCONNECTED state change was not
processed.
Instead of having NMDevice keep the activation request alive over
the entire DISCONNECTED state transition, which may have much
greater implications, handle the special-case locally in the
NMActRequest code itself.
connection_parser.c: In function 'make_ip4_setting':
connection_parser.c:660:33: error: 'method' may be used uninitialized in this function [-Werror=maybe-uninitialized]
if (!is_static_block && strstr (method, "dhcp")) {
connections.c: In function ‘load_cmd_line_edit_lib’:
connections.c:5744:17: error: ‘module’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
g_module_close (module);
Signed-off-by: Thomas Haller <thaller@redhat.com>
reader.c: In function 'parse_infiniband_p_key':
reader.c:3947:5: error: 'id' may be used uninitialized in this function [-Werror=maybe-uninitialized]
id = (id | 0x8000);
^
Signed-off-by: Thomas Haller <thaller@redhat.com>