BLACK CAT PROGRAMMER

Connecting to OpenSwan VPN in Windows

Environment

A ipsec VPN was setup in a raspberry pi with OpenSwan.

Steps

Adding Server CA Certificate

  1. Download the server CA
  2. Import the server CA
    Start -> run -> enter “mmc”
  3. Add new snap
  4. Select Certificate on left menu and then click the Add button on the middle
  5. Select computer account**
    1. The popup may not appear and the cert will be imported to current user by default. The cert must be imported to local computer
    2. to do so. Start -> enter cmd
    3. Run the cmd with administrator
    4. enter certlm.msc
    5. go to step 8
  6. Select Local computer, them click finish button
  7. After clicking finish button, the popup window will be closed
  8. Back mmc Console window, there will be a new item Certificates on left menu
  9. Unfold Certificates -> Trusted Root Certification Authorities
  10. Right click on Certificates and click on All Tasks -> Import …
  11. A new window will be popped up. Select Local Machine if required
  12. Select the CA certificate just downloaded
  13. Once the CA certificate is added, it will appear under Trusted Root Certification Authorities
  14. Close mmc window without save
  15. Done

Adding VPN

  1. Open VPN setting by entering “vpn settings” start
  2. Click on “Add a VPN connection”
  3. Enter the form

    – Connection name is the name for you to identify the VPN
    – Server name or address: enter the domain or IP of the VPN server
    – VPN type: select IKEv2
    – Type of sign-in info: Select the appropriate sign in info
    – User name: VPN account name
    – Password: VPN account password
  4. Then back to VPN setting windows, click on “Change adapter options”
  5. On the new window, right click on the newly created VPN icon. Then click on “Properties”
  6. On security tab, config as following
  7. The other settings can be kept untouched
  8. Click Ok to close the window
  9. Done

Connect to VPN

  1. On VPN settings page, select the VPN
  2. Click on the Connect button

Common problems

parameter is incorrect

Solution: Reset and clear networking caches
Run windows cmd window (click windows start menu, type ‘cmd’, right click on ‘Command Prompt’ and select “Run as Administrator”).

type command below
netsh int ip reset
netsh int ipv6 reset
netsh winsock reset

Restart your computer.

Reset Device Manager adaptors
1. Open Device Manager
2. Find Network Adapters
3. Uninstall WAN Miniport drivers (IKEv2, IP, IPv6, etc)
4. Click Action > Scan for hardware changes
5. The adapters you just uninstalled should come back

Posted in notes, vpnTagged , ,