cancel
Showing results for 
Search instead for 
Did you mean: 
LFL
Cadet
Cadet
  • 5,407 Views

[Question] How does one completely remove ipv6 through nmcli?

Hello All,

As the subject states, I'm not understanding how to completely remove an ipv6 address that was previously assigned to a connection via NMCLI. I was able to open NMTUI and remove it, but I was hoping to understand the command functionality. Below are my findings:

Base System Info:

[root@centos ~]# cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)
[root@centos ~]# cat /etc/issue
\S
Kernel \r on an \m
[root@centos ~]# uname -rs
Linux 3.10.0-862.14.4.el7.x86_64

Test Scenario:
1) First I added the addressess and verified the configuration:

 

[root@centos ~]# nmcli con mod eth1 ipv6.addresses fddb:fe2a:ab1e::c0a8:1/64 ipv6.gateway fddb:fe2a:ab1e::c0a8:fe
[root@centos ~]# nmcli con show eth1 | grep ipv6
ipv6.method:                            auto
ipv6.dns:                               --
ipv6.dns-search:                        --
ipv6.dns-options:                       ""
ipv6.dns-priority:                      0
ipv6.addresses:                         fddb:fe2a:ab1e::c0a8:1/64
ipv6.gateway:                           fddb:fe2a:ab1e::c0a8:fe
ipv6.routes:                            --
ipv6.route-metric:                      -1
ipv6.route-table:                       0 (unspec)
ipv6.ignore-auto-routes:                no
ipv6.ignore-auto-dns:                   no
ipv6.never-default:                     no
ipv6.may-fail:                          yes
ipv6.ip6-privacy:                       -1 (unknown)
ipv6.addr-gen-mode:                     stable-privacy
ipv6.dhcp-send-hostname:                yes
ipv6.dhcp-hostname:                     --
ipv6.token:                             --

2) Afterwards, I attempted to remove both addresses and received the following error:

[root@centos ~]# nmcli con mod eth1 -ipv6.addresses fddb:fe2a:ab1e::c0a8:1/64 -ipv6.gateway fddb:fe2a:ab1e::c0a8:fe
Error: Failed to modify connection 'eth1': ipv6.gateway: gateway cannot be set if there are no addresses configured

3) Confused, I attempted to remove each value separately one at a time.
In doing so, I received an error for the address but not the gateway. Although there was no error for the gateway, the gateway value persists:

[root@centos ~]# nmcli con mod eth1 -ipv6.addresses fddb:fe2a:ab1e::c0a8:1/64
Error: Failed to modify connection 'eth1': ipv6.gateway: gateway cannot be set if there are no addresses configured
[root@centos ~]# nmcli con mod eth1  -ipv6.gateway fddb:fe2a:ab1e::c0a8:fe
[root@centos ~]# nmcli con show eth1 | grep -E "(ipv6.addresses|ipv6.gateway)"
ipv6.addresses:                         fddb:fe2a:ab1e::c0a8:1/64
ipv6.gateway:                           fddb:fe2a:ab1e::c0a8:fe

4) If I add extra addresses, I'm able to remove those without any problems. The issue only seems to be that I'm unable to remove the gateway and thus unable to remove the addresses completely:

[root@centos ~]# nmcli con show eth1 | grep -E "(ipv6.addresses|ipv6.gateway)"
ipv6.addresses:                         fddb:fe2a:ab1e::c0a8:1/64
ipv6.gateway:                           fddb:fe2a:ab1e::c0a8:fe
[root@centos ~]# nmcli con mod eth1 +ipv6.addresses fddb:fe2a:ab1e::c0a8:2/32
[root@centos ~]# nmcli con show eth1 | grep -E "(ipv6.addresses|ipv6.gateway)"
ipv6.addresses:                         fddb:fe2a:ab1e::c0a8:1/64, fddb:fe2a:ab1e::c0a8:2/32
ipv6.gateway:                           fddb:fe2a:ab1e::c0a8:fe
[root@centos ~]# nmcli con mod eth1 -ipv6.addresses fddb:fe2a:ab1e::c0a8:1/64
[root@centos ~]# nmcli con show eth1 | grep -E "(ipv6.addresses|ipv6.gateway)"
ipv6.addresses:                         fddb:fe2a:ab1e::c0a8:2/32
ipv6.gateway:                           fddb:fe2a:ab1e::c0a8:fe

 

 

All this in place, I repeat that if I open nmtui instead, I'm able to modify the connection and remove the ipv6 addresses completely (as long as the method is configured for auto and not manual). So how is this able to be achieved via nmcli?

Thanks for reviewing,
LFL

Labels (1)
Tags (2)
0 Kudos
2 Replies
Jayadev
Flight Engineer Flight Engineer
Flight Engineer
  • 5,368 Views

I think nmcli interatcive utility would be helpfule here. Try below command to enter the utility

nmcli connection edit eno1

use the help feature in this utility to learn more about its capabilities. I was able to unassign the ipv6 address from this and change the mode. Let me know if you need the exact commands.

Jayadev

0 Kudos
VijayM
Cadet
Cadet
  • 3,346 Views

Hi,

This can be achieved by issuing the below command:

nmcli con mod eth1 ipv6.method Auto -ipv6.addresses fddb:fe2a:ab1e::c0a8:1/64

 

0 Kudos
Join the discussion
You must log in to join this conversation.