I'm trying to reach a docker container, whose outgoing traffic is routed through vpn, over the remote ip of the server where the containers are running on. If i want to reach the squid server from the test environment attached below i have to use a reverse proxy. When i expose the ports on the vpn container without the reverse proxy, my requests are stuck without an answer because of openvpn's route 0.0.0.0/1 via 10.8.8.1 dev tun0
:
netstat #inside vpntcp 0 0 :::3128 :::* LISTENtcp 0 0 ::ffff:172.17.0.2:3128 ::ffff:{remote_ip}:49936 SYN_RECV
Which rules or routes do i have to add inside the vpn container to have a return route for specific ports via remote ip connections? Can this be achieved by a global rule for all connections coming from the servers remote ip without specifying every single open port? The rules shouldn't interfere with traffic from the attached containers which has to be routed over the vpn.
Thank you so much in advance!
version: "3.4"services: vpn: container_name: vpn image: dperson/openvpn-client cap_add: - net_admin volumes: - /dev/net:/dev/net:z - ./vpn.ovpn:/vpn/vpn.conf dns: - 1.1.1.1 #ports: # - "3128:3128" vpn_squid: image: sameersbn/squid volumes: - ./squid.conf:/etc/squid/squid.conf depends_on: - vpn network_mode: "service:vpn" tcp_proxy: container_name: tcp_proxy image: tecnativa/tcp-proxy environment: LISTEN: ":3128" TALK: "vpn:3128" ports: - "3128:3128"networks: default: