diff --git a/frontend/src/NetworkConfigManager.jsx b/frontend/src/NetworkConfigManager.jsx index 6d03f4b..ae4889e 100644 --- a/frontend/src/NetworkConfigManager.jsx +++ b/frontend/src/NetworkConfigManager.jsx @@ -671,17 +671,22 @@ function NetworkConfigManager() { code += `# Рекурсивный gateway: ${gw.ip}\n`; code += `# Родительский: ${parentLabel}\n`; + // Формируем gateway: для интерфейсов добавляем имя через %, для gateway - только IP + const gatewayValue = parent.parentType === 'interface' + ? `${parentIp}%${parent.name || parent.interfaceType || 'interface'}` + : parentIp; + // Создаём маршрут к IP рекурсивного gateway через родительский const comment = gw.description ? `${gw.description} -> ${parentIp}` : `Recursive: ${gw.ip} -> ${parentIp}`; - code += `/ip route add dst-address=${gw.ip}/32 gateway=${parentIp} comment="${comment}"\n`; + code += `/ip route add dst-address=${gw.ip}/32 gateway=${gatewayValue} comment="${comment}"\n`; // Если у рекурсивного gateway есть описание с указанием на default route if (gw.description && (gw.description.toLowerCase().includes('default') || gw.description.toLowerCase().includes('0.0.0.0'))) { code += `# Дополнительный default route через рекурсивный gateway\n`; const defaultComment = gw.description ? `${gw.description} (default)` : `Recursive default: ${gw.ip}`; - code += `/ip route add dst-address=0.0.0.0/0 gateway=${parentIp} comment="${defaultComment}"\n`; + code += `/ip route add dst-address=0.0.0.0/0 gateway=${gatewayValue} comment="${defaultComment}"\n`; } code += '\n'; }); @@ -860,7 +865,7 @@ function NetworkConfigManager() { {/* Items */} -
{gateway.ip || '—'}
-
- {gatewayType.label}
-
-
- {gateway.ip || '—'}
-
- {gateway.ip && (
-
- )}
- {displayIp}
+
{displayIp}
+
- {displayLocalIp}
- {displayLocalIp && displayLocalIp !== '—' && (
-
- )}
- {displayRemoteIp}
- {displayRemoteIp && displayRemoteIp !== '—' && (
-
- )}
-