Added IPv6 support for network module.

This commit is contained in:
Timo Mkinen 2010-05-16 14:54:52 +03:00
parent 2592ca9fad
commit 61c3a1d3a3
3 changed files with 16 additions and 1 deletions

View file

@ -34,6 +34,11 @@ class network::helper::restart {
# if interface just needs to be brought up. Defaults to none.
# $netmask:
# Netmask for interface. Required only when $ipaddr is used.
# $ip6addr:
# IPv6 address for interface. Use auto for autoconfigured address.
# Defaults to none.
# $ip6netmask:
# IPv6 netmask length. Defaults to 64.
# $options:
# Custom options for interface (used only on OpenBSD).
#
@ -44,7 +49,7 @@ class network::helper::restart {
# netmask => "255.255.0.0",
# }
#
define network::interface($options = [], $ipaddr = "none", $netmask = "none") {
define network::interface($options = [], $ipaddr = "none", $netmask = "none", ip6addr = "none", ip6netmask = "64") {
include network::helper::restart

View file

@ -5,3 +5,8 @@ up
<% else -%>
inet <%= ipaddr %> <%= netmask %> NONE<% options.each do |val| %> <%= val %><% end %>
<% end -%>
<% if ip6addr == 'auto' -%>
rtsol
<% elsif ip6addr != 'none' -%>
inet6 alias <%= ip6addr %> <%= ip6netmask %>
<% end -%>

View file

@ -18,6 +18,11 @@ DHCPCLASS=
PERSISTENT_DHCLIENT=yes
NOZEROCONF=yes
<% end -%>
<% if ip6addr == 'none' -%>
IPV6INIT=no
<% elsif ip6addr != 'auto' -%>
IPV6ADDR=<%= ip6addr %>/<%= ip6netmask %>
<% end -%>
<% options.each do |val| -%>
<%= val %>
<% end -%>