Skip to content

Commit

Permalink
Merge pull request #153 from andrekeller/feature_route-ipv6
Browse files Browse the repository at this point in the history
feature (server): add route-ipv6 parameter support.
  • Loading branch information
luxflux committed May 2, 2015
2 parents 1e3419d + a30aa96 commit ef31bc6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@
# Multiple routes can be specified.
# Default: []
#
# [*route_ipv6*]
# Array. Add IPv6 route to routing table after connection is established.
# Multiple routes can be specified.
# Default: []
#
# [*keepalive*]
# String. Add keepalive directive (ping and ping-restart) to server.
# Should match the form "n m".
Expand Down Expand Up @@ -371,6 +376,7 @@
$server_bridge = '',
$push = [],
$route = [],
$route_ipv6 = [],
$keepalive = '',
$fragment = false,
$ssl_key_size = 1024,
Expand Down
3 changes: 3 additions & 0 deletions spec/defines/openvpn_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
'server_ipv6' => 'fe80:1337:1337:1337::/64',
'push' => [ 'dhcp-option DNS 172.31.0.30', 'route 172.31.0.0 255.255.0.0' ],
'route' => [ '192.168.30.0 255.255.255.0', '192.168.35.0 255.255.0.0' ],
'route_ipv6' => [ '2001:db8:1234::/64', '2001:db8:abcd::/64' ],
'keepalive' => '10 120',
'topology' => 'subnet',
'ssl_key_size' => 2048,
Expand Down Expand Up @@ -182,6 +183,8 @@
it { should contain_file('/etc/openvpn/test_server.conf').with_content(/^push\s+"route\s+172\.31\.0\.0\s+255\.255\.0\.0"$/) }
it { should contain_file('/etc/openvpn/test_server.conf').with_content(/^route\s+192.168.30.0\s+255.255.255.0$/) }
it { should contain_file('/etc/openvpn/test_server.conf').with_content(/^route\s+192.168.35.0\s+255.255.0.0$/) }
it { should contain_file('/etc/openvpn/test_server.conf').with_content(/^route-ipv6\s+2001\:db8\:1234\:\:\/64$/) }
it { should contain_file('/etc/openvpn/test_server.conf').with_content(/^route-ipv6\s+2001\:db8\:abcd\:\:\/64$/) }
it { should contain_file('/etc/openvpn/test_server.conf').with_content(/^keepalive\s+10\s+120$/) }
it { should contain_file('/etc/openvpn/test_server.conf').with_content(/^topology\s+subnet$/) }
it { should contain_file('/etc/openvpn/test_server.conf').with_content(/^management\s+1.3.3.7 1337$/) }
Expand Down
3 changes: 3 additions & 0 deletions templates/server.erb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ push "<%= item %>"
<% @route.each do |item| -%>
route <%= item %>
<% end -%>
<% @route_ipv6.each do |item| -%>
route-ipv6 <%= item %>
<% end -%>
<% if @sndbuf -%>
sndbuf <%= @sndbuf %>
<% end -%>
Expand Down

0 comments on commit ef31bc6

Please sign in to comment.