Routing in OpenVPN server to LAN in private subnet
I am new to networking and have an OpenVPN server running with tun interface on a headless Ubuntu Server 16.04 . I am trying to access my resources in my LAN remotely using the, openVPN service I have setup, in an office that is set behind another LAN which is the gateway to the WAN. So Router 1/Gateway has an address of 192.168.x.0
Router 2 which is the lead way to my private subnet is 192.168.x.1(All devices in this network have static IP's)
How do I configure my OpenVPN server to allow me to access my resources in the second LAN. I amnew to networking and have done alot of research, but feel like I'm missing some concepts that are disabling me from moving forward. I want to route instead of bridge like the OpenVPN website suggests for now. Do I configure the server.conf file on the server and if so how do route to the address specified above? Also do I do some port forwarding from router 1 to router 2 get the traffic over the VPN once enabled to route to my network. Right now my virtual machine network setting is on NAT and I would also like to know what is the best setting to accomplish my task. I have researched for about a week now and can't find anything clear enough to explain these concepts if someone could help please!
openvpn
add a comment |
I am new to networking and have an OpenVPN server running with tun interface on a headless Ubuntu Server 16.04 . I am trying to access my resources in my LAN remotely using the, openVPN service I have setup, in an office that is set behind another LAN which is the gateway to the WAN. So Router 1/Gateway has an address of 192.168.x.0
Router 2 which is the lead way to my private subnet is 192.168.x.1(All devices in this network have static IP's)
How do I configure my OpenVPN server to allow me to access my resources in the second LAN. I amnew to networking and have done alot of research, but feel like I'm missing some concepts that are disabling me from moving forward. I want to route instead of bridge like the OpenVPN website suggests for now. Do I configure the server.conf file on the server and if so how do route to the address specified above? Also do I do some port forwarding from router 1 to router 2 get the traffic over the VPN once enabled to route to my network. Right now my virtual machine network setting is on NAT and I would also like to know what is the best setting to accomplish my task. I have researched for about a week now and can't find anything clear enough to explain these concepts if someone could help please!
openvpn
add a comment |
I am new to networking and have an OpenVPN server running with tun interface on a headless Ubuntu Server 16.04 . I am trying to access my resources in my LAN remotely using the, openVPN service I have setup, in an office that is set behind another LAN which is the gateway to the WAN. So Router 1/Gateway has an address of 192.168.x.0
Router 2 which is the lead way to my private subnet is 192.168.x.1(All devices in this network have static IP's)
How do I configure my OpenVPN server to allow me to access my resources in the second LAN. I amnew to networking and have done alot of research, but feel like I'm missing some concepts that are disabling me from moving forward. I want to route instead of bridge like the OpenVPN website suggests for now. Do I configure the server.conf file on the server and if so how do route to the address specified above? Also do I do some port forwarding from router 1 to router 2 get the traffic over the VPN once enabled to route to my network. Right now my virtual machine network setting is on NAT and I would also like to know what is the best setting to accomplish my task. I have researched for about a week now and can't find anything clear enough to explain these concepts if someone could help please!
openvpn
I am new to networking and have an OpenVPN server running with tun interface on a headless Ubuntu Server 16.04 . I am trying to access my resources in my LAN remotely using the, openVPN service I have setup, in an office that is set behind another LAN which is the gateway to the WAN. So Router 1/Gateway has an address of 192.168.x.0
Router 2 which is the lead way to my private subnet is 192.168.x.1(All devices in this network have static IP's)
How do I configure my OpenVPN server to allow me to access my resources in the second LAN. I amnew to networking and have done alot of research, but feel like I'm missing some concepts that are disabling me from moving forward. I want to route instead of bridge like the OpenVPN website suggests for now. Do I configure the server.conf file on the server and if so how do route to the address specified above? Also do I do some port forwarding from router 1 to router 2 get the traffic over the VPN once enabled to route to my network. Right now my virtual machine network setting is on NAT and I would also like to know what is the best setting to accomplish my task. I have researched for about a week now and can't find anything clear enough to explain these concepts if someone could help please!
openvpn
openvpn
asked May 25 '17 at 1:56
JstackJstack
111
111
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
To access my LAN from my VPN server I added this line to server.conf
route add 192.168.1.0 mask 255.255.255.0 gw 192.168.1.2
192.168.1.2 is my server's static IP address from my router. You may have to modify the addresses based on your setup.
How do I direct traffic to my LAN with the private subnet though do I do port forwarding from the router the is the gateway to the WAN?
– Jstack
May 25 '17 at 4:04
how did you add this? it complains about the syntax
– Mohammed Noureldin
Jan 12 '18 at 17:58
That's a direct, correct copy of the line out of my server.conf . apt-cache policy openvpn gives me 2.3.10-1ubuntu2.1, perhaps you are running a different version.
– Organic Marble
Jan 12 '18 at 18:02
add a comment |
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
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%2faskubuntu.com%2fquestions%2f918634%2frouting-in-openvpn-server-to-lan-in-private-subnet%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
To access my LAN from my VPN server I added this line to server.conf
route add 192.168.1.0 mask 255.255.255.0 gw 192.168.1.2
192.168.1.2 is my server's static IP address from my router. You may have to modify the addresses based on your setup.
How do I direct traffic to my LAN with the private subnet though do I do port forwarding from the router the is the gateway to the WAN?
– Jstack
May 25 '17 at 4:04
how did you add this? it complains about the syntax
– Mohammed Noureldin
Jan 12 '18 at 17:58
That's a direct, correct copy of the line out of my server.conf . apt-cache policy openvpn gives me 2.3.10-1ubuntu2.1, perhaps you are running a different version.
– Organic Marble
Jan 12 '18 at 18:02
add a comment |
To access my LAN from my VPN server I added this line to server.conf
route add 192.168.1.0 mask 255.255.255.0 gw 192.168.1.2
192.168.1.2 is my server's static IP address from my router. You may have to modify the addresses based on your setup.
How do I direct traffic to my LAN with the private subnet though do I do port forwarding from the router the is the gateway to the WAN?
– Jstack
May 25 '17 at 4:04
how did you add this? it complains about the syntax
– Mohammed Noureldin
Jan 12 '18 at 17:58
That's a direct, correct copy of the line out of my server.conf . apt-cache policy openvpn gives me 2.3.10-1ubuntu2.1, perhaps you are running a different version.
– Organic Marble
Jan 12 '18 at 18:02
add a comment |
To access my LAN from my VPN server I added this line to server.conf
route add 192.168.1.0 mask 255.255.255.0 gw 192.168.1.2
192.168.1.2 is my server's static IP address from my router. You may have to modify the addresses based on your setup.
To access my LAN from my VPN server I added this line to server.conf
route add 192.168.1.0 mask 255.255.255.0 gw 192.168.1.2
192.168.1.2 is my server's static IP address from my router. You may have to modify the addresses based on your setup.
answered May 25 '17 at 2:01
Organic MarbleOrganic Marble
11.5k63459
11.5k63459
How do I direct traffic to my LAN with the private subnet though do I do port forwarding from the router the is the gateway to the WAN?
– Jstack
May 25 '17 at 4:04
how did you add this? it complains about the syntax
– Mohammed Noureldin
Jan 12 '18 at 17:58
That's a direct, correct copy of the line out of my server.conf . apt-cache policy openvpn gives me 2.3.10-1ubuntu2.1, perhaps you are running a different version.
– Organic Marble
Jan 12 '18 at 18:02
add a comment |
How do I direct traffic to my LAN with the private subnet though do I do port forwarding from the router the is the gateway to the WAN?
– Jstack
May 25 '17 at 4:04
how did you add this? it complains about the syntax
– Mohammed Noureldin
Jan 12 '18 at 17:58
That's a direct, correct copy of the line out of my server.conf . apt-cache policy openvpn gives me 2.3.10-1ubuntu2.1, perhaps you are running a different version.
– Organic Marble
Jan 12 '18 at 18:02
How do I direct traffic to my LAN with the private subnet though do I do port forwarding from the router the is the gateway to the WAN?
– Jstack
May 25 '17 at 4:04
How do I direct traffic to my LAN with the private subnet though do I do port forwarding from the router the is the gateway to the WAN?
– Jstack
May 25 '17 at 4:04
how did you add this? it complains about the syntax
– Mohammed Noureldin
Jan 12 '18 at 17:58
how did you add this? it complains about the syntax
– Mohammed Noureldin
Jan 12 '18 at 17:58
That's a direct, correct copy of the line out of my server.conf . apt-cache policy openvpn gives me 2.3.10-1ubuntu2.1, perhaps you are running a different version.
– Organic Marble
Jan 12 '18 at 18:02
That's a direct, correct copy of the line out of my server.conf . apt-cache policy openvpn gives me 2.3.10-1ubuntu2.1, perhaps you are running a different version.
– Organic Marble
Jan 12 '18 at 18:02
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- 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%2faskubuntu.com%2fquestions%2f918634%2frouting-in-openvpn-server-to-lan-in-private-subnet%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
