Answers: <blockquote>
    <p>solutions is: <strong>OpenConnect Plugin</strong> </p>
  </blockquote>
  
  <p>See here: <a href="https://wiki.jenkins.io/display/JENKINS/OpenConnect+Plugin" rel="nofollow noreferrer">https://wiki.jenkins.io/display/JENKINS/OpenConnect+Plugin</a></p>
  
  <p>OR also you can use below method:</p>
  
  <p>On Linux (Debian based)</p>
  
  <pre><code>sudo apt-get install openconnect
  </code></pre>
  
  <p>Add the following lines to the bottom of /etc/sudoers (ubuntu configuration)</p>
  
  <pre><code>jenkins ALL=NOPASSWD:/usr/sbin/openconnect*
  jenkins ALL=NOPASSWD:/bin/kill*
  </code></pre>
  
  <p>Then you will get an option in the Jenkins run task called:</p>
  
  <pre><code>Connect to Cisco AnyConnect VPN
  </code></pre>
  
Answers: CC BY-SA 4.0
Answers: 2019-05-31T10:33:30.163Z
Answers: It seems the `OpenConnect Plugin` was removed from Jenkins's plugin repository.
Answers: walnut_salami
Answers: CC BY-SA 4.0
Answers: 2019-02-26T05:08:14.583Z
Answers: 2019-02-26T05:08:14.583Z
Answers: Subhash
Answers: <p>Using Jenkins to create its own network paths is either clever or crazy. Right now I am leaning toward crazy, and trying to justify this reaction.</p>
  
  <p>VPNs, particularly AnyConnect types, are normally maintained as infrastructure by network engineers and used for multiple uses. But it sounds like you want to deploy from inside your network to inside a customer network. Attaching a physical VPN between you is heavy-handed and likely to run into corporate road-blocks - if I've understood you correctly. Thinking of your problem as IoT causes me to suggest that you have your inside-customer device call up to the Cloud and pull down deployments, which you have staged in the Cloud. If your customer will give you an ingress port ( ours don't very often) you can have a two-way connection where the Cloud server pushes to the IoT device. But pull-only works well.</p>
  
  <p>You can establish a VPN from your IoT device to the Cloud, and in fact, most today would demand that this connection be encrypted in some way.</p>
  
Answers: CC BY-SA 4.0
Answers: 2019-02-26T00:31:44.697Z
Answers: 2019-02-26T00:31:44.697Z
Answers: John Fisher
Body: <p>I'm on a Windows Server and I want to have a pipeline project on Jenkins that basically does this:</p>
  
  <ul>
  <li>SVN update</li>
  <li>Build</li>
  <li>Deploy</li>
  </ul>
  
  <p>As the deploy target machine is on a different network, I want to know how to start a VPN connection before to do the deploy.</p>
  
  <p>Note: My general goal is to automate deployment to a server in a VPN. Currently the VPN is Cisco AnyConnect.</p>
  
