The following tutorial shows how to access a BMC server from a desktop or mobile device via VPN. The configuration described below bridges remote access VPN sessions onto the same subnet as the servers. With this method, the edge server can be accessed from the VPN client side only via its public address.
Prerequisites
Log in to the BMC portal (if you are a new user, set up your account). At least one Linux-based BMC server with public and private IP addresses. VPN software of your choice.
Step 1: Install SoftEther Edge
1. Establish a connection over SSH with the server where you wish to install SoftEther edge.
2. Install the ansible package by running one of the following commands:
On Ubuntu:
sudo apt -y install ansibleCode language: Bash (bash)
On CentOS:
sudo yum -y install ansibleCode language: Bash (bash)
3. Install the softasap.sa-vpn-softether Ansible role from Ansible Galaxy:
sudo ansible-galaxy install softasap.sa-vpn-softetherCode language: Bash (bash)
4. Create a working directory:
mkdir softether && cd softetherCode language: Bash (bash)
5. In the newly created directory, create an ansible-playbook (vpn.yml) :
nano vpn.ymlCode language: Bash (bash)
6. Paste the following code for SoftEther VPN:
---
- hosts: localhost
vars:
roles:
- {
role: "softasap.sa-vpn-softether",
softether_init_script: "{{ playbook_dir }}/create_hub"
}Code language: YAML (yaml)
7. Find the adapter name and subnet for the backend private network by running the command:
ip addressCode language: Bash (bash)
Step 2: Configure SoftEther VPN
1. Create an initial script (create_hub) for configuring SoftEther VPN:
nano create_hubCode language: Bash (bash)
2. Paste the following code, which creates a virtual hub named vpn:
HubCreate vpn /PASSWORD:""
hub vpnCode language: plaintext (plaintext)
3. Bridge the virtual hub and physical adapter using the adapter name:
BridgeCreate vpn /DEVICE:bond0.1101 /TAP:FalseCode language: plaintext (plaintext)
4. Enable the Secure NAT feature for DHCP functionality:
SecureNatEnable
NatDisableCode language: plaintext (plaintext)
5. Assign the appropriate subnet in the DHCP parameters (according to the private network addressing collected in Step 6):
DhcpSet /START:10.0.0.200 /END:10.0.0.250 /MASK:255.255.255.0 /EXPIRE:7200 /GW:none /DNS:none /DNS2:none /DOMAIN:none /LOG:yes /PUSHROUTE:none
SecureNatHostSet /MAC:none /IP:10.0.0.253 /MASK:255.255.255.0Code language: plaintext (plaintext)
Note
This configuration places VPN sessions on the same private subnet as your BMC servers. Be sure to avoid overlapping addresses.
6. Generate a certificate for the VPN connection with your fully qualified domain name (FQDN):
ServerCertRegenerate vpn.yourdomain.com
ServerCertGet ./generated/cert.cerCode language: plaintext (plaintext)
Step 3: Enable VPN Support
Enable support for Windows SSTP VPN clients:
SstpEnable yesCode language: plaintext (plaintext)
Enable support for OpenVPN clients:
OpenVpnEnable yes /PORTS:1194
OpenVpnMakeConfig ./generated/openvpn_config.zipCode language: plaintext (plaintext)
Step 4: Define Users and Management Credentials
Define local VPN users:
UserCreate rauser /GROUP:none /REALNAME:none /NOTE:none
UserPasswordSet rauser /PASSWORD:sadigGjyt387Code language: plaintext (plaintext)
Define a SoftEther server management password:
ServerPasswordSet adskfnne44onkdasl
Note
Avoid leaving clear-text passwords in the init script in a production environment. The ones shown above are for illustrative purposes only.
Step 5: Install SoftEther VPN Server
The two created configuration files should look like this:
vpn.yml:
---
- hosts: localhost
vars:
roles:
- {
role: "softasap.sa-vpn-softether",
softether_init_script: "{{ playbook_dir }}/create_hub"
}Code language: YAML (yaml)
create_hub:
HubDelete DEFAULT
HubCreate vpn /PASSWORD:""
hub vpn
BridgeCreate vpn /DEVICE:bond0.1101 /TAP:False
SecureNatEnable
NatDisable
DhcpSet /START:10.0.0.200 /END:10.0.0.250 /MASK:255.255.255.0 /EXPIRE:7200 /GW:none /DNS:none /DNS2:none /DOMAIN:none /LOG:yes /PUSHROUTE:none
SecureNatHostSet /MAC:none /IP:10.0.0.253 /MASK:255.255.255.0
ServerCertRegenerate vpn.yourdomain.com
ServerCertGet ./generated/cert.cer
SstpEnable yes
OpenVpnEnable yes /PORTS:1194
OpenVpnMakeConfig ./generated/openvpn_config.zip
UserCreate rauser /GROUP:none /REALNAME:none /NOTE:none
UserPasswordSet rauser /PASSWORD:sadigGjyt387
ServerPasswordSet adskfnne44onkdaslCode language: plaintext (plaintext)
If required, change the:
- Dhcpset start and end range.
- SecureNatHostSet IP address parameters.
- ServerCertRegenerate domain.
Start the ansible-playbook to install and configure the SoftEther VPN server:
sudo ansible-playbook vpn.ymlCode language: Bash (bash)
The configured SoftEther VPN server is now ready to accept remote access client connections, allowing communication with backend server addresses within BMC.
Additional Configuration
For additional configuration options, use the SoftEther VPN Command Line Management Utility (vpncmd), which manages multiple edge VPN servers.
For example, to set the SoftEther server, you would run:
/opt/vpnserver/vpncmd localhost /SERVER /CMD:ServerPasswordSetCode language: Bash (bash)
To add VPN users, you would use the commands:
/opt/vpnserver/vpncmd localhost /SERVER /CMD:UserCreate
/opt/vpnserver/vpncmd localhost /SERVER /CMD:UserPasswordSetCode language: Bash (bash)
Note
You might also be interested in our in-depth guide, How to Install and Configure OpenVPN Access Server.
Configuring Windows Clients
Configure VPN clients on Windows using SoftEther or the native MS SSTP.
Option 1: SoftEther Method
1. Download the SoftEther client for Windows.
2. After downloading and installing SoftEther client, follow the steps below to connect to the Phoenix edge server:
- Select Add VPN Connection to open the new VPN properties.
- Provide the Setting Name.
- Enter the IP address, port number, and Virtual Hub Name.
- Provide the user authentication information for connecting to the VPN server by providing a User Name and Password.
- Click OK to confirm the setting properties.
Option 2: Windows SSTP Method
1. Download and install the certificate located on the SoftEther server in the path softether/generated/generated/cert.cer.
2. Once the Certificate window opens, click Install Certificate.
3. The Certificate Import Wizard appears. Select Current User for the Store Location, then click Next.
4. Next, configure the VPN endpoint on Windows. Open the VPN Settings and select Add a VPN.
5. Fill in the required information, making sure to select Windows (built-in) as the VPN provider and Secure Socket Tunneling Protocol (SSTP) as the VPN type.
6. Click Save to complete.
Configuring Ubuntu Clients
1. Install OpenVPN packages to use the OpenVPN client:
sudo apt install network-manager-openvpn network-manager-openvpn-gnome
2. After downloading and unzipping the openvpn_config.zip file, import the configuration:
- Open Settings and navigate to Network.
- Click the + sign to add a VPN to your network.
- Choose Import from file…
3. From the OpenVPN Sample Config package select the Phoenix edge OpenVPN remote access file. Click the Open button in the top right corner.
4. Provide the username and password for authentication. Click Add to continue.
5. Move to the IPv4 tab and select the setting Use this connection only for resources on its network. Click Apply.
Configuring macOS Clients
Use Tunnelblick to install the OpenVPN client on Mac:
1. Open Tunnelblick and select I have configuration files.
2. A window appears explaining how to install a configuration file.
3. Drag and drop the configuration file to the Tunnelblick icon located in the menu bar.
4. Connect to the newly added VPN by clicking on the Tunnelblick icon and selecing Connect phx-edge_openvpn_remote_access_l3.
5. Enter your VPN username and password. Then, click OK to log in.
Note
For all other platforms any OpenVPN client can be used.