Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 7e4128ee authored by IMBERT Matthieu's avatar IMBERT Matthieu Committed by Baptiste Jonglez
Browse files

kavlan ipv6: change address plan for global kavlans

parent 641ef21f
No related branches found
No related tags found
No related merge requests found
......@@ -67,7 +67,7 @@ subnet <%= kavlan_ip.network %> netmask <%= kavlan_ip.netmask %> {
kavlan6_net = kavlan_id + 0x90 - 4
kavlan6_ip = "#{refapi['sites'][site_uid]['ipv6']['prefix']}#{sprintf('%02x', kavlan6_net)}::/64"
else # global vlan
kavlan6_ip = "#{refapi['sites'][site_uid]['ipv6']['prefix']}a0::/59"
kavlan6_ip = "#{refapi['sites'][site_uid]['ipv6']['prefix']}a0::/64"
end -%>
subnet6 <%= kavlan6_ip %> {
<% end -%>
......
......@@ -213,10 +213,15 @@ def add_kavlan_ipv6s(h)
ip6 += '%x' % h['ipv6']['site_indexes'][site_uid]
ip6 += '%x:' % (kvl_id + 0x90 - 4)
else # global
ip6 += '%x' % h['ipv6']['site_indexes'][global_vlan_site[kvl_id]]
ip6 += '%x:' % ((h['ipv6']['site_indexes'][site_uid]&0x1f) + 0xa0)
ip6 += '%xa0:' % h['ipv6']['site_indexes'][global_vlan_site[kvl_id]] # no matter what, the gw is always on the global kavlan's site
end
if kvl_id > 9
# global kavlan: set most signicant octet of interface part to site index
ip6 += '%x' % h['ipv6']['site_indexes'][site_uid]
ip6 += '%02x' % ((ip4.split('.')[2].to_i & 0b1111) + 1)
else
ip6 += '%x' % ((ip4.split('.')[2].to_i & 0b1111) + 1)
end
ip6 += '%x' % ((ip4.split('.')[2].to_i & 0b1111) + 1)
if idx > 0
ip6 += ':%x::' % idx
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment