F5F Stay Refreshed Software Operating Systems Yes, you can configure your VPN as a separate network device outside the default setup.

Yes, you can configure your VPN as a separate network device outside the default setup.

Yes, you can configure your VPN as a separate network device outside the default setup.

L
Linkiechu
Member
145
10-25-2016, 07:12 PM
#1
I possess Docker containers on a Linux machine that I aim to connect via VPN. The optimal approach is to integrate your VPN as a network interface, allowing the containers to pass through it. (Using WireGuard) Updated July 11, 2024 by Champe21 Specification
L
Linkiechu
10-25-2016, 07:12 PM #1

I possess Docker containers on a Linux machine that I aim to connect via VPN. The optimal approach is to integrate your VPN as a network interface, allowing the containers to pass through it. (Using WireGuard) Updated July 11, 2024 by Champe21 Specification

N
NeeGrow
Junior Member
46
11-13-2016, 09:38 PM
#2
Depends on your paths. Standard routes usually send all traffic via VPN. You might adjust your VPN settings or alter routes once connected. VPNs act as all available connections.
N
NeeGrow
11-13-2016, 09:38 PM #2

Depends on your paths. Standard routes usually send all traffic via VPN. You might adjust your VPN settings or alter routes once connected. VPNs act as all available connections.

B
blondeminion
Senior Member
594
11-13-2016, 09:51 PM
#3
You can modify the config file to disable automatic VPN routing while keeping the VPN active by adjusting the settings that control traffic flow. Look for sections related to routing rules or tunneling preferences and set them to prioritize local connections instead of always tunneling through the VPN.
B
blondeminion
11-13-2016, 09:51 PM #3

You can modify the config file to disable automatic VPN routing while keeping the VPN active by adjusting the settings that control traffic flow. Look for sections related to routing rules or tunneling preferences and set them to prioritize local connections instead of always tunneling through the VPN.

D
DarklyThunder
Member
241
11-14-2016, 06:17 PM
#4
Yeah. You can have more than one gateway defined, and it's the "metric" that decides which of the gateways will be used first (in the case that more than one can reach the same network). In some nomenclature the "default gateway" is sometimes referred to as the "gateway of last resort" to push this point home. We used to control these things with the "route" command, but it's done with "ip route" now. You should be able to find somewhere in your VPN documentation on how set the metric of the gateway it provides, so it's not chosen unless specified. Yeah, I've messed with similar "network configs", using mask bits to route traffic from specific sources differently through the firewall, and even differently through the routing table*. But, I'm not familiar enough with docker and my gut feeling is there is an easier way provided by the way networking is provisioned to containers. *I was working with a "simulation" to help a guy setting it up in hardware. There was a specific reason not to use multiple vlans, which would be much easier.
D
DarklyThunder
11-14-2016, 06:17 PM #4

Yeah. You can have more than one gateway defined, and it's the "metric" that decides which of the gateways will be used first (in the case that more than one can reach the same network). In some nomenclature the "default gateway" is sometimes referred to as the "gateway of last resort" to push this point home. We used to control these things with the "route" command, but it's done with "ip route" now. You should be able to find somewhere in your VPN documentation on how set the metric of the gateway it provides, so it's not chosen unless specified. Yeah, I've messed with similar "network configs", using mask bits to route traffic from specific sources differently through the firewall, and even differently through the routing table*. But, I'm not familiar enough with docker and my gut feeling is there is an easier way provided by the way networking is provisioned to containers. *I was working with a "simulation" to help a guy setting it up in hardware. There was a specific reason not to use multiple vlans, which would be much easier.

A
AceBanshee
Member
63
11-19-2016, 07:52 AM
#5
Gluetun is a small Docker container that creates a tunnel, allowing you to direct traffic from other containers through it. It can also handle routing of external data, though this seems unnecessary for your use case. Learn more at https://github.com/qdm12/gluetun
A
AceBanshee
11-19-2016, 07:52 AM #5

Gluetun is a small Docker container that creates a tunnel, allowing you to direct traffic from other containers through it. It can also handle routing of external data, though this seems unnecessary for your use case. Learn more at https://github.com/qdm12/gluetun