External docker container IP
Assumptions:
- first IP: 11.11.11.11 (ens0)
- second IP: 22.22.22.22 (ens0:0)
Verify network interfaces:
1 | curl --interface ens0 https://httpbin.org/ip |
Create network and routing:
1 | docker network create --attachable --opt 'com.docker.network.bridge.name=bridge-coi1' --opt 'com.docker.network.bridge.enable_ip_masquerade=false' bridge-coi1 |
Debug connection:
1 | docker run --rm byrnedo/alpine-curl -s https://httpbin.org/ip |
Example:
1 | docker run --rm -p 11.11.11.11:1080:1080 -e PROXY_USER=proxy_login -e PROXY_PASSWORD=proxy_pass serjs/go-socks5-proxy |
Use:
1 | curl -s -x socks5://proxy_login:proxy_pass@11.11.11.11:1080 https://httpbin.org/ip |
Recommendations