openvpn client override default gateway for vpn severCorrect Network IP addressing if your users have ability to VPN inOpenVPN with two gateway and DNS serverOpenVPN doesn't use remote gateway by defaultOpenVPN client as gateway for other clientsOpenVPN client nslookup failure after disconnectopenvpn client restarts if default gateway is changedOpenVPN server sending bogus default gateway information to client?ubuntu network manager openvpn overwrites default routeOpenVPN needs a gateway parameter fo a --route optionApply OpenVPN gateway to a single interface
Why doesn't Iron Man's action affect this person in Endgame?
Is this possible when it comes to the relations of P, NP, NP-Hard and NP-Complete?
How do I adjust encounters to challenge my lycanthrope players without negating their cool new abilities?
How can we allow remote players to effectively interact with a physical tabletop battle-map?
Substring join or additional table, which is faster?
Why are solar panels kept tilted?
How do I identify the partitions of my hard drive in order to then shred them all?
Polynomial division: Is this trick obvious?
Is 12 minutes connection in Bristol Temple Meads long enough?
Can multiple outlets be directly attached to a single breaker?
Meaning of "work with shame"
AMPScript Lookup From Child Business Unit
Why does SSL Labs now consider CBC suites weak?
Would life always name the light from their sun "white"
Source of the Wildfire?
Single word that parallels "Recent" when discussing the near future
Motorola 6845 and bitwise graphics
Who commanded or executed this action in Game of Thrones S8E5?
Is there any way to adjust the damage type of the Eldritch Blast cantrip so that it does fire damage?
What was the ring Varys took off?
Why can't I share a one use code with anyone else?
How to not get blinded by an attack at dawn
Is there any good reason to write "it is easy to see"?
Segmentation fault when popping x86 stack
openvpn client override default gateway for vpn sever
Correct Network IP addressing if your users have ability to VPN inOpenVPN with two gateway and DNS serverOpenVPN doesn't use remote gateway by defaultOpenVPN client as gateway for other clientsOpenVPN client nslookup failure after disconnectopenvpn client restarts if default gateway is changedOpenVPN server sending bogus default gateway information to client?ubuntu network manager openvpn overwrites default routeOpenVPN needs a gateway parameter fo a --route optionApply OpenVPN gateway to a single interface
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
When openvpn
client connects to a vpn server it creates a route for server ip with old default gateway. How can I tell openvpn
not to use old default gateway but use my provided custom gateway ip.
I.e. when I have vpn server in another vpn network which is not default route on my machine.
openvpn
|
show 4 more comments
When openvpn
client connects to a vpn server it creates a route for server ip with old default gateway. How can I tell openvpn
not to use old default gateway but use my provided custom gateway ip.
I.e. when I have vpn server in another vpn network which is not default route on my machine.
openvpn
Please elaborate. Currently, I'm unable to understand what you would like to achieve.
– gf_
Dec 23 '16 at 15:26
@gf_ when I run openvpn it uses comman/sbin/route add -net [VPN_SERVER_IP] [OLD_DEFAULT_GATEWAY] 255.255.255.255
, right? so I need way to specify my own [OLD_DEFAULT_GATEWAY] value
– igor
Dec 23 '16 at 17:47
1
If you remove the old default gateway from your routing table when bringing up the first VPN, won't the second one use the default set by the first one? You should be able to use--redirect-gateway
without thedef1
flag (which preserves the old gateway), or write and run a script which has the same effect after the first VPN is brought up.
– user4556274
Dec 23 '16 at 18:10
@user4556274 I also don't want the first VPN to be default gateway. I just need it only for certain subnet.
– igor
Dec 25 '16 at 14:14
@kitty No, openvpn uses command/sbin/route add -net [VPN_SERVER_IP] [OLD_GATEWAY_FOR_VPN_SERVER_IP] 255.255.255.255
. So, while connecting to second vpn, if the vpnserver2 is routed through first VPN, then the correct route will automatically be added by openvpn.
– Tanmay
Dec 28 '16 at 11:47
|
show 4 more comments
When openvpn
client connects to a vpn server it creates a route for server ip with old default gateway. How can I tell openvpn
not to use old default gateway but use my provided custom gateway ip.
I.e. when I have vpn server in another vpn network which is not default route on my machine.
openvpn
When openvpn
client connects to a vpn server it creates a route for server ip with old default gateway. How can I tell openvpn
not to use old default gateway but use my provided custom gateway ip.
I.e. when I have vpn server in another vpn network which is not default route on my machine.
openvpn
openvpn
asked Dec 7 '16 at 17:59
igorigor
48128
48128
Please elaborate. Currently, I'm unable to understand what you would like to achieve.
– gf_
Dec 23 '16 at 15:26
@gf_ when I run openvpn it uses comman/sbin/route add -net [VPN_SERVER_IP] [OLD_DEFAULT_GATEWAY] 255.255.255.255
, right? so I need way to specify my own [OLD_DEFAULT_GATEWAY] value
– igor
Dec 23 '16 at 17:47
1
If you remove the old default gateway from your routing table when bringing up the first VPN, won't the second one use the default set by the first one? You should be able to use--redirect-gateway
without thedef1
flag (which preserves the old gateway), or write and run a script which has the same effect after the first VPN is brought up.
– user4556274
Dec 23 '16 at 18:10
@user4556274 I also don't want the first VPN to be default gateway. I just need it only for certain subnet.
– igor
Dec 25 '16 at 14:14
@kitty No, openvpn uses command/sbin/route add -net [VPN_SERVER_IP] [OLD_GATEWAY_FOR_VPN_SERVER_IP] 255.255.255.255
. So, while connecting to second vpn, if the vpnserver2 is routed through first VPN, then the correct route will automatically be added by openvpn.
– Tanmay
Dec 28 '16 at 11:47
|
show 4 more comments
Please elaborate. Currently, I'm unable to understand what you would like to achieve.
– gf_
Dec 23 '16 at 15:26
@gf_ when I run openvpn it uses comman/sbin/route add -net [VPN_SERVER_IP] [OLD_DEFAULT_GATEWAY] 255.255.255.255
, right? so I need way to specify my own [OLD_DEFAULT_GATEWAY] value
– igor
Dec 23 '16 at 17:47
1
If you remove the old default gateway from your routing table when bringing up the first VPN, won't the second one use the default set by the first one? You should be able to use--redirect-gateway
without thedef1
flag (which preserves the old gateway), or write and run a script which has the same effect after the first VPN is brought up.
– user4556274
Dec 23 '16 at 18:10
@user4556274 I also don't want the first VPN to be default gateway. I just need it only for certain subnet.
– igor
Dec 25 '16 at 14:14
@kitty No, openvpn uses command/sbin/route add -net [VPN_SERVER_IP] [OLD_GATEWAY_FOR_VPN_SERVER_IP] 255.255.255.255
. So, while connecting to second vpn, if the vpnserver2 is routed through first VPN, then the correct route will automatically be added by openvpn.
– Tanmay
Dec 28 '16 at 11:47
Please elaborate. Currently, I'm unable to understand what you would like to achieve.
– gf_
Dec 23 '16 at 15:26
Please elaborate. Currently, I'm unable to understand what you would like to achieve.
– gf_
Dec 23 '16 at 15:26
@gf_ when I run openvpn it uses comman
/sbin/route add -net [VPN_SERVER_IP] [OLD_DEFAULT_GATEWAY] 255.255.255.255
, right? so I need way to specify my own [OLD_DEFAULT_GATEWAY] value– igor
Dec 23 '16 at 17:47
@gf_ when I run openvpn it uses comman
/sbin/route add -net [VPN_SERVER_IP] [OLD_DEFAULT_GATEWAY] 255.255.255.255
, right? so I need way to specify my own [OLD_DEFAULT_GATEWAY] value– igor
Dec 23 '16 at 17:47
1
1
If you remove the old default gateway from your routing table when bringing up the first VPN, won't the second one use the default set by the first one? You should be able to use
--redirect-gateway
without the def1
flag (which preserves the old gateway), or write and run a script which has the same effect after the first VPN is brought up.– user4556274
Dec 23 '16 at 18:10
If you remove the old default gateway from your routing table when bringing up the first VPN, won't the second one use the default set by the first one? You should be able to use
--redirect-gateway
without the def1
flag (which preserves the old gateway), or write and run a script which has the same effect after the first VPN is brought up.– user4556274
Dec 23 '16 at 18:10
@user4556274 I also don't want the first VPN to be default gateway. I just need it only for certain subnet.
– igor
Dec 25 '16 at 14:14
@user4556274 I also don't want the first VPN to be default gateway. I just need it only for certain subnet.
– igor
Dec 25 '16 at 14:14
@kitty No, openvpn uses command
/sbin/route add -net [VPN_SERVER_IP] [OLD_GATEWAY_FOR_VPN_SERVER_IP] 255.255.255.255
. So, while connecting to second vpn, if the vpnserver2 is routed through first VPN, then the correct route will automatically be added by openvpn.– Tanmay
Dec 28 '16 at 11:47
@kitty No, openvpn uses command
/sbin/route add -net [VPN_SERVER_IP] [OLD_GATEWAY_FOR_VPN_SERVER_IP] 255.255.255.255
. So, while connecting to second vpn, if the vpnserver2 is routed through first VPN, then the correct route will automatically be added by openvpn.– Tanmay
Dec 28 '16 at 11:47
|
show 4 more comments
4 Answers
4
active
oldest
votes
Adding this two line to the Server Config File
will force all traffic to go through your VPN
push "redirect-gateway def1"
push "dhcp-option DNS 8.8.8.8"
1
sorry this is not what I'm asking :)
– igor
Dec 8 '16 at 11:04
I have two vpns and I want second vpn go through first vpn instead of going to real interface, which is default gateway
– igor
Dec 8 '16 at 11:06
I don't know how a client computer to have 2 openvpn connections at the same time but it is more likely to work if you use 2 different vpn services
– akgren_soar
Dec 8 '16 at 12:05
add a comment |
If you want to set a next-hop router for a specific subnet after both VPNs are established, use something like
ip -4 route add $DESTINATION_SUBNET via $NEXT_HOP dev $INTERFACE_NAME
for example
ip -4 route add 10.0.0.0/8 via 172.16.0.1 dev eth0
You don't need to modify either default gateway; the more specific route will be chosen over the default route.
that is exactly what I don't want to do - do something manually after establishing vpn connections. I want it to be inside openvpn client config file
– igor
Dec 25 '16 at 22:37
add a comment |
The redirect-gateway
option may or may not change the gateway for reaching the OpenVPN server, depending on the flags provided to it.
According to man page of openvpn
:
Option flags:
local -- Add the local flag if both OpenVPN servers are directly connected via a common subnet, such as with wireless. The local flag will cause step 1 above (Creation of a static route for the --remote address which forwards to the pre-existing default gateway) to be omitted.
So, just add a redirect-gateway local
option in client config file, to override the pushed option. This will cause openvpn
to just add a new default route, and not a specific route for the server. So the current route being used to connect to ther server will continue to be used.
If you want this behavior for all clients, edit the server config file and change the option push "redirect-gateway"
to push "redirect-gateway local"
.
add a comment |
I also don't want the first VPN to be default gateway. I just need it
only for certain subnet.
On the client side you can ignore any routes from vpn server with the following options
script-security 2
route-noexec
route-up setup-routing.sh
and configure your own routes with route-up script, that could be something like this
$ cat setup-routing.sh
#!/bin/bash
ip ro add 192.168.10.0/24 via $route_vpn_gateway
Where route_vpn_gateway is environment variable that points to the default gateway used by --route options, as specified in either the --route-gateway option or the second parameter to --ifconfig when --dev tun is specified.
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%2f819339%2fopenvpn-client-override-default-gateway-for-vpn-sever%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
Adding this two line to the Server Config File
will force all traffic to go through your VPN
push "redirect-gateway def1"
push "dhcp-option DNS 8.8.8.8"
1
sorry this is not what I'm asking :)
– igor
Dec 8 '16 at 11:04
I have two vpns and I want second vpn go through first vpn instead of going to real interface, which is default gateway
– igor
Dec 8 '16 at 11:06
I don't know how a client computer to have 2 openvpn connections at the same time but it is more likely to work if you use 2 different vpn services
– akgren_soar
Dec 8 '16 at 12:05
add a comment |
Adding this two line to the Server Config File
will force all traffic to go through your VPN
push "redirect-gateway def1"
push "dhcp-option DNS 8.8.8.8"
1
sorry this is not what I'm asking :)
– igor
Dec 8 '16 at 11:04
I have two vpns and I want second vpn go through first vpn instead of going to real interface, which is default gateway
– igor
Dec 8 '16 at 11:06
I don't know how a client computer to have 2 openvpn connections at the same time but it is more likely to work if you use 2 different vpn services
– akgren_soar
Dec 8 '16 at 12:05
add a comment |
Adding this two line to the Server Config File
will force all traffic to go through your VPN
push "redirect-gateway def1"
push "dhcp-option DNS 8.8.8.8"
Adding this two line to the Server Config File
will force all traffic to go through your VPN
push "redirect-gateway def1"
push "dhcp-option DNS 8.8.8.8"
answered Dec 8 '16 at 4:23
akgren_soarakgren_soar
4927
4927
1
sorry this is not what I'm asking :)
– igor
Dec 8 '16 at 11:04
I have two vpns and I want second vpn go through first vpn instead of going to real interface, which is default gateway
– igor
Dec 8 '16 at 11:06
I don't know how a client computer to have 2 openvpn connections at the same time but it is more likely to work if you use 2 different vpn services
– akgren_soar
Dec 8 '16 at 12:05
add a comment |
1
sorry this is not what I'm asking :)
– igor
Dec 8 '16 at 11:04
I have two vpns and I want second vpn go through first vpn instead of going to real interface, which is default gateway
– igor
Dec 8 '16 at 11:06
I don't know how a client computer to have 2 openvpn connections at the same time but it is more likely to work if you use 2 different vpn services
– akgren_soar
Dec 8 '16 at 12:05
1
1
sorry this is not what I'm asking :)
– igor
Dec 8 '16 at 11:04
sorry this is not what I'm asking :)
– igor
Dec 8 '16 at 11:04
I have two vpns and I want second vpn go through first vpn instead of going to real interface, which is default gateway
– igor
Dec 8 '16 at 11:06
I have two vpns and I want second vpn go through first vpn instead of going to real interface, which is default gateway
– igor
Dec 8 '16 at 11:06
I don't know how a client computer to have 2 openvpn connections at the same time but it is more likely to work if you use 2 different vpn services
– akgren_soar
Dec 8 '16 at 12:05
I don't know how a client computer to have 2 openvpn connections at the same time but it is more likely to work if you use 2 different vpn services
– akgren_soar
Dec 8 '16 at 12:05
add a comment |
If you want to set a next-hop router for a specific subnet after both VPNs are established, use something like
ip -4 route add $DESTINATION_SUBNET via $NEXT_HOP dev $INTERFACE_NAME
for example
ip -4 route add 10.0.0.0/8 via 172.16.0.1 dev eth0
You don't need to modify either default gateway; the more specific route will be chosen over the default route.
that is exactly what I don't want to do - do something manually after establishing vpn connections. I want it to be inside openvpn client config file
– igor
Dec 25 '16 at 22:37
add a comment |
If you want to set a next-hop router for a specific subnet after both VPNs are established, use something like
ip -4 route add $DESTINATION_SUBNET via $NEXT_HOP dev $INTERFACE_NAME
for example
ip -4 route add 10.0.0.0/8 via 172.16.0.1 dev eth0
You don't need to modify either default gateway; the more specific route will be chosen over the default route.
that is exactly what I don't want to do - do something manually after establishing vpn connections. I want it to be inside openvpn client config file
– igor
Dec 25 '16 at 22:37
add a comment |
If you want to set a next-hop router for a specific subnet after both VPNs are established, use something like
ip -4 route add $DESTINATION_SUBNET via $NEXT_HOP dev $INTERFACE_NAME
for example
ip -4 route add 10.0.0.0/8 via 172.16.0.1 dev eth0
You don't need to modify either default gateway; the more specific route will be chosen over the default route.
If you want to set a next-hop router for a specific subnet after both VPNs are established, use something like
ip -4 route add $DESTINATION_SUBNET via $NEXT_HOP dev $INTERFACE_NAME
for example
ip -4 route add 10.0.0.0/8 via 172.16.0.1 dev eth0
You don't need to modify either default gateway; the more specific route will be chosen over the default route.
answered Dec 25 '16 at 14:20
user4556274user4556274
22315
22315
that is exactly what I don't want to do - do something manually after establishing vpn connections. I want it to be inside openvpn client config file
– igor
Dec 25 '16 at 22:37
add a comment |
that is exactly what I don't want to do - do something manually after establishing vpn connections. I want it to be inside openvpn client config file
– igor
Dec 25 '16 at 22:37
that is exactly what I don't want to do - do something manually after establishing vpn connections. I want it to be inside openvpn client config file
– igor
Dec 25 '16 at 22:37
that is exactly what I don't want to do - do something manually after establishing vpn connections. I want it to be inside openvpn client config file
– igor
Dec 25 '16 at 22:37
add a comment |
The redirect-gateway
option may or may not change the gateway for reaching the OpenVPN server, depending on the flags provided to it.
According to man page of openvpn
:
Option flags:
local -- Add the local flag if both OpenVPN servers are directly connected via a common subnet, such as with wireless. The local flag will cause step 1 above (Creation of a static route for the --remote address which forwards to the pre-existing default gateway) to be omitted.
So, just add a redirect-gateway local
option in client config file, to override the pushed option. This will cause openvpn
to just add a new default route, and not a specific route for the server. So the current route being used to connect to ther server will continue to be used.
If you want this behavior for all clients, edit the server config file and change the option push "redirect-gateway"
to push "redirect-gateway local"
.
add a comment |
The redirect-gateway
option may or may not change the gateway for reaching the OpenVPN server, depending on the flags provided to it.
According to man page of openvpn
:
Option flags:
local -- Add the local flag if both OpenVPN servers are directly connected via a common subnet, such as with wireless. The local flag will cause step 1 above (Creation of a static route for the --remote address which forwards to the pre-existing default gateway) to be omitted.
So, just add a redirect-gateway local
option in client config file, to override the pushed option. This will cause openvpn
to just add a new default route, and not a specific route for the server. So the current route being used to connect to ther server will continue to be used.
If you want this behavior for all clients, edit the server config file and change the option push "redirect-gateway"
to push "redirect-gateway local"
.
add a comment |
The redirect-gateway
option may or may not change the gateway for reaching the OpenVPN server, depending on the flags provided to it.
According to man page of openvpn
:
Option flags:
local -- Add the local flag if both OpenVPN servers are directly connected via a common subnet, such as with wireless. The local flag will cause step 1 above (Creation of a static route for the --remote address which forwards to the pre-existing default gateway) to be omitted.
So, just add a redirect-gateway local
option in client config file, to override the pushed option. This will cause openvpn
to just add a new default route, and not a specific route for the server. So the current route being used to connect to ther server will continue to be used.
If you want this behavior for all clients, edit the server config file and change the option push "redirect-gateway"
to push "redirect-gateway local"
.
The redirect-gateway
option may or may not change the gateway for reaching the OpenVPN server, depending on the flags provided to it.
According to man page of openvpn
:
Option flags:
local -- Add the local flag if both OpenVPN servers are directly connected via a common subnet, such as with wireless. The local flag will cause step 1 above (Creation of a static route for the --remote address which forwards to the pre-existing default gateway) to be omitted.
So, just add a redirect-gateway local
option in client config file, to override the pushed option. This will cause openvpn
to just add a new default route, and not a specific route for the server. So the current route being used to connect to ther server will continue to be used.
If you want this behavior for all clients, edit the server config file and change the option push "redirect-gateway"
to push "redirect-gateway local"
.
answered Jan 1 '17 at 19:26
TanmayTanmay
18519
18519
add a comment |
add a comment |
I also don't want the first VPN to be default gateway. I just need it
only for certain subnet.
On the client side you can ignore any routes from vpn server with the following options
script-security 2
route-noexec
route-up setup-routing.sh
and configure your own routes with route-up script, that could be something like this
$ cat setup-routing.sh
#!/bin/bash
ip ro add 192.168.10.0/24 via $route_vpn_gateway
Where route_vpn_gateway is environment variable that points to the default gateway used by --route options, as specified in either the --route-gateway option or the second parameter to --ifconfig when --dev tun is specified.
add a comment |
I also don't want the first VPN to be default gateway. I just need it
only for certain subnet.
On the client side you can ignore any routes from vpn server with the following options
script-security 2
route-noexec
route-up setup-routing.sh
and configure your own routes with route-up script, that could be something like this
$ cat setup-routing.sh
#!/bin/bash
ip ro add 192.168.10.0/24 via $route_vpn_gateway
Where route_vpn_gateway is environment variable that points to the default gateway used by --route options, as specified in either the --route-gateway option or the second parameter to --ifconfig when --dev tun is specified.
add a comment |
I also don't want the first VPN to be default gateway. I just need it
only for certain subnet.
On the client side you can ignore any routes from vpn server with the following options
script-security 2
route-noexec
route-up setup-routing.sh
and configure your own routes with route-up script, that could be something like this
$ cat setup-routing.sh
#!/bin/bash
ip ro add 192.168.10.0/24 via $route_vpn_gateway
Where route_vpn_gateway is environment variable that points to the default gateway used by --route options, as specified in either the --route-gateway option or the second parameter to --ifconfig when --dev tun is specified.
I also don't want the first VPN to be default gateway. I just need it
only for certain subnet.
On the client side you can ignore any routes from vpn server with the following options
script-security 2
route-noexec
route-up setup-routing.sh
and configure your own routes with route-up script, that could be something like this
$ cat setup-routing.sh
#!/bin/bash
ip ro add 192.168.10.0/24 via $route_vpn_gateway
Where route_vpn_gateway is environment variable that points to the default gateway used by --route options, as specified in either the --route-gateway option or the second parameter to --ifconfig when --dev tun is specified.
answered Jan 13 '18 at 18:43
ALex_hhaALex_hha
5,69011832
5,69011832
add a comment |
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%2f819339%2fopenvpn-client-override-default-gateway-for-vpn-sever%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
Please elaborate. Currently, I'm unable to understand what you would like to achieve.
– gf_
Dec 23 '16 at 15:26
@gf_ when I run openvpn it uses comman
/sbin/route add -net [VPN_SERVER_IP] [OLD_DEFAULT_GATEWAY] 255.255.255.255
, right? so I need way to specify my own [OLD_DEFAULT_GATEWAY] value– igor
Dec 23 '16 at 17:47
1
If you remove the old default gateway from your routing table when bringing up the first VPN, won't the second one use the default set by the first one? You should be able to use
--redirect-gateway
without thedef1
flag (which preserves the old gateway), or write and run a script which has the same effect after the first VPN is brought up.– user4556274
Dec 23 '16 at 18:10
@user4556274 I also don't want the first VPN to be default gateway. I just need it only for certain subnet.
– igor
Dec 25 '16 at 14:14
@kitty No, openvpn uses command
/sbin/route add -net [VPN_SERVER_IP] [OLD_GATEWAY_FOR_VPN_SERVER_IP] 255.255.255.255
. So, while connecting to second vpn, if the vpnserver2 is routed through first VPN, then the correct route will automatically be added by openvpn.– Tanmay
Dec 28 '16 at 11:47