Asad Ali
Asad Ali

Reputation: 151

Docker: limit VPN to single container

My docker host has multiple network cards, though the same network

- Card1: 192.168.0.50

- Card2: 192.168.0.55

I am connecting to a VPN from container 1 but not from container 2.

Once VPN is connected on container 1 both containers have the new IP.

Is there a way to limit VPN to only single container and not affect the other ?

Upvotes: 1

Views: 882

Answers (1)

Asad Ali
Asad Ali

Reputation: 151

I was using --net host on the container which caused this issue, as the VPN was now active on host and all containers affected. OpenVPN just on a container without net host works perfectly fine.

Upvotes: 1

Related Questions