rego-tunnel: share APP_DATA_DIR via /hostshare + fix compose.json env
Some checks failed
Test / test (push) Has been cancelled
Some checks failed
Test / test (push) Has been cancelled
This commit is contained in:
@@ -31,22 +31,24 @@ if [ -z "${WAN_IF}" ]; then
|
||||
WAN_IF="eth1"
|
||||
fi
|
||||
|
||||
# Create bridge if not exists
|
||||
# Ensure bridge exists
|
||||
if ! ip link show "$BRIDGE_NAME" &>/dev/null; then
|
||||
ip link add "$BRIDGE_NAME" type bridge
|
||||
ip addr add "$BRIDGE_CIDR" dev "$BRIDGE_NAME"
|
||||
ip link set "$BRIDGE_NAME" up
|
||||
echo "Bridge $BRIDGE_NAME created with IP $BRIDGE_CIDR"
|
||||
fi
|
||||
|
||||
# Create TAP device if not exists
|
||||
# Ensure bridge has address and is up
|
||||
ip addr show dev "$BRIDGE_NAME" | grep -qF "$BRIDGE_CIDR" || ip addr add "$BRIDGE_CIDR" dev "$BRIDGE_NAME" 2>/dev/null || true
|
||||
ip link set "$BRIDGE_NAME" up
|
||||
|
||||
# Ensure TAP exists
|
||||
if ! ip link show "$TAP_NAME" &>/dev/null; then
|
||||
ip tuntap add "$TAP_NAME" mode tap
|
||||
ip link set "$TAP_NAME" master "$BRIDGE_NAME"
|
||||
ip link set "$TAP_NAME" up
|
||||
echo "TAP device $TAP_NAME created and attached to $BRIDGE_NAME"
|
||||
fi
|
||||
|
||||
# Ensure TAP is attached and up
|
||||
ip link set "$TAP_NAME" master "$BRIDGE_NAME" 2>/dev/null || true
|
||||
ip link set "$TAP_NAME" up
|
||||
|
||||
# Enable IP forwarding
|
||||
echo 1 > /proc/sys/net/ipv4/ip_forward
|
||||
|
||||
|
||||
Reference in New Issue
Block a user