How can I use openconnect in the background
I am going to connect to a VPN using openconnect on CEntOS 7 terminal. I only have one terminal because I am on a SSH session. I need to connect to the VPN using openconnect. I do so like this:
openconnect -u username us.myprovider.net
I need to run the VPN in the background and then do other things in the foreground. Currently, I start the VPN, I press Ctrl + Z and then press bg to send it to the background. But, this seems to close the VPN connection. How can I do that?
vpn cisco openconnect
add a comment |
I am going to connect to a VPN using openconnect on CEntOS 7 terminal. I only have one terminal because I am on a SSH session. I need to connect to the VPN using openconnect. I do so like this:
openconnect -u username us.myprovider.net
I need to run the VPN in the background and then do other things in the foreground. Currently, I start the VPN, I press Ctrl + Z and then press bg to send it to the background. But, this seems to close the VPN connection. How can I do that?
vpn cisco openconnect
add a comment |
I am going to connect to a VPN using openconnect on CEntOS 7 terminal. I only have one terminal because I am on a SSH session. I need to connect to the VPN using openconnect. I do so like this:
openconnect -u username us.myprovider.net
I need to run the VPN in the background and then do other things in the foreground. Currently, I start the VPN, I press Ctrl + Z and then press bg to send it to the background. But, this seems to close the VPN connection. How can I do that?
vpn cisco openconnect
I am going to connect to a VPN using openconnect on CEntOS 7 terminal. I only have one terminal because I am on a SSH session. I need to connect to the VPN using openconnect. I do so like this:
openconnect -u username us.myprovider.net
I need to run the VPN in the background and then do other things in the foreground. Currently, I start the VPN, I press Ctrl + Z and then press bg to send it to the background. But, this seems to close the VPN connection. How can I do that?
vpn cisco openconnect
vpn cisco openconnect
asked May 27 '18 at 10:56
codezombiecodezombie
181110
181110
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
According to the Openconnect documentation, the option you would want to try would be:
-b,--background
Continue in background after startup
add a comment |
Yes. -b is the option. But that just leads to the next issue. A clean disconnect then is not possible anymore. I mean, the only way to exit openconnect when it is in background is to kill the process. But that causes a name service problem. All dns requests are still sent to the name servers that were learned during the vpn establishment process, but they are not reachable anymore after disconnect. Only workaround is to shutdown the whole interface and take it up again.
add a comment |
Finally, I came up with this solution: Run openvpn
command to connect to server. Then, press CTRL+Z to stop it and then type bg
to make the stopped program continue in the background. To continue running the program in foreground, you have to type fg
and then you can disconnect VPN by pressing CTRL+C.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
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: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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%2funix.stackexchange.com%2fquestions%2f446301%2fhow-can-i-use-openconnect-in-the-background%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
According to the Openconnect documentation, the option you would want to try would be:
-b,--background
Continue in background after startup
add a comment |
According to the Openconnect documentation, the option you would want to try would be:
-b,--background
Continue in background after startup
add a comment |
According to the Openconnect documentation, the option you would want to try would be:
-b,--background
Continue in background after startup
According to the Openconnect documentation, the option you would want to try would be:
-b,--background
Continue in background after startup
answered May 27 '18 at 21:46
GracefulRestartGracefulRestart
1,10427
1,10427
add a comment |
add a comment |
Yes. -b is the option. But that just leads to the next issue. A clean disconnect then is not possible anymore. I mean, the only way to exit openconnect when it is in background is to kill the process. But that causes a name service problem. All dns requests are still sent to the name servers that were learned during the vpn establishment process, but they are not reachable anymore after disconnect. Only workaround is to shutdown the whole interface and take it up again.
add a comment |
Yes. -b is the option. But that just leads to the next issue. A clean disconnect then is not possible anymore. I mean, the only way to exit openconnect when it is in background is to kill the process. But that causes a name service problem. All dns requests are still sent to the name servers that were learned during the vpn establishment process, but they are not reachable anymore after disconnect. Only workaround is to shutdown the whole interface and take it up again.
add a comment |
Yes. -b is the option. But that just leads to the next issue. A clean disconnect then is not possible anymore. I mean, the only way to exit openconnect when it is in background is to kill the process. But that causes a name service problem. All dns requests are still sent to the name servers that were learned during the vpn establishment process, but they are not reachable anymore after disconnect. Only workaround is to shutdown the whole interface and take it up again.
Yes. -b is the option. But that just leads to the next issue. A clean disconnect then is not possible anymore. I mean, the only way to exit openconnect when it is in background is to kill the process. But that causes a name service problem. All dns requests are still sent to the name servers that were learned during the vpn establishment process, but they are not reachable anymore after disconnect. Only workaround is to shutdown the whole interface and take it up again.
answered Jan 18 at 9:05
forty2forty2
212
212
add a comment |
add a comment |
Finally, I came up with this solution: Run openvpn
command to connect to server. Then, press CTRL+Z to stop it and then type bg
to make the stopped program continue in the background. To continue running the program in foreground, you have to type fg
and then you can disconnect VPN by pressing CTRL+C.
add a comment |
Finally, I came up with this solution: Run openvpn
command to connect to server. Then, press CTRL+Z to stop it and then type bg
to make the stopped program continue in the background. To continue running the program in foreground, you have to type fg
and then you can disconnect VPN by pressing CTRL+C.
add a comment |
Finally, I came up with this solution: Run openvpn
command to connect to server. Then, press CTRL+Z to stop it and then type bg
to make the stopped program continue in the background. To continue running the program in foreground, you have to type fg
and then you can disconnect VPN by pressing CTRL+C.
Finally, I came up with this solution: Run openvpn
command to connect to server. Then, press CTRL+Z to stop it and then type bg
to make the stopped program continue in the background. To continue running the program in foreground, you have to type fg
and then you can disconnect VPN by pressing CTRL+C.
answered Jan 18 at 14:51
codezombiecodezombie
181110
181110
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- 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%2funix.stackexchange.com%2fquestions%2f446301%2fhow-can-i-use-openconnect-in-the-background%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