Set local IPSec VPN address

This commit is contained in:
Mykola Baibuz 2024-08-30 22:10:39 +03:00
parent f54308e4f4
commit 948ab4cf71

View file

@ -107,8 +107,10 @@ ErrorCode Ikev2Protocol::start()
m_routeGateway = iter->split("===", Qt::SkipEmptyParts).first(); m_routeGateway = iter->split("===", Qt::SkipEmptyParts).first();
m_routeGateway = m_routeGateway.split(" ").at(2); m_routeGateway = m_routeGateway.split(" ").at(2);
m_routeGateway = m_routeGateway.split("/").first(); m_routeGateway = m_routeGateway.split("/").first();
m_vpnLocalAddress = m_routeGateway;
qDebug() << "m_routeGateway " << m_routeGateway; qDebug() << "m_routeGateway " << m_routeGateway;
// killSwitch toggle // killSwitch toggle
if (QVariant(m_config.value(config_key::killSwitchOption).toString()).toBool()) { if (QVariant(m_config.value(config_key::killSwitchOption).toString()).toBool()) {
IpcClient::Interface()->enableKillSwitch(m_config, 0); IpcClient::Interface()->enableKillSwitch(m_config, 0);
@ -145,7 +147,6 @@ bool Ikev2Protocol::delete_vpn_connection(const QString &vpn_name) {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bool Ikev2Protocol::connect_to_vpn(const QString &vpn_name) { bool Ikev2Protocol::connect_to_vpn(const QString &vpn_name) {
IpcClient::Interface()->startIPsec(vpn_name); IpcClient::Interface()->startIPsec(vpn_name);
QThread::msleep(3000); QThread::msleep(3000);
return true; return true;
} }