Comments: CC BY-SA 3.0
Comments: 2018-02-07T11:49:45.437Z
Comments: Possible duplicate of [Jenkins job using VPN?](https://devops.stackexchange.com/questions/1818/jenkins-job-using-vpn)
Comments: storm
Comments: CC BY-SA 3.0
Comments: 2018-02-07T11:52:27.300Z
Comments: This plugin may help you https://wiki.jenkins.io/display/JENKINS/OpenConnect+Plugin
Comments: storm
Comments: CC BY-SA 3.0
Comments: 2018-02-07T11:57:50.740Z
Comments: I am using a Windows OS and this plugin is for Linux.
Comments: Guilherme Castro
Comments: CC BY-SA 3.0
Comments: 2018-02-07T12:03:42.987Z
Comments: I can't help you'll probably have to make your own script to connect to the target and deploy directly
Comments: storm
Comments: CC BY-SA 3.0
Comments: 2018-02-07T12:06:37.813Z
Comments: Is it possible to do that using another tool instead of jenkins ?
Comments: Guilherme Castro
Comments: CC BY-SA 3.0
Comments: 2018-02-07T12:15:26.203Z
Comments: Don't know really .. can't you just connect with ssh instead of VPN ?
Comments: storm
Comments: CC BY-SA 3.0
Comments: 2018-02-07T17:31:01.260Z
Comments: What is your reasoning for wanting to use a VPN? Are you blocked behind a firewall? Can you allow your remote machine to connect to Jenkins?
Comments: Preston Martin
Comments: CC BY-SA 3.0
Comments: 2018-02-08T11:38:34.187Z
Comments: Because the deploy target machine is on a different network, which is private from a client, and I would like to directly deploy in their server.
Comments: Guilherme Castro
Comments: CC BY-SA 3.0
Comments: 2018-02-09T12:27:35.173Z
Comments: A possible solution that I found is to create a .bat file to connect in VPN, after the Build and before the Deploy.
Comments: Guilherme Castro
Tags: <jenkins><deployment><jenkins-pipeline><vpn>
Title: How to start a VPN connection using Jenkins?
UserDisplayName: Guilherme Castro
ThreadText: # How to start a VPN connection using Jenkins?
  
  (Asked by: username_0 on 2018-02-07)
  
  I'm on a Windows Server and I want to have a pipeline project on Jenkins that basically does this:
  
  * SVN update
  * Build
  * Deploy
  
  As the deploy target machine is on a different network, I want to know how to start a VPN connection before to do the deploy.
  
  Note: My general goal is to automate deployment to a server in a VPN. Currently the VPN is Cisco AnyConnect.
  
  **Tags:** jenkins, deployment, jenkins-pipeline, vpn
  
  > **Comments:**
  > **username_1**: Possible duplicate of [Jenkins job using VPN?](https://devops.stackexchange.com/questions/1818/jenkins-job-using-vpn)  
  > **username_1**: This plugin may help you https://wiki.jenkins.io/display/JENKINS/OpenConnect+Plugin  
  > **username_0**: I am using a Windows OS and this plugin is for Linux.  
  > **username_1**: I can't help you'll probably have to make your own script to connect to the target and deploy directly  
  > **username_0**: Is it possible to do that using another tool instead of jenkins ?  
  > **username_1**: Don't know really .. can't you just connect with ssh instead of VPN ?  
  > **username_2**: What is your reasoning for wanting to use a VPN? Are you blocked behind a firewall? Can you allow your remote machine to connect to Jenkins?  
  > **username_0**: Because the deploy target machine is on a different network, which is private from a client, and I would like to directly deploy in their server.  
  > **username_0**: A possible solution that I found is to create a .bat file to connect in VPN, after the Build and before the Deploy.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_3 on 2019-02-26. Score: 2
  
  > solutions is: **OpenConnect Plugin**
  
  See here: <https://wiki.jenkins.io/display/JENKINS/OpenConnect+Plugin>
  
  OR also you can use below method:
  
  On Linux (Debian based)
  
  ```
  sudo apt-get install openconnect
  
  ```
  
  Add the following lines to the bottom of /etc/sudoers (ubuntu configuration)
  
  ```
  jenkins ALL=NOPASSWD:/usr/sbin/openconnect*
  jenkins ALL=NOPASSWD:/bin/kill*
  
  ```
  
  Then you will get an option in the Jenkins run task called:
  
  ```
  Connect to Cisco AnyConnect VPN
  
  ```
  
  > **Comments:**
  > **username_4**: It seems the `OpenConnect Plugin` was removed from Jenkins's plugin repository.  
  
  ---
  
  ### Answer by username_5 on 2019-02-26. Score: 0
  
  Using Jenkins to create its own network paths is either clever or crazy. Right now I am leaning toward crazy, and trying to justify this reaction.
  
  VPNs, particularly AnyConnect types, are normally maintained as infrastructure by network engineers and used for multiple uses. But it sounds like you want to deploy from inside your network to inside a customer network. Attaching a physical VPN between you is heavy-handed and likely to run into corporate road-blocks - if I've understood you correctly. Thinking of your problem as IoT causes me to suggest that you have your inside-customer device call up to the Cloud and pull down deployments, which you have staged in the Cloud. If your customer will give you an ingress port ( ours don't very often) you can have a two-way connection where the Cloud server pushes to the IoT device. But pull-only works well.
  
  You can establish a VPN from your IoT device to the Cloud, and in fact, most today would demand that this connection be encrypted in some way.
  
  
  ---
  
  