Add fixed IP address to host veth interface

This commit is contained in:
Albrecht Lohofener
2024-04-09 07:31:32 +02:00
parent de5bad2afa
commit 67ffb3ae20
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ services:
#LAN_IF: "enx00e04d68033f" # Use this option to define a specific physical Ethernet interface
# Make LuCI OpenWrt web interface accessible via host LAN
#FORWARD_LUCI: "true"
FORWARD_LUCI: "true"
# USB passthrough
# Format <vendorID>:<productID> like 'lsusb' is given
+4
View File
@@ -64,6 +64,10 @@ attach_veth_if () {
# Create veth pair
nsenter --target 1 --uts --net --ipc --mount ip link add $VETH_IF_HOST type veth peer name $VETH_IF_CONTAINER
nsenter --target 1 --uts --net --ipc --mount ip link set $VETH_IF_HOST up
if [[ -z "${IS_U_OS_APP}" ]]; then
nsenter --target 1 --uts --net --ipc --mount ip addr add 172.31.1.2/24 dev $VETH_IF_HOST
fi
else
info "Virtual Ethernet interface $VETH_IF_HOST already exists. Assuming pairs is already created."
fi