]> git.ipfire.org Git - people/ms/ipfire-2.x.git/commitdiff
wireguard-functions.pl: Don't send DNS configuration to n2n peers
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 27 Sep 2024 16:03:14 +0000 (18:03 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 22 Apr 2025 14:48:53 +0000 (16:48 +0200)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
config/cfgroot/wireguard-functions.pl

index 4823dd00a33de678f00cd2e276d4f4ed8eee7579..bf4ba8c50072ffeb1b5d053b37d08574bcadc2d7 100644 (file)
@@ -305,6 +305,7 @@ sub generate_peer_configuration($) {
        my $peer = shift;
 
        my @allowed_ips = ();
+       my @dns = ();
 
        # Convert all subnets into CIDR notation
        foreach my $subnet ($peer->{'LOCAL_SUBNETS'}) {
@@ -326,8 +327,10 @@ sub generate_peer_configuration($) {
 
        my $port = $settings{'PORT'};
 
-       # Fetch any DNS servers
-       my @dns = split(/\|/, $settings{'CLIENT_DNS'});
+       # Fetch any DNS servers for hosts
+       if ($peer->{'TYPE'} eq 'host') {
+               @dns = split(/\|/, $settings{'CLIENT_DNS'});
+       }
 
        my @conf = (
                "[Interface]",