[PR #718] [CLOSED] Add manual network interface configuration for multi-NIC Docker environments #20433

Closed
opened 2026-06-07 18:02:02 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/moghtech/komodo/pull/718
Author: @MP-Tool
Created: 8/7/2025
Status: Closed

Base: 1.18.5Head: dev-1-multi-nic


📝 Commits (5)

  • 6a126af Add iproute2 to debian-debs
  • 93a7540 feat: Add manual network interface configuration for multi-NIC support
  • 8aca0ef fix: Update internet interface handling for multi-NIC support
  • b152f02 refactor: Enhance error messages and logging in networking module
  • 40f6b08 refactor: Simplify command argument handling and enhance permission error logging in network configuration

📊 Changes

7 files changed (+313 additions, -1 deletions)

View changed files

📝 bin/core/debian-deps.sh (+1 -1)
📝 bin/core/src/config.rs (+1 -0)
📝 bin/core/src/main.rs (+1 -0)
bin/core/src/network/mod.rs (+282 -0)
📝 bin/core/src/startup.rs (+11 -0)
📝 client/core/rs/src/entities/config/core.rs (+12 -0)
📝 config/core.config.toml (+5 -0)

📄 Description

Problem

In Docker setups with multiple network interfaces, users cannot specify which interface should handle internet traffic, leading to unpredictable routing behavior. This causes problems when working with external hosted repositories. While Docker Compose version 2.32+ provides network interface priority gw_priority settings (which I recommend using bevor), some edge case scenarios require the ability to manually set the container interface for the default gateway.

Solution

Added internet_interface configuration allows manual specification of which network interface of the container should be used as the default gateway. The feature automatically detects Docker environments and configures the routing table to route internet traffic through the specified interface.

How it works:

  1. Validates the specified interface exists and is UP
  2. Discovers the gateway for the interface's network
  3. Sets the interface as the default route for internet traffic
  4. Provides clear error messages if privileges or configuration are missing

Usage

# config/core.config.toml
internet_interface = "eth1"
# docker-compose.yaml
services:
  core:
    cap_add: [NET_ADMIN]
    environment:
      KOMODO_INTERNET_INTERFACE: "eth1"

Changes

  • New: mod.rs - Network configuration module
  • Modified: Core config to support internet_interface field
  • Modified: Startup integration for network setup

Requirements

  • NET_ADMIN capability for Docker containers
  • iproute2 (injected by debian-deps.sh)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/moghtech/komodo/pull/718 **Author:** [@MP-Tool](https://github.com/MP-Tool) **Created:** 8/7/2025 **Status:** ❌ Closed **Base:** `1.18.5` ← **Head:** `dev-1-multi-nic` --- ### 📝 Commits (5) - [`6a126af`](https://github.com/moghtech/komodo/commit/6a126af1bd37d4e4313e5f8fcf877a1a0a8221c6) Add iproute2 to debian-debs - [`93a7540`](https://github.com/moghtech/komodo/commit/93a75404c18da22a28b1057e3d7545691ac530e1) feat: Add manual network interface configuration for multi-NIC support - [`8aca0ef`](https://github.com/moghtech/komodo/commit/8aca0ef96ddd4e2ab32c480ff89ee4696ad9903e) fix: Update internet interface handling for multi-NIC support - [`b152f02`](https://github.com/moghtech/komodo/commit/b152f02f779a225fae29e187dcba23ed92b04d60) refactor: Enhance error messages and logging in networking module - [`40f6b08`](https://github.com/moghtech/komodo/commit/40f6b08941ce2747f226ec5bd84defb816a08423) refactor: Simplify command argument handling and enhance permission error logging in network configuration ### 📊 Changes **7 files changed** (+313 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `bin/core/debian-deps.sh` (+1 -1) 📝 `bin/core/src/config.rs` (+1 -0) 📝 `bin/core/src/main.rs` (+1 -0) ➕ `bin/core/src/network/mod.rs` (+282 -0) 📝 `bin/core/src/startup.rs` (+11 -0) 📝 `client/core/rs/src/entities/config/core.rs` (+12 -0) 📝 `config/core.config.toml` (+5 -0) </details> ### 📄 Description # Problem In Docker setups with multiple network interfaces, users cannot specify which interface should handle internet traffic, leading to unpredictable routing behavior. This causes problems when working with external hosted repositories. While Docker Compose version `2.32+` provides network interface priority `gw_priority` settings (which I recommend using bevor), some edge case scenarios require the ability to manually set the container interface for the default gateway. # Solution Added `internet_interface` configuration allows manual specification of which network interface of the container should be used as the default gateway. The feature automatically detects Docker environments and configures the routing table to route internet traffic through the specified interface. ## How it works: 1. Validates the specified interface exists and is UP 2. Discovers the gateway for the interface's network 3. Sets the interface as the default route for internet traffic 4. Provides clear error messages if privileges or configuration are missing # Usage ``` # config/core.config.toml internet_interface = "eth1" ``` ``` # docker-compose.yaml services: core: cap_add: [NET_ADMIN] environment: KOMODO_INTERNET_INTERFACE: "eth1" ``` # Changes - New: mod.rs - Network configuration module - Modified: Core config to support internet_interface field - Modified: Startup integration for network setup # Requirements - `NET_ADMIN` capability for Docker containers - iproute2 (injected by debian-deps.sh) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-06-07 18:02:02 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/komodo#20433