-
Notifications
You must be signed in to change notification settings - Fork 85
Add support for IPv6 SLAAC (rebased) #325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
christoph-heiss
wants to merge
24
commits into
CumulusNetworks:master
Choose a base branch
from
christoph-heiss:ipv6-slaac-round2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add support for IPv6 SLAAC (rebased) #325
christoph-heiss
wants to merge
24
commits into
CumulusNetworks:master
from
christoph-heiss:ipv6-slaac-round2
Conversation
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
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
Signed-off-by: Christoph Heiss <[email protected]>
Signed-off-by: Christoph Heiss <[email protected]>
Signed-off-by: Christoph Heiss <[email protected]>
Signed-off-by: Christoph Heiss <[email protected]>
8b98a79 to
682ec54
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, Thank you!
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.