Red Hat Bugzilla – Bug 1464999
After setting ipv6 to dhcp its not possible to set it back to static
Last modified: 2017-10-12 09:49:28 EDT
Description of problem:After setting ipv6 to dhcp its not possible to set it back to static
Version-Release number of selected component (if applicable):126.96.36.199
Steps to Reproduce:
2.ssh to appliance
4.set ipv6 to dhcp
5.Try setting it back to static
Network interface failed to start using the values supplied
Expected results:static ipv6 set correctly
After this failure both ipv6 and ipv4 have been lost from configuration
I'm not sure we have a solution for this yet, but we have made some progress.
TLDR; There are two work-arounds for this, either:
`rm /var/run/dhclient6-eth0.pid` (assuming a process with pid in the file doesn't exist)
Just do the config through the console again
More detail to follow:
After making changes to a network interface config file we run `ifdown eth0` then `ifup eth0` to make the changes take effect.
For some reason when we set ipv6 config to dhcp, dhclient fails to start properly, leaving a pid file (/var/run/dhclient6-eth0.pid). This, in my opinion, is a bug in dhclient. In my testing I typically will get an address, but dhclient will not be running for IPv6 (the command line should have the -6 option).
When we then try to set the config to static, we attempt to `ifdown eth0` which tries to stop the instance of dhclient that should be running based on the presence if the pid file. This causes the ifdown command to return an error status and we fail.
Because the error is being caused by a file rather than a misconfiguration you can simply remove the pid file and then set the static address using the console. Alternatively, after hitting the issue once, you should be able to run through the configuration again because ifdown removes the pid file (even though it fails).
Can you test out these workarounds?
New commit detected on ManageIQ/linux_admin/master:
Author: Bo Yao <firstname.lastname@example.org>
AuthorDate: Fri Jul 14 11:47:32 2017 -0400
Commit: Bo Yao <email@example.com>
CommitDate: Tue Jul 18 16:06:51 2017 -0400
Fix configure network fails after a success DHCP configuration
lib/linux_admin/network_interface/network_interface_rh.rb | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
PR to bump linux_admin version: https://github.com/ManageIQ/manageiq-gems-pending/pull/243
Both workarounds do seem to work for setting ipv6, but its still required to run this from a provider console and not through ssh to the appliance as ipv4 still gets dropped.
(In reply to luke couzens from comment #7)
> Both workarounds do seem to work for setting ipv6, but its still required to
> run this from a provider console and not through ssh to the appliance as
> ipv4 still gets dropped.
Currently what we did in setting the network is shutting down network interface and change in network configuration file then start network interface. I did some search found both ipv4 and ipv6 change to an interface (eth0) need restart network service.
This is not very authoritative, but no more I can found for adding ipv6 address without restarting network interface in Red Hat, Debian, Ubuntu and Archlinux official docs, so we can generally think it's not possible.
But there are simple ways to do this in ssh client side to avoid drop ssh connection:
1) using screen or tmux with ssh to suspend the ssh client;
2) using mosh: https://github.com/mobile-shell/mosh
It's a enhanced ssh run "server" on both client and server side. When server ip address change/temporarily restart, it can keep connection alive.
Verified in 188.8.131.52