Skip to content

NIC starting up with configured IP rather than an automatic 169.x.x.x#212

Merged
micahmo merged 1 commit intomicahmo:mainfrom
PredatH0r:main
Mar 2, 2026
Merged

NIC starting up with configured IP rather than an automatic 169.x.x.x#212
micahmo merged 1 commit intomicahmo:mainfrom
PredatH0r:main

Conversation

@PredatH0r
Copy link
Copy Markdown
Contributor

  • bring up the network interface with the configured IP (by adding the [Interface] Address=... line to wg_server.config)

  • added WireGuardCommand.StripConfigFile() to remove WireGuard.exe specific settings from a config file which aren't supported by the wg.exe command (e.g. with "wg syncconf")

…e [Interface] Address=... line to wg_server.config)

- added WireGuardCommand.StripConfigFile() to remove WireGuard.exe specific settings from a config file which aren't supported by the wg.exe command (e.g. with "wg syncconf")
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates WireGuard server configuration generation and sync behavior so the tunnel starts with the configured interface IP (instead of an APIPA 169.x.x.x) while still allowing wg.exe syncconf to work by stripping unsupported config keys from the sync input.

Changes:

  • Enable emitting [Interface] Address=... for the server configuration.
  • Add WireGuardCommand.StripConfigFile() to remove wg.exe-unsupported settings (currently Address=) before wg syncconf.
  • Use a distinct *.tmp file for syncconf input to avoid modifying/overwriting the original config.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
WgServerforWindows/Models/ServerConfigurationPrerequisite.cs Syncconf now operates on a temporary *.tmp copy and strips unsupported keys before calling wg.exe.
WgServerforWindows/Models/ServerConfiguration.cs Server config now includes AddressProperty in the generated [Interface] section.
WgServerforWindows/Models/ClientConfigurationsPrerequisite.cs Same *.tmp + strip flow applied when client changes trigger a server syncconf update.
WgAPI/Commands/WireGuardCommand.cs Introduces StripConfigFile() helper to remove unsupported config directives for wg.exe usage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@micahmo
Copy link
Copy Markdown
Owner

micahmo commented Mar 2, 2026

Hey thanks a ton for the contribution!!

@micahmo micahmo merged commit 5d9c514 into micahmo:main Mar 2, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants