fix(NetworkConfigManager): update GRE tunnel configuration to use DNS domain for remote address if available, improving flexibility in server address handling
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 1m33s
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 1m33s
This commit is contained in:
@@ -1433,8 +1433,8 @@ function NetworkConfigManager() {
|
|||||||
|
|
||||||
// Для GRE туннелей - создаем туннель, опционально с IPSec через ipsec-secret
|
// Для GRE туннелей - создаем туннель, опционально с IPSec через ipsec-secret
|
||||||
if (iface.type === 'GRE') {
|
if (iface.type === 'GRE') {
|
||||||
const remoteServerIp = iface.server2Info?.ip || iface.server2Name;
|
// Используем DNS домен для remote-address, если он есть, иначе IP
|
||||||
const localServerIp = server.ip || serverName;
|
const remoteAddress = iface.server2Info?.dns || iface.server2Info?.ip || iface.server2Name;
|
||||||
|
|
||||||
// Проверяем наличие пароля: ipsecPasswordId должен быть не пустым и пароль должен быть загружен
|
// Проверяем наличие пароля: ipsecPasswordId должен быть не пустым и пароль должен быть загружен
|
||||||
const hasIpsecPassword = iface.ipsecPasswordId &&
|
const hasIpsecPassword = iface.ipsecPasswordId &&
|
||||||
@@ -1445,12 +1445,12 @@ function NetworkConfigManager() {
|
|||||||
if (hasIpsecPassword) {
|
if (hasIpsecPassword) {
|
||||||
// GRE туннель с IPSec через ipsec-secret (автоматическая настройка)
|
// GRE туннель с IPSec через ipsec-secret (автоматическая настройка)
|
||||||
code += `# Создание GRE туннеля с IPSec (автоматическая настройка через ipsec-secret)\n`;
|
code += `# Создание GRE туннеля с IPSec (автоматическая настройка через ipsec-secret)\n`;
|
||||||
code += `/interface gre add name="${iface.interfaceName}" remote-address=${remoteServerIp} local-address=${localServerIp} keepalive=10s ipsec-secret="${iface.ipsecPassword}"\n`;
|
code += `/interface gre add name="${iface.interfaceName}" remote-address=${remoteAddress} keepalive=10s ipsec-secret="${iface.ipsecPassword}"\n`;
|
||||||
code += '\n';
|
code += '\n';
|
||||||
} else {
|
} else {
|
||||||
// GRE туннель без IPSec (голый GRE)
|
// GRE туннель без IPSec (голый GRE)
|
||||||
code += `# Создание GRE туннеля (без IPSec)\n`;
|
code += `# Создание GRE туннеля (без IPSec)\n`;
|
||||||
code += `/interface gre add name="${iface.interfaceName}" remote-address=${remoteServerIp} local-address=${localServerIp} keepalive=10s\n`;
|
code += `/interface gre add name="${iface.interfaceName}" remote-address=${remoteAddress} keepalive=10s\n`;
|
||||||
code += '\n';
|
code += '\n';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user