[DEV] add ipv4 forwarding
This commit is contained in:
parent
8b97c10ca0
commit
2f50498b3c
2
11_route_enable.conf
Normal file
2
11_route_enable.conf
Normal file
@ -0,0 +1,2 @@
|
||||
# Enable network forwarding
|
||||
net.ipv4.ip_forward=1
|
@ -27,6 +27,9 @@ EXPOSE 1194/udp
|
||||
|
||||
CMD ["ovpn_run"]
|
||||
|
||||
#ADD ./11_route_enable.conf /etc/sysctl.d/11_route_enable.conf
|
||||
#RUN sysctl -p /etc/sysctl.d/*
|
||||
|
||||
ADD ./bin /usr/local/bin
|
||||
RUN chmod a+x /usr/local/bin/*
|
||||
|
||||
|
@ -85,6 +85,13 @@ if [ -r "$OPENVPN/crl.pem" ]; then
|
||||
addArg "--crl-verify" "$OPENVPN/crl.pem"
|
||||
fi
|
||||
|
||||
|
||||
# If this fails, ensure the docker container is run with --privileged
|
||||
# Could be side stepped with `ip netns` madness to drop privileged flag
|
||||
echo "Enabling IPv4 Forwarding"
|
||||
sysctl -w net.ipv4.ip_forward=1 || echo "Failed to enable IPv4 forwarding"
|
||||
|
||||
|
||||
ip -6 route show default 2>/dev/null
|
||||
if [ $? = 0 ]; then
|
||||
echo "Enabling IPv6 Forwarding"
|
||||
|
@ -1,6 +1,7 @@
|
||||
version: '2'
|
||||
services:
|
||||
openvpn:
|
||||
privileged: true
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
build: .
|
||||
|
Loading…
x
Reference in New Issue
Block a user