Add support for IPv6 SLAAC (rebased)#325
Open
christoph-heiss wants to merge 24 commits intoCumulusNetworks:masterfrom
Open
Add support for IPv6 SLAAC (rebased)#325christoph-heiss wants to merge 24 commits intoCumulusNetworks:masterfrom
christoph-heiss wants to merge 24 commits intoCumulusNetworks:masterfrom
Conversation
87e5983 to
8b98a79
Compare
The current code is buggy if an interface only use ipv6.
ipv6 don't have primary and are not ordered, so change can randomly
remove/re-add all ipv6 address
```
auto eno4
iface eno4 inet6 static
address 2001:db8:a0b:12f0::1/64
info: eno4: netlink: ip addr add 2001:db8:a0b:12f0::1/64 dev eno4
auto eno4
iface eno4 inet6 static
address 2001:db8:a0b:12f0::1/64
address 2001:db8:a0b:12f0::2/64
info: eno4: netlink: ip addr add 2001:db8:a0b:12f0::2/64 dev eno4
auto eno4
iface eno4 inet6 static
address 2001:db8:a0b:12f0::1/64
address 2001:db8:a0b:12f0::2/64
address 2001:db8:a0b:12f0::3/64
info: eno4: primary ip changed (from 2001:db8:a0b:12f0::1/64 to 2001:db8:a0b:12f0::2/64) we need to purge all ip addresses and re-add them
info: eno4: netlink: ip addr del 2001:db8:a0b:12f0::2/64 dev eno4
info: eno4: netlink: ip addr del 2001:db8:a0b:12f0::1/64 dev eno4
info: reading '/proc/sys/net/ipv6/conf/eno4/disable_ipv6'
info: eno4: netlink: ip addr add 2001:db8:a0b:12f0::1/64 dev eno4
info: eno4: netlink: ip addr add 2001:db8:a0b:12f0::2/64 dev eno4
info: eno4: netlink: ip addr add 2001:db8:a0b:12f0::3/64 dev eno4
```
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
we want to get IFA_FLAGS to known if an ip is permanent (0x80), or dynamic (slaac)
simply sysctl accept_ra=1 && autoconf=1
Currently it's only available in dhcp method. Set 0 by default (if interface was previously method auto).
we manage them in address now
user can defined both static ips && enable accept_ra 1 in as or auto method exemple1: ---------- iface eth0 inet auto iface eth0 inet6 static address .... exemple2: -------- iface eth0 inet6 static address .... accept_ra 1 autoconf 1 We need to process configured addresses, but we won't purge ipv6 on reload
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
factorize with adding_get_netlink_cache_accept_ra && _get_netlink_cache_auto and correctly test if cache exist or not the netlink cache can have empty value for an interface, if the interface was not existing when we have populate the cache. for example, a vlan interface created in pre-up by vlan module. In this case, we return an empty string , and fix parsing of empty netlink cache
accept_ra is only to get default gw, autoconf is for generate ip Also skip only dynamic ipv6 (!ipflag permanent 0x80)
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
8b98a79 to
682ec54
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi!
This is essentially just a rebased version of #259, since that seems to have gone stale for quite a while now.
I've added some small commits on top for some small cleanups, nothing that should change functionality though.
so hopefully nothing broke, but I'm still testing it some more currently.So this should close #259, #249, #122 and #178.