10 Commits

Author SHA1 Message Date
f99036c523 Merge branch 'beta' 2025-12-29 20:28:34 +01:00
3eadd41a00 Merge branch 'dev' into beta 2025-12-29 20:28:15 +01:00
8923f45356 Add routeset to win32 2025-12-29 19:33:57 +01:00
471224b043 Merge branch 'beta' - b0.3 2025-12-29 19:07:16 +01:00
cb0f674c52 Merge branch 'beta' - Version b0.1
macOS Support
2025-12-08 17:38:05 +01:00
33bbd7cce6 Merge branch 'beta' - Alpha 0.6
This version adds Dynamic IP assignment based on config.
2025-12-02 18:47:58 +01:00
f9c5c56a1b Merge branch 'beta'
This is the merge of version a0.5 into master.
This version adds general authentication of the client and server, and control of connection via key whitelisting.
Also added loading of keypairs via a config file system.
2025-11-28 19:31:01 +01:00
17dd504a7a Merge pull request 'First working alpha, version a0.4' (#7) from beta into master
Reviewed-on: #7
2025-11-18 20:09:11 +00:00
9f52bdd54c Merge pull request 'beta' (#4) from beta into master
Reviewed-on: #4
2025-11-10 15:58:29 +00:00
29e90938c5 Merge pull request 'beta - Update License' (#2) from beta into master
Reviewed-on: #2
2025-11-10 15:15:31 +00:00

View File

@@ -327,7 +327,15 @@ namespace ColumnLynx::Net {
); );
system(cmd); system(cmd);
#elif defined(_WIN32) #elif defined(_WIN32)
char cmd[256]; char cmd[512];
// Remove any persistent routes associated with this interface
snprintf(cmd, sizeof(cmd),
"netsh routing ip delete persistentroute all name=\"%s\"",
mIfName.c_str()
);
system(cmd);
// Reset to DHCP
snprintf(cmd, sizeof(cmd), snprintf(cmd, sizeof(cmd),
"netsh interface ip set address name=\"%s\" dhcp", "netsh interface ip set address name=\"%s\" dhcp",
mIfName.c_str() mIfName.c_str()
@@ -420,7 +428,11 @@ namespace ColumnLynx::Net {
uint32_t maskInt = (prefixLen == 0) ? 0 : (0xFFFFFFFF << (32 - prefixLen)); uint32_t maskInt = (prefixLen == 0) ? 0 : (0xFFFFFFFF << (32 - prefixLen));
mask = ipv4ToString(maskInt); mask = ipv4ToString(maskInt);
char cmd[256]; // Calculate network address from IP and mask
uint32_t networkInt = (clientIP & maskInt);
std::string network = ipv4ToString(networkInt);
char cmd[512];
// 1. Set the static IP + mask + gateway // 1. Set the static IP + mask + gateway
snprintf(cmd, sizeof(cmd), snprintf(cmd, sizeof(cmd),
@@ -436,6 +448,14 @@ namespace ColumnLynx::Net {
); );
system(cmd); system(cmd);
// 3. Add route for the VPN network to go through the TUN interface
// This is critical: tells Windows to send packets destined for the server/network through the TUN interface
snprintf(cmd, sizeof(cmd),
"netsh routing ip add persistentroute dest=%s/%d name=\"%s\" nexthopcfg=%s",
network.c_str(), prefixLen, mIfName.c_str(), gw.c_str()
);
system(cmd);
return true; return true;
#else #else
return false; return false;