From 4f85d93c86d9bcec0fd49f36ef18a46e71c6e304 Mon Sep 17 00:00:00 2001 From: Lars The Date: Wed, 2 Oct 2024 19:26:46 +0200 Subject: [PATCH] LAN_IF "host" mode Make explicit the use of the networking as user mode for LAN_IF using "host". --- docker-compose.yml | 6 ++++-- src/run_openwrt.sh | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 1b58cd5..e5c4714 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,11 +18,13 @@ services: CPU_COUNT: 2 # Define which physical or virtual interfaces shall be attach direct to OpenWrt - # If WAN_IF is missing then "host" mode is selected + # If WAN_IF/LAN_IF is missing then "host" mode is selected + # - WAN_IF: "host" # Usage of container host Ethernet connection as WAN. WARNING: Bad performace because of user space Ethernet implementation. #WAN_IF: "none" # No WAN interface defined. This is useful if OpenWrt WAN acts a USB Wi-Fi client or as USB cellular modem #WAN_IF: "enx00e04c0407a6" # Use this option to define a specific physical Ethernet interface - + # - + #LAN_IF: "host" # Usage of container host Ethernet connection as LAN. WARNING: Bad performace because of user space Ethernet implementation. LAN_IF: "veth" # veth pair between OpenWrt and host system #LAN_IF: "enx00e04d68033f" # Use this option to define a specific physical Ethernet interface diff --git a/src/run_openwrt.sh b/src/run_openwrt.sh index ccd6689..cb5adf8 100755 --- a/src/run_openwrt.sh +++ b/src/run_openwrt.sh @@ -148,7 +148,7 @@ fi # Attach physical PHY to container LAN_ARGS="" -if [[ -z "${LAN_IF}" ]]; then +if [[ -z "${LAN_IF}" || $LAN_IF = "host" ]]; then LAN_ARGS="-device virtio-net,netdev=qlan0 -netdev user,id=qlan0,net=192.168.1.0/24" elif [[ $LAN_IF = "veth" ]]; then attach_veth_if veth-openwrt0 veth1 qlan1