I'm installing an OpenVPN Docker container using docker-compose and I need to change the IP range from the default 172.17.0.0 to 192.168.1.x.
I tried adding to the /etc/docker/daemon.json file:
{
"bip": "192.168.1.5/24",
"fixed-cidr": "192.168.1.5/25",
"default-address-pools":[
{ "base":"192.168.2.5/24", "size":28 }
]
}
As explained here, but unfortunately, the problem remains.
I also tried modifying the docker-compose file as indicated here, but nothing changed. The range remains 127.17.x.x.
What can I do?
Here is the docker-compose file I used:
name: openvpn
services:
app:
cap_add:
- NET_ADMIN
cpu_shares: 90
command: []
container_name: OpenVPN
deploy:
resources:
limits:
memory: 15775M
environment:
- PGID=1000
- PUID=1000
hostname: OpenVPN
image: openvpn/openvpn-as:latest
labels:
icon: https://static-00.iconduck.com/assets.00/openvpn-icon-512x512-nmf6geqm.png
ports:
- target: 943
published: "1943"
protocol: tcp
- target: 443
published: "1443"
protocol: tcp
- target: 1194
published: "1194"
protocol: udp
privileged: true
restart: unless-stopped
volumes:
- type: bind
source: /DATA/AppData/openvpn/data
target: /openvpn
- type: bind
source: /DATA/AppData/openvpn/docker
target: /etc/docker
x-casaos:
ports:
- container: "943"
description:
en_us: "Container Port: 943"
- container: "443"
description:
en_us: "Container Port: 443"
- container: "1194"
description:
en_us: "Container Port: 1194"
volumes:
- container: /openvpn
description:
en_us: "Container Path: /openvpn"
devices: []
networks:
default:
driver: bridge
ipam:
driver: default
config:
- subnet: 192.168.0.0/16
x-casaos:
architectures:
- amd64
- arm64
author: null
category: Network
description:
en_us: OpenVPN is an open-source commercial software that implements virtual
private network (VPN) techniques to create secure point-to-point or
site-to-site connections in routed or bridged configurations and remote
access facilities.
developer: ""
hostname: ""
icon: https://static-00.iconduck.com/assets.00/openvpn-icon-512x512-nmf6geqm.png
index: /admin
is_uncontrolled: false
main: app
port_map: "1943"
scheme: https
store_app_id: openvpn
tagline:
en_us: OpenVPN is an open-source commercial software that implements virtual
private network (VPN).
thumbnail: ""
title:
custom: ""
en_us: OpenVPN