--- rpms/smeserver-wireguard/contribs10/smeserver-wireguard-1.0-bz11721-init.patch 2021/10/28 03:35:36 1.6 +++ rpms/smeserver-wireguard/contribs10/smeserver-wireguard-1.0-bz11721-init.patch 2021/11/01 02:41:08 1.7 @@ -217,3 +217,36 @@ diff -Nur --no-dereference smeserver-wir panel_link("wireguard", "manager"); +diff -Nur --no-dereference smeserver-wireguard-1.0.old/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/wireguard.pm smeserver-wireguard-1.0/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/wireguard.pm +--- smeserver-wireguard-1.0.old/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/wireguard.pm 2021-10-26 23:15:10.000000000 -0400 ++++ smeserver-wireguard-1.0/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/wireguard.pm 2021-10-31 22:37:41.238000000 -0400 +@@ -224,6 +224,7 @@ + my $wg0 = $cdb->get('wg-quick@wg0'); + my $ServPublic = $wg0->prop('public'); + my $Port = $wg0->prop('UDPPort'); ++my $allowedips = $wg0->prop('allowedips') || "0.0.0.0/0"; + + #here we guess wan IP + # are we server-gateway mode ? so external lan, should do +@@ -233,15 +234,20 @@ + # dig @resolver4.opendns.com myip.opendns.com +short -4 + # dig @resolver1.ipv6-sandbox.opendns.com AAAA myip.opendns.com +short -6 + ++#DNS ++my $IPAddress = $cdb->get('InternalInterface')->prop('IPAddress'); ++my $dns = ($allowedips =~ /0.0.0.0\/0/)? "DNS = $IPAddress" : "" ; ++ + + my $fulltext ="#configuration for $key $info + [Interface] + PrivateKey = $private + Address = $key ++$dns + + [Peer] + PublicKey = $ServPublic +-AllowedIPs = 0.0.0.0/0 ++AllowedIPs = $allowedips + Endpoint = $ExternalIP:$Port + "; + # we could add a DNS field in [Interface]