macOS Guide: This guide will walk you through connecting to PremierVPN using OpenConnect on macOS. OpenConnect is a secure, open-source VPN client compatible with Cisco AnyConnect protocols.

Prerequisites

Before getting started, ensure you have:

  • A Mac running macOS 10.12 (Sierra) or later
  • Administrator privileges on your Mac
  • An active PremierVPN account (sign up here if needed)
  • Your PremierVPN credentials from your Welcome Email
  • Internet connection

Available Server Locations

PremierVPN offers servers in multiple locations worldwide. Choose the server closest to you or the location you want to appear from:

Global Server List

Country/Region Server Address
Australia au.premiervpn.net
Brazil br.premiervpn.net
Canada ca.premiervpn.net
France fr.premiervpn.net
Germany de.premiervpn.net
India in.premiervpn.net
Israel isr.premiervpn.net
Japan jp.premiervpn.net
Mexico mx.premiervpn.net
Netherlands nl.premiervpn.net
Poland pl.premiervpn.net
Singapore sg.premiervpn.net
South Korea sk.premiervpn.net
Spain sp.premiervpn.net
Sweden sw.premiervpn.net
United Kingdom uk.premiervpn.net

United States Servers

Location Server Address
Kansas ks.premiervpn.net
New York ny.premiervpn.net
Santa Clara sc.premiervpn.net
Los Angeles la.premiervpn.net

Method 1: Using OpenConnect GUI (Recommended for Beginners)

Install Homebrew (if not already installed)

Homebrew is a package manager for macOS that makes installing applications easy.

  1. Open Terminal application:
    • Press Command + Space to open Spotlight Search
    • Type "Terminal" and press Enter
    • Or go to Applications → Utilities → Terminal
  2. Copy and paste this command into Terminal and press Enter:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  1. Follow the on-screen instructions
  2. You may be prompted to enter your Mac password (password won't be visible as you type)
  3. Wait for the installation to complete (may take several minutes)
Note: If you already have Homebrew installed, you can skip to Step 2.

Install OpenConnect GUI

Once Homebrew is installed, install the OpenConnect GUI application:

  1. In Terminal, run this command:
brew install --cask openconnect-gui
  1. Wait for the installation to complete (may take a few minutes)
  2. You may be prompted to enter your password again
  3. When complete, you'll see a confirmation message
Security Note: If macOS prevents OpenConnect from opening due to security settings, go to System Settings → Privacy & Security and click "Open Anyway" next to the OpenConnect message.

Launch OpenConnect GUI

  1. Open Spotlight Search (Command + Space)
  2. Type "OpenConnect"
  3. Click on OpenConnect-GUI to launch the application
  4. Alternatively, find it in your Applications folder

Create a New VPN Profile

  1. In the OpenConnect GUI window, click the + (Plus) button to create a new profile
  2. Fill in the profile details:
    • Name: Enter a descriptive name (e.g., "PremierVPN New York" or "PremierVPN UK")
    • Gateway: Enter your chosen server from the list above (e.g., ny.premiervpn.net or uk.premiervpn.net)
    • Certificate: Leave blank (not required)
  3. Leave all other settings at their default values
  4. Click Save to save the profile
Tip: Create multiple profiles for different server locations so you can easily switch between them.

Connect to PremierVPN

  1. Select your newly created profile from the list in OpenConnect GUI
  2. Click the Connect button
  3. When prompted, enter your PremierVPN Username
  4. Press Enter or click Next
  5. Enter your PremierVPN Password
  6. Press Enter or click OK
Success! Once connected, the OpenConnect GUI window will display "Connected" status along with connection details like your VPN IP address and connection duration.

Verify Your Connection

To confirm your VPN is working correctly:

  1. Open your web browser
  2. Visit noleak.net
  3. Verify that your IP address shows the location of the server you connected to
  4. Check that no DNS or IP leaks are detected

Method 2: Using OpenConnect Command Line (Advanced Users)

For Advanced Users: This method provides more control and is ideal for automation, scripting, or running VPN in the background. Requires comfort with Terminal commands.

Install OpenConnect via Homebrew

  1. Open Terminal application
  2. If you haven't installed Homebrew yet, follow Step 1 from Method 1 above
  3. Run this command to install OpenConnect:
brew install openconnect
  1. Wait for the installation to complete

Connect to PremierVPN Using Command Line

To connect to a PremierVPN server, use this command format:

sudo openconnect --protocol=anyconnect ny.premiervpn.net
Important: Replace ny.premiervpn.net with your preferred server from the server list above.

Command Breakdown:

  • sudo - Runs the command with administrator privileges (required for VPN connections)
  • openconnect - The OpenConnect VPN client
  • --protocol=anyconnect - Specifies the AnyConnect protocol
  • ny.premiervpn.net - The VPN server address

Enter Your Credentials

After running the command, you'll be prompted to authenticate:

  1. First, you'll be asked for your Mac password (for sudo access)
  2. Then, enter your PremierVPN Username and press Enter
  3. Enter your PremierVPN Password and press Enter
  4. The VPN connection will be established
Once connected, you'll see connection details in the Terminal window. The VPN will remain active as long as the Terminal window stays open.

Keep VPN Running

The VPN connection will stay active in the current Terminal window. To keep it running:

  • Do not close the Terminal window
  • Do not press Ctrl + C (this will disconnect)
  • You can minimize the Terminal window and continue working

Disconnect from VPN

To disconnect from the VPN:

  • Go to the Terminal window where OpenConnect is running
  • Press Ctrl + C
  • The VPN connection will terminate

Advanced: Creating a Connection Script

For convenience, you can create a script to connect to your preferred server quickly:

Step 1: Create the Script File

nano ~/vpn-connect.sh

Step 2: Add the Script Content

Copy and paste this into the nano editor (replace with your preferred server):

#!/bin/bash echo "Connecting to PremierVPN..." sudo openconnect --protocol=anyconnect ny.premiervpn.net

Step 3: Save the File

  • Press Ctrl + X to exit
  • Press Y to confirm saving
  • Press Enter to confirm the filename

Step 4: Make the Script Executable

chmod +x ~/vpn-connect.sh

Step 5: Run Your Script Anytime

Now you can connect to your VPN with a single command:

~/vpn-connect.sh

Advanced Command Line Options

Here are some useful OpenConnect flags you can add to your commands:

Flag Description Example
--user=USERNAME Specify username to skip manual entry --user=myusername
--background Run VPN in background --background
--reconnect-timeout=SECONDS Auto-reconnect if connection drops --reconnect-timeout=60
--verbose Show detailed connection logs --verbose
--pid-file=/path/to/file Save process ID to file (useful for scripting) --pid-file=/tmp/vpn.pid

Full Example with Multiple Flags:

sudo openconnect --protocol=anyconnect --user=myusername --reconnect-timeout=60 --background ny.premiervpn.net

Method 3: Using macOS Built-in VPN (Alternative)

Note: This method uses macOS's native VPN client. It's simpler but may have fewer features than OpenConnect.

Open Network Settings

  1. Click the Apple menu () in the top-left corner
  2. Select System Settings (macOS 13+) or System Preferences (older macOS)
  3. Click Network
  4. In the left sidebar, click the + button at the bottom to add a new connection

Create VPN Connection

In the dialog that appears, configure the following:

  • Interface: Select VPN
  • VPN Type: Select IKEv2
  • Service Name: Enter a descriptive name (e.g., "PremierVPN New York")

Click Create to continue.

Configure Server Settings

In the VPN configuration screen:

  • Server Address: Enter your chosen server from the list above (e.g., ny.premiervpn.net)
  • Remote ID: Enter the same server address
  • Local ID: Leave blank

Configure Authentication

  1. Click Authentication Settings... button
  2. Select Username as the authentication method
  3. Enter your PremierVPN Username
  4. Enter your PremierVPN Password
  5. Click OK to save authentication settings

Enable Menu Bar Access (Optional but Recommended)

  • Check the box for "Show VPN status in menu bar"
  • This allows you to quickly connect/disconnect from the menu bar

Connect to VPN

  1. Click Connect button in the Network settings
  2. Wait for the connection to establish
  3. Once connected, you'll see "Connected" status
Quick Access: If you enabled menu bar access, you can now click the VPN icon in your menu bar to quickly connect or disconnect.

Disconnect from VPN

To disconnect:

  • From Menu Bar: Click VPN icon → Click Disconnect
  • From Network Settings: Go to Network settings → Select your VPN → Click Disconnect

Verification and Testing

Verify Your VPN Connection

To verify your VPN is working properly:
  1. Open your web browser
  2. Visit noleak.net
  3. Confirm your IP address shows the location of the server you connected to
  4. Verify there are no DNS leaks or IP leaks detected
  5. All tests should show green checkmarks

Test Connection Speed

To check your VPN connection speed:

  1. Visit speedtest.net
  2. Click Go to start the speed test
  3. Compare results with your normal connection speed
  4. If speeds are significantly slower, try connecting to a different server location
Tip: Servers geographically closer to you typically provide faster speeds.

Managing Your VPN Connection

Disconnecting from VPN

OpenConnect GUI Method:

  1. Open the OpenConnect GUI application
  2. Click the Disconnect button
  3. The VPN will immediately disconnect

Command Line Method:

  1. Go to the Terminal window running OpenConnect
  2. Press Ctrl + C
  3. The VPN connection will terminate

macOS Native VPN Method:

  1. Click the VPN icon in your menu bar
  2. Click Disconnect
  3. Or go to Network settings and click Disconnect

Switching Servers

OpenConnect GUI Method:

  1. Disconnect from your current server
  2. Select a different profile from your saved profiles
  3. Or edit an existing profile to change the gateway
  4. Click Connect

Command Line Method:

  1. Disconnect (Press Ctrl + C)
  2. Run the connection command with a new server address
  3. Example: sudo openconnect --protocol=anyconnect uk.premiervpn.net

macOS Native VPN:

  1. Create multiple VPN profiles for different servers
  2. Switch between them from Network settings or menu bar

Auto-Reconnect

OpenConnect GUI:

  • In profile settings, enable "Auto-reconnect" option
  • VPN will automatically reconnect if connection drops

Command Line:

  • Add --reconnect-timeout=60 flag to your command
  • Example:
sudo openconnect --protocol=anyconnect --reconnect-timeout=60 ny.premiervpn.net

Connection on Startup

OpenConnect GUI:

  • Enable "Start minimized" and "Connect on start" in preferences
  • Add OpenConnect to Login Items in System Settings

macOS Native VPN:

  • In VPN settings, check "Connect on demand"
  • VPN will auto-connect when needed

Troubleshooting

Common Issues and Solutions

Connection Fails

Solutions:

  • Double-check your username and password
  • Verify you're using the correct server address
  • Try a different server location
  • Check your internet connection is working
  • Temporarily disable macOS Firewall (System Settings → Network → Firewall)
  • Ensure you're running OpenConnect with sudo (command line)
  • Restart your Mac and try again
Slow Connection Speeds

Solutions:

  • Connect to a server closer to your physical location
  • Try different server locations to find the fastest one
  • Close bandwidth-intensive applications
  • Restart your router/modem
  • Check if your ISP is throttling VPN connections
  • Test your base internet speed without VPN for comparison

DNS Leaks or IP Leaks

Solutions:

  • Flush DNS cache by running this command in Terminal:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
  • Change your DNS servers to:
    • Primary: 8.8.8.8
    • Secondary: 8.8.4.4
  • Disconnect and reconnect to VPN
  • Test again at noleak.net
Permission Denied Errors

Solutions:

  • Always use sudo with OpenConnect command line
  • Verify you have administrator privileges on your Mac
  • Check System Settings → Privacy & Security
  • Allow OpenConnect in Security settings if blocked
  • Make sure OpenConnect has Network Extension permissions

macOS-Specific Issues

Gatekeeper Blocking OpenConnect:

  • Go to System Settings → Privacy & Security
  • Scroll down to the Security section
  • Click "Open Anyway" next to the OpenConnect message
  • Confirm by clicking "Open" in the dialog

Network Extension Not Loading:

  • Restart your Mac after installing OpenConnect
  • Go to System Settings → Network
  • Remove and re-add the VPN connection
  • Try reinstalling OpenConnect: brew reinstall openconnect-gui

Homebrew Command Not Found:

  • Verify Homebrew is installed: brew --version
  • If not found, reinstall Homebrew using the command in Step 1
  • Add Homebrew to your PATH by running:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile eval "$(/opt/homebrew/bin/brew shellenv)"

Certificate Warnings:

  • If you see certificate warnings, they can usually be safely accepted for PremierVPN servers
  • OpenConnect will ask you to verify the certificate fingerprint
  • Type "yes" to accept and continue

Connection Drops Frequently:

  • Enable auto-reconnect in OpenConnect settings
  • Use the --reconnect-timeout=60 flag for command line
  • Check if your Mac is going to sleep (disable in Energy Saver settings)
  • Ensure "Prevent computer from sleeping automatically" is checked

Still Need Help?

If you continue experiencing issues after trying these solutions:

  1. Check our other knowledgebase articles for more specific troubleshooting
  2. Contact PremierVPN support with the following information:
    • Your macOS version (Click Apple menu → About This Mac)
    • Which connection method you're using (GUI, CLI, or native VPN)
    • The server address you're trying to connect to
    • Complete error messages (take a screenshot if possible)
    • What troubleshooting steps you've already tried
  3. Submit a support ticket through your client area with all relevant details

Security Best Practices

Keep Your VPN Secure and Optimized:

  • Always verify your connection - Visit noleak.net after connecting to confirm no leaks
  • Use kill switch features - Enable in OpenConnect GUI to prevent data leaks if VPN drops
  • Choose appropriate servers - Select servers close to you for speed, or in specific locations for geo-unblocking
  • Keep software updated - Regularly update OpenConnect with: brew upgrade openconnect
  • Never share credentials - Your VPN username and password are for your use only
  • Enable auto-reconnect - Prevents connection drops from leaving you unprotected
  • Use secure DNS - Configure 8.8.8.8 and 8.8.4.4 as your DNS servers
  • Monitor your connection - Check connection status regularly in menu bar or OpenConnect GUI
  • Create multiple profiles - Set up profiles for different servers for easy switching
  • Test after updates - Verify VPN works correctly after macOS updates

Quick Reference

Common Commands Cheat Sheet

Action Command
Install Homebrew /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Install OpenConnect GUI brew install --cask openconnect-gui
Install OpenConnect CLI brew install openconnect
Connect to VPN (CLI) sudo openconnect --protocol=anyconnect SERVERNAME.premiervpn.net
Connect with Auto-reconnect sudo openconnect --protocol=anyconnect --reconnect-timeout=60 SERVERNAME.premiervpn.net
Disconnect VPN (CLI) Press Ctrl + C in Terminal
Update OpenConnect brew upgrade openconnect
Flush DNS Cache sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
Check macOS Version sw_vers

You're All Set!

You now have everything you need to connect to PremierVPN on your Mac using OpenConnect. Choose the method that works best for you:

  • Beginners: Use OpenConnect GUI for the easiest experience
  • Advanced Users: Use Command Line for automation and control
  • Simple Setup: Use macOS Native VPN for basic needs

Need Additional Assistance?

Contact our support team through your client area or submit a support ticket for personalized help with your PremierVPN setup on macOS.

Ця відповідь Вам допомогла? 0 Користувачі, які знайшли це корисним (0 Голосів)