WARNING: untranslated string: wg client configuration file = WireGuard Client Configuration File
WARNING: untranslated string: wg client pool = Client Pool
WARNING: untranslated string: wg create peer = Create A New Peer
+WARNING: untranslated string: wg dns = DNS
WARNING: untranslated string: wg edit peer = Edit Peer
+WARNING: untranslated string: wg host to net client settings = Host-To-Net Client Settings
+WARNING: untranslated string: wg invalid client dns = Invalid client DNS address
WARNING: untranslated string: wg invalid client pool = Invalid client pool
WARNING: untranslated string: wg invalid endpoint address = Invalid endpoint address
WARNING: untranslated string: wg invalid endpoint port = Invalid endpoint port
WARNING: untranslated string: wg client configuration file = WireGuard Client Configuration File
WARNING: untranslated string: wg client pool = Client Pool
WARNING: untranslated string: wg create peer = Create A New Peer
+WARNING: untranslated string: wg dns = DNS
WARNING: untranslated string: wg edit peer = Edit Peer
+WARNING: untranslated string: wg host to net client settings = Host-To-Net Client Settings
+WARNING: untranslated string: wg invalid client dns = Invalid client DNS address
WARNING: untranslated string: wg invalid client pool = Invalid client pool
WARNING: untranslated string: wg invalid endpoint address = Invalid endpoint address
WARNING: untranslated string: wg invalid endpoint port = Invalid endpoint port
WARNING: untranslated string: wg client configuration file = WireGuard Client Configuration File
WARNING: untranslated string: wg client pool = Client Pool
WARNING: untranslated string: wg create peer = Create A New Peer
+WARNING: untranslated string: wg dns = DNS
WARNING: untranslated string: wg edit peer = Edit Peer
+WARNING: untranslated string: wg host to net client settings = Host-To-Net Client Settings
+WARNING: untranslated string: wg invalid client dns = Invalid client DNS address
WARNING: untranslated string: wg invalid client pool = Invalid client pool
WARNING: untranslated string: wg invalid endpoint address = Invalid endpoint address
WARNING: untranslated string: wg invalid endpoint port = Invalid endpoint port
WARNING: untranslated string: wg client configuration file = WireGuard Client Configuration File
WARNING: untranslated string: wg client pool = Client Pool
WARNING: untranslated string: wg create peer = Create A New Peer
+WARNING: untranslated string: wg dns = DNS
WARNING: untranslated string: wg edit peer = Edit Peer
+WARNING: untranslated string: wg host to net client settings = Host-To-Net Client Settings
+WARNING: untranslated string: wg invalid client dns = Invalid client DNS address
WARNING: untranslated string: wg invalid client pool = Invalid client pool
WARNING: untranslated string: wg invalid endpoint address = Invalid endpoint address
WARNING: untranslated string: wg invalid endpoint port = Invalid endpoint port
WARNING: untranslated string: wg client configuration file = WireGuard Client Configuration File
WARNING: untranslated string: wg client pool = Client Pool
WARNING: untranslated string: wg create peer = Create A New Peer
+WARNING: untranslated string: wg dns = DNS
WARNING: untranslated string: wg edit peer = Edit Peer
+WARNING: untranslated string: wg host to net client settings = Host-To-Net Client Settings
+WARNING: untranslated string: wg invalid client dns = Invalid client DNS address
WARNING: untranslated string: wg invalid client pool = Invalid client pool
WARNING: untranslated string: wg invalid endpoint address = Invalid endpoint address
WARNING: untranslated string: wg invalid endpoint port = Invalid endpoint port
WARNING: untranslated string: wg client configuration file = WireGuard Client Configuration File
WARNING: untranslated string: wg client pool = Client Pool
WARNING: untranslated string: wg create peer = Create A New Peer
+WARNING: untranslated string: wg dns = DNS
WARNING: untranslated string: wg edit peer = Edit Peer
+WARNING: untranslated string: wg host to net client settings = Host-To-Net Client Settings
+WARNING: untranslated string: wg invalid client dns = Invalid client DNS address
WARNING: untranslated string: wg invalid client pool = Invalid client pool
WARNING: untranslated string: wg invalid endpoint address = Invalid endpoint address
WARNING: untranslated string: wg invalid endpoint port = Invalid endpoint port
WARNING: untranslated string: wg client configuration file = WireGuard Client Configuration File
WARNING: untranslated string: wg client pool = Client Pool
WARNING: untranslated string: wg create peer = Create A New Peer
+WARNING: untranslated string: wg dns = DNS
WARNING: untranslated string: wg edit peer = Edit Peer
+WARNING: untranslated string: wg host to net client settings = Host-To-Net Client Settings
+WARNING: untranslated string: wg invalid client dns = Invalid client DNS address
WARNING: untranslated string: wg invalid client pool = Invalid client pool
WARNING: untranslated string: wg invalid endpoint address = Invalid endpoint address
WARNING: untranslated string: wg invalid endpoint port = Invalid endpoint port
WARNING: untranslated string: wg client configuration file = WireGuard Client Configuration File
WARNING: untranslated string: wg client pool = Client Pool
WARNING: untranslated string: wg create peer = Create A New Peer
+WARNING: untranslated string: wg dns = DNS
WARNING: untranslated string: wg edit peer = Edit Peer
+WARNING: untranslated string: wg host to net client settings = Host-To-Net Client Settings
+WARNING: untranslated string: wg invalid client dns = Invalid client DNS address
WARNING: untranslated string: wg invalid client pool = Invalid client pool
WARNING: untranslated string: wg invalid endpoint address = Invalid endpoint address
WARNING: untranslated string: wg invalid endpoint port = Invalid endpoint port
WARNING: untranslated string: wg client configuration file = WireGuard Client Configuration File
WARNING: untranslated string: wg client pool = Client Pool
WARNING: untranslated string: wg create peer = Create A New Peer
+WARNING: untranslated string: wg dns = DNS
WARNING: untranslated string: wg edit peer = Edit Peer
+WARNING: untranslated string: wg host to net client settings = Host-To-Net Client Settings
+WARNING: untranslated string: wg invalid client dns = Invalid client DNS address
WARNING: untranslated string: wg invalid client pool = Invalid client pool
WARNING: untranslated string: wg invalid endpoint address = Invalid endpoint address
WARNING: untranslated string: wg invalid endpoint port = Invalid endpoint port
< wg client configuration file
< wg client pool
< wg create peer
+< wg dns
< wg edit peer
+< wg host to net client settings
+< wg invalid client dns
< wg invalid client pool
< wg invalid endpoint address
< wg invalid endpoint port
< wg client configuration file
< wg client pool
< wg create peer
+< wg dns
< wg edit peer
+< wg host to net client settings
+< wg invalid client dns
< wg invalid client pool
< wg invalid endpoint address
< wg invalid endpoint port
< wg client configuration file
< wg client pool
< wg create peer
+< wg dns
< wg edit peer
+< wg host to net client settings
+< wg invalid client dns
< wg invalid client pool
< wg invalid endpoint address
< wg invalid endpoint port
< wg client configuration file
< wg client pool
< wg create peer
+< wg dns
< wg edit peer
+< wg host to net client settings
+< wg invalid client dns
< wg invalid client pool
< wg invalid endpoint address
< wg invalid endpoint port
< wg client configuration file
< wg client pool
< wg create peer
+< wg dns
< wg edit peer
+< wg host to net client settings
+< wg invalid client dns
< wg invalid client pool
< wg invalid endpoint address
< wg invalid endpoint port
< wg client configuration file
< wg client pool
< wg create peer
+< wg dns
< wg edit peer
+< wg host to net client settings
+< wg invalid client dns
< wg invalid client pool
< wg invalid endpoint address
< wg invalid endpoint port
< wg client configuration file
< wg client pool
< wg create peer
+< wg dns
< wg edit peer
+< wg host to net client settings
+< wg invalid client dns
< wg invalid client pool
< wg invalid endpoint address
< wg invalid endpoint port
< wg client configuration file
< wg client pool
< wg create peer
+< wg dns
< wg edit peer
+< wg host to net client settings
+< wg invalid client dns
< wg invalid client pool
< wg invalid endpoint address
< wg invalid endpoint port
# Set any defaults
&General::set_defaults(\%settings, {
- "ENABLED" => "off",
- "PORT" => $DEFAULT_PORT,
+ "ENABLED" => "off",
+ "PORT" => $DEFAULT_PORT,
+ "CLIENT_DNS" => $Network::ethernet{'GREEN_ADDRESS'},
});
# Generate keys
# Save on main page
if ($cgiparams{"ACTION"} eq $Lang::tr{'save'}) {
+ my @client_dns = ();
+
# Store whether enabled or not
if ($cgiparams{'ENABLED'} =~ m/^(on|off)?$/) {
$settings{'ENABLED'} = $cgiparams{'ENABLED'};
push(@errormessages, $Lang::tr{'wg invalid client pool'});
}
+ # Check client DNS
+ if (defined $cgiparams{'CLIENT_DNS'}) {
+ @client_dns = split(/,/, $cgiparams{'CLIENT_DNS'});
+
+ foreach my $dns (@client_dns) {
+ unless (&Network::check_ip_address($dns)) {
+ push(@errormessages, "$Lang::tr{'wg invalid client dns'}: ${dns}");
+ }
+ }
+
+ # Store CLIENT_DNS
+ $settings{'CLIENT_DNS'} = join("|", @client_dns);
+ }
+
# Don't continue on error
goto MAIN if (scalar @errormessages);
"CLIENT_POOL" => (&pool_is_in_use($settings{'CLIENT_POOL'}) ? "readonly" : ""),
);
+ my $client_dns = $settings{'CLIENT_DNS'} =~ s/\|/, /gr;
+
print <<END;
<form method="POST" action="">
<table class="form">
min="1024" max="65535" />
</td>
</tr>
+ </table>
+ <h6>$Lang::tr{'wg host to net client settings'}</h6>
+
+ <table class="form">
<tr>
<td>$Lang::tr{'wg client pool'}</td>
<td>
</td>
</tr>
+ <tr>
+ <td>$Lang::tr{'wg dns'}</td>
+ <td>
+ <input type="text" name="CLIENT_DNS"
+ value="$client_dns" />
+ </td>
+ </tr>
+
<tr class="action">
<td colspan="2">
<input type='submit' name='ACTION' value='$Lang::tr{'save'}' />
));
my $port = $settings{'PORT'};
+ # Fetch any DNS servers
+ my @dns = split(/\|/, $settings{'CLIENT_DNS'});
+
my @conf = (
"[Interface]",
"PrivateKey = $peer->{'PRIVATE_KEY'}",
"Address = $peer->{'CLIENT_ADDRESS'}",
- "",
+ );
+
+ # Optionally add DNS servers
+ if (scalar @dns) {
+ push(@conf, "DNS = " . join(", ", @dns));
+ }
+ # Finish the [Interface] section
+ push(@conf, "");
+
+ # Add peer configuration
+ push(@conf, (
"[Peer]",
"Endpoint = ${fqdn}:${port}",
"PublicKey = $settings{'PUBLIC_KEY'}",
"PresharedKey = $peer->{'PSK'}",
"AllowedIPs = " . join(", ", @allowed_ips),
"PersistentKeepalive = $DEFAULT_KEEPALIVE",
- );
+ ));
return join("\n", @conf);
}
'wg client configuration file' => 'WireGuard Client Configuration File',
'wg client pool' => 'Client Pool',
'wg create peer' => 'Create A New Peer',
+'wg dns' => 'DNS',
'wg edit peer' => 'Edit Peer',
+'wg host to net client settings' => 'Host-To-Net Client Settings',
+'wg invalid client dns' => 'Invalid client DNS address',
'wg invalid client pool' => 'Invalid client pool',
'wg invalid endpoint address' => 'Invalid endpoint address',
'wg invalid endpoint port' => 'Invalid endpoint port',