How to forward network traffic through Docker OpenVPN Client?How do I forward HTTP traffic from an OpenVPN...
How do I color the graph in datavisualization?
What should you do if you miss a job interview (deliberately)?
Start making guitar arrangements
Is it possible to put a rectangle as background in the author section?
How to explain what's wrong with this application of the chain rule?
Offered money to buy a house, seller is asking for more to cover gap between their listing and mortgage owed
Fear of getting stuck on one programming language / technology that is not used in my country
Are the IPv6 address space and IPv4 address space completely disjoint?
How should I respond when I lied about my education and the company finds out through background check?
Is it safe to use olive oil to clean the ear wax?
Creature in Shazam mid-credits scene?
Did arcade monitors have same pixel aspect ratio as TV sets?
Which one is correct as adjective “protruding” or “protruded”?
Is the U.S. Code copyrighted by the Government?
When a Cleric spontaneously casts a Cure Light Wounds spell, will a Pearl of Power recover the original spell or Cure Light Wounds?
Aragorn's "guise" in the Orthanc Stone
What was the exact wording from Ivanhoe of this advice on how to free yourself from slavery?
Question about the proof of Second Isomorphism Theorem
Is it better practice to read straight from sheet music rather than memorize it?
Create all possible words using a set or letters
Do Legal Documents Require Signing In Standard Pen Colors?
Is there a single word describing earning money through any means?
Calculating Wattage for Resistor in High Frequency Application?
Where does the bonus feat in the cleric starting package come from?
How to forward network traffic through Docker OpenVPN Client?
How do I forward HTTP traffic from an OpenVPN server to a machine on the same local network as the OpenVPN client?Forward one IP to a docker containerRoute IPv6 traffic through OpenVPNPing a openvpn client connected to a docker container from the host of the containerOpenVPN does not create routes inside dockerEnabling Bidirectional traffic over VPN with OpenVPN on AWSRoute traffic from AWS VPC through OpenVPNOpenVPN client on OpenWRT not routing traffic through VPN on Linksys WRT3200ACMRun openvpn inside docker and use as gateway for internet for other networked devicesRoute only SSH traffic through OpenVPN
My current setup is has a docker image running OpenVPN Client that connects to an Access Server in AWS. If i run the command:
docker exec <container-id> bash
I can get into the OpenVPN Container itself and can ping relevant IP's connected to the OpenVPN Server. My question is how would i tell the local machine(ubuntu) to forward all local traffic, say im just doing a ping from outside the container, to go through the Docker0 interface and through the OpenVPN Client?
I've tried setting up a webproxy but I believe setting up the webproxy was to help with other containers forwarding traffic to the OpenVPN container, whereas i need to forward traffic from the local machine.
ubuntu networking openvpn
bumped to the homepage by Community♦ 3 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
My current setup is has a docker image running OpenVPN Client that connects to an Access Server in AWS. If i run the command:
docker exec <container-id> bash
I can get into the OpenVPN Container itself and can ping relevant IP's connected to the OpenVPN Server. My question is how would i tell the local machine(ubuntu) to forward all local traffic, say im just doing a ping from outside the container, to go through the Docker0 interface and through the OpenVPN Client?
I've tried setting up a webproxy but I believe setting up the webproxy was to help with other containers forwarding traffic to the OpenVPN container, whereas i need to forward traffic from the local machine.
ubuntu networking openvpn
bumped to the homepage by Community♦ 3 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
My current setup is has a docker image running OpenVPN Client that connects to an Access Server in AWS. If i run the command:
docker exec <container-id> bash
I can get into the OpenVPN Container itself and can ping relevant IP's connected to the OpenVPN Server. My question is how would i tell the local machine(ubuntu) to forward all local traffic, say im just doing a ping from outside the container, to go through the Docker0 interface and through the OpenVPN Client?
I've tried setting up a webproxy but I believe setting up the webproxy was to help with other containers forwarding traffic to the OpenVPN container, whereas i need to forward traffic from the local machine.
ubuntu networking openvpn
My current setup is has a docker image running OpenVPN Client that connects to an Access Server in AWS. If i run the command:
docker exec <container-id> bash
I can get into the OpenVPN Container itself and can ping relevant IP's connected to the OpenVPN Server. My question is how would i tell the local machine(ubuntu) to forward all local traffic, say im just doing a ping from outside the container, to go through the Docker0 interface and through the OpenVPN Client?
I've tried setting up a webproxy but I believe setting up the webproxy was to help with other containers forwarding traffic to the OpenVPN container, whereas i need to forward traffic from the local machine.
ubuntu networking openvpn
ubuntu networking openvpn
asked Jul 17 '18 at 18:55
UtahUnixUtahUnix
11
11
bumped to the homepage by Community♦ 3 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 3 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You need to add routes from your host machine to the destinations you want to be forwarded via the OpenVPN tunnel so that they point to your Docker container IP address.
For example:
route add -net 192.168.1.0/24 gw 172.17.17.1
where 192.168.1.0/24
is the IP network you want to route via Docker container's local IP address 172.17.17.1
.
If you cannot control the routing of the machines at the other end of tunnel, you need to set up a reverse route on those machines. Another option is to set up NAT on the Docker container.
Whenever i tried to ping after adding the route its still not possible, is there a different route i should be adding?
– UtahUnix
Jul 17 '18 at 19:58
Did you use correct IP addresses? Did you add the corresponding reverse route on the destination machine you tried to ping to?
– Tero Kilkanen
Jul 18 '18 at 6:35
@TeroKilkanen What is the reverse rule?
– GuySoft
Dec 29 '18 at 1:02
If you have two networks, 192.168.0.0/24 (a) and 192.168.1.0/24 (b), where 192.168.0.1 and 192.168.1.1 are the routers. Then on network a, you need to have route192.168.1.0/24
via192.168.0.1
, and on network b,192.168.0.0/24
via192.168.1.1
. The latter one is the reverse rule.
– Tero Kilkanen
Dec 30 '18 at 23:15
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "2"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f922351%2fhow-to-forward-network-traffic-through-docker-openvpn-client%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You need to add routes from your host machine to the destinations you want to be forwarded via the OpenVPN tunnel so that they point to your Docker container IP address.
For example:
route add -net 192.168.1.0/24 gw 172.17.17.1
where 192.168.1.0/24
is the IP network you want to route via Docker container's local IP address 172.17.17.1
.
If you cannot control the routing of the machines at the other end of tunnel, you need to set up a reverse route on those machines. Another option is to set up NAT on the Docker container.
Whenever i tried to ping after adding the route its still not possible, is there a different route i should be adding?
– UtahUnix
Jul 17 '18 at 19:58
Did you use correct IP addresses? Did you add the corresponding reverse route on the destination machine you tried to ping to?
– Tero Kilkanen
Jul 18 '18 at 6:35
@TeroKilkanen What is the reverse rule?
– GuySoft
Dec 29 '18 at 1:02
If you have two networks, 192.168.0.0/24 (a) and 192.168.1.0/24 (b), where 192.168.0.1 and 192.168.1.1 are the routers. Then on network a, you need to have route192.168.1.0/24
via192.168.0.1
, and on network b,192.168.0.0/24
via192.168.1.1
. The latter one is the reverse rule.
– Tero Kilkanen
Dec 30 '18 at 23:15
add a comment |
You need to add routes from your host machine to the destinations you want to be forwarded via the OpenVPN tunnel so that they point to your Docker container IP address.
For example:
route add -net 192.168.1.0/24 gw 172.17.17.1
where 192.168.1.0/24
is the IP network you want to route via Docker container's local IP address 172.17.17.1
.
If you cannot control the routing of the machines at the other end of tunnel, you need to set up a reverse route on those machines. Another option is to set up NAT on the Docker container.
Whenever i tried to ping after adding the route its still not possible, is there a different route i should be adding?
– UtahUnix
Jul 17 '18 at 19:58
Did you use correct IP addresses? Did you add the corresponding reverse route on the destination machine you tried to ping to?
– Tero Kilkanen
Jul 18 '18 at 6:35
@TeroKilkanen What is the reverse rule?
– GuySoft
Dec 29 '18 at 1:02
If you have two networks, 192.168.0.0/24 (a) and 192.168.1.0/24 (b), where 192.168.0.1 and 192.168.1.1 are the routers. Then on network a, you need to have route192.168.1.0/24
via192.168.0.1
, and on network b,192.168.0.0/24
via192.168.1.1
. The latter one is the reverse rule.
– Tero Kilkanen
Dec 30 '18 at 23:15
add a comment |
You need to add routes from your host machine to the destinations you want to be forwarded via the OpenVPN tunnel so that they point to your Docker container IP address.
For example:
route add -net 192.168.1.0/24 gw 172.17.17.1
where 192.168.1.0/24
is the IP network you want to route via Docker container's local IP address 172.17.17.1
.
If you cannot control the routing of the machines at the other end of tunnel, you need to set up a reverse route on those machines. Another option is to set up NAT on the Docker container.
You need to add routes from your host machine to the destinations you want to be forwarded via the OpenVPN tunnel so that they point to your Docker container IP address.
For example:
route add -net 192.168.1.0/24 gw 172.17.17.1
where 192.168.1.0/24
is the IP network you want to route via Docker container's local IP address 172.17.17.1
.
If you cannot control the routing of the machines at the other end of tunnel, you need to set up a reverse route on those machines. Another option is to set up NAT on the Docker container.
answered Jul 17 '18 at 19:14
Tero KilkanenTero Kilkanen
20.5k22644
20.5k22644
Whenever i tried to ping after adding the route its still not possible, is there a different route i should be adding?
– UtahUnix
Jul 17 '18 at 19:58
Did you use correct IP addresses? Did you add the corresponding reverse route on the destination machine you tried to ping to?
– Tero Kilkanen
Jul 18 '18 at 6:35
@TeroKilkanen What is the reverse rule?
– GuySoft
Dec 29 '18 at 1:02
If you have two networks, 192.168.0.0/24 (a) and 192.168.1.0/24 (b), where 192.168.0.1 and 192.168.1.1 are the routers. Then on network a, you need to have route192.168.1.0/24
via192.168.0.1
, and on network b,192.168.0.0/24
via192.168.1.1
. The latter one is the reverse rule.
– Tero Kilkanen
Dec 30 '18 at 23:15
add a comment |
Whenever i tried to ping after adding the route its still not possible, is there a different route i should be adding?
– UtahUnix
Jul 17 '18 at 19:58
Did you use correct IP addresses? Did you add the corresponding reverse route on the destination machine you tried to ping to?
– Tero Kilkanen
Jul 18 '18 at 6:35
@TeroKilkanen What is the reverse rule?
– GuySoft
Dec 29 '18 at 1:02
If you have two networks, 192.168.0.0/24 (a) and 192.168.1.0/24 (b), where 192.168.0.1 and 192.168.1.1 are the routers. Then on network a, you need to have route192.168.1.0/24
via192.168.0.1
, and on network b,192.168.0.0/24
via192.168.1.1
. The latter one is the reverse rule.
– Tero Kilkanen
Dec 30 '18 at 23:15
Whenever i tried to ping after adding the route its still not possible, is there a different route i should be adding?
– UtahUnix
Jul 17 '18 at 19:58
Whenever i tried to ping after adding the route its still not possible, is there a different route i should be adding?
– UtahUnix
Jul 17 '18 at 19:58
Did you use correct IP addresses? Did you add the corresponding reverse route on the destination machine you tried to ping to?
– Tero Kilkanen
Jul 18 '18 at 6:35
Did you use correct IP addresses? Did you add the corresponding reverse route on the destination machine you tried to ping to?
– Tero Kilkanen
Jul 18 '18 at 6:35
@TeroKilkanen What is the reverse rule?
– GuySoft
Dec 29 '18 at 1:02
@TeroKilkanen What is the reverse rule?
– GuySoft
Dec 29 '18 at 1:02
If you have two networks, 192.168.0.0/24 (a) and 192.168.1.0/24 (b), where 192.168.0.1 and 192.168.1.1 are the routers. Then on network a, you need to have route
192.168.1.0/24
via 192.168.0.1
, and on network b, 192.168.0.0/24
via 192.168.1.1
. The latter one is the reverse rule.– Tero Kilkanen
Dec 30 '18 at 23:15
If you have two networks, 192.168.0.0/24 (a) and 192.168.1.0/24 (b), where 192.168.0.1 and 192.168.1.1 are the routers. Then on network a, you need to have route
192.168.1.0/24
via 192.168.0.1
, and on network b, 192.168.0.0/24
via 192.168.1.1
. The latter one is the reverse rule.– Tero Kilkanen
Dec 30 '18 at 23:15
add a comment |
Thanks for contributing an answer to Server Fault!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f922351%2fhow-to-forward-network-traffic-through-docker-openvpn-client%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown