Follow the steps below to learn how you can connect your BMC nodes to an on-premises data center, office, or remote site. This example uses the Phoenix and Ashburn BMC locations. However, you can set up a VPN connection between any of the phoenixNAP BMC locations.
This tutorial uses the following setup:
- Cisco ASA configuration to create a site-to-site IPsec VPN for the on-premises endpoint.
- strongSwan on the server side to establish the tunnel. The traffic described can flow from remote access clients to both BMC nodes, and from a remote office to both BMC nodes.
Note
The described setup does not cover remote access clients connecting through the BMC to the remote site/office.
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 (two BMC servers are required for a VPN between two locations). VPN software of your choice. A remote office firewall.
Step 1: Set Up BMC Nodes
Set up the BMC side by implementing Step 1 and Step 5 from Set Up Remote Access VPN to phoenixNAP BMC.
Step 2: Install strongSwan
On the on-premises endpoint, SSH to the edge server and install the strongSwan package:
- For Ubuntu:
sudo apt -y install strongswanCode language: Bash (bash)
- For CentOS:
sudo yum -y install strongswanCode language: Bash (bash)
Depending on the distribution, configuration files will be located in different paths.
- On Ubuntu you can find it in: /etc/ipsec.*
- On CentOS, the configuration file is located in: /etc/strongswan/ipsec.*
Step 3: Configure Edge Server in Phoenix
1. Edit the IPsec configuration file on the edge server at the Phoenix location:
#####Mandatory part of configuration setup#####
config setup
# strictcrlpolicy - Defines if a fresh CRL must be available in order for the peer authentication based on RSA signatures to succeed.
strictcrlpolicy=no
# uniqueids - Defines whether a particular participant ID must be kept unique, with any new IKE_SA using an ID deemed to replace all old ones using that ID.
uniqueids = yes
# charondebug - Defines how much charon debugging output must be logged.
charondebug = "all"
conn vpn-to-asa
#####Per VPN configuration settings#####
# conn <name> - Defines a connection.
authby=secret
# authby - Defines how the peers must authenticate; acceptable values are secret or psk, pubkey, rsasig, ecdsasig.
left=%defaultroute
# left - Defines the IP address of the strongSwan's interface paricipating in the tunnel.
leftid=131.153.142.202
# leftid - Defines the identity payload for the strongSwan.
leftsubnet=10.0.0.0/24
# leftsubnet - Defines the private subnet behind the strongSwan, expressed as network/netmask.
right=185.28.188.0
# right - Defines the public IP address of the VPN peer.
rightid=192.168.0.254
# rightid - Defines the identity payload for the VPN peer.
rightsubnet=192.168.1.0/24
# rightsubnet - Defines the private subnet behind the VPN peer, expressed as network/netmask.
ike=aes256-sha1-modp1536
# ike - Defines the IKE/ISAKMP SA encryption/authentication algorithms. You can add a comma-separated list.
esp=aes256-sha1
# esp - Defines the ESP encryption/authentication algorithms. You can add a comma-separated list
keyingtries=%forever
# keyingtries - Defines the number of attempts that must be made to negotiate a connection.
leftauth=psk
rightauth=psk
keyexchange=ikev1
ikelifetime=1h
# ikelifetime - Defines the duration of an established phase-1 connection.
lifetime=8h
dpddelay=30
# dpddelay - Defines the time interval with which R_U_THERE messages/INFORMATIONAL exchanges are sent to the peer.
dpdtimeout=120
# dpdtimeout - Defines the timeout interval, after which all connections to a peer are deleted in case of inactivity.
dpdaction=restart
# dpdaction - Defines what action needs to be performed on DPD timeout. Takes three values as paramters : clear, hold, and restart.
auto=start
# auto - Defines what operation, if any, must be done automatically at IPsec startup (start loads a connection and brings it up immediately).
Code language: Properties (properties)
2. The IPSec pre-shared key is stored in a separate file: /etc/strongswan/ipsec.secrets
131.153.142.202 185.28.188.0 : PSK "ksdbk78823kdcs92kwehsfkphx"Code language: plaintext (plaintext)
3. Create strongSwan configs files (ipsec.conf and ipsec.secrets) after changing the necessary parameters. Use the following configuration:
sudo cat <<EOF > /etc/strongswan/ipsec.conf
# mandatory configuration
config setup
strictcrlpolicy=no
uniqueids = yes
charondebug = "all"
# VPN to Cisco ASA
conn vpn-to-asa
authby=secret
left=%defaultroute
leftid=131.153.142.202
leftsubnet=10.0.0.0/24
right=185.28.188.0
rightid=192.168.0.254
rightsubnet=192.168.1.0/24
ike=aes256-sha1-modp1536
esp=aes256-sha1
keyingtries=%forever
leftauth=psk
rightauth=psk
keyexchange=ikev1
ikelifetime=1h
lifetime=8h
dpddelay=30
dpdtimeout=120
dpdaction=restart
auto=start
EOFCode language: Bash (bash)
And:
sudo cat <<EOT > /etc/strongswan/ipsec.secrets
131.153.142.202 185.28.188.0 : PSK "ksdbk78823kdcs92kwehsfkphx"
EOTCode language: Bash (bash)
4. To avoid possible problems with SELinux, execute the following commands on the CentOS edge server:
sudo /sbin/restorecon -R -v /etc/strongswan/ipsec.conf
sudo setsebool -P daemons_use_tty 1Code language: Bash (bash)
5. Start the strongSwan service in Phoenix:
sudo systemctl enable --now strongswanCode language: Bash (bash)
Step 4: Configure Edge Server in Ashburn
In this example, the edge server OS in Ashburn is Ubuntu (not mandatory). Configuration files will be on a different path.
1. After changing the necessary parameters, paste the following lines to the edge server at the Ashburn location:
sudo cat <<EOF > /etc/ipsec.conf
# mandatory configuration
config setup
strictcrlpolicy=no
uniqueids = yes
charondebug = "all"
# VPN to Cisco ASA
conn vpn-to-asa
authby=secret
left=%defaultroute
leftid=131.153.155.210
leftsubnet=10.1.0.0/24
right=185.28.188.0
rightid=192.168.0.254
rightsubnet=192.168.1.0/24
ike=aes256-sha1-modp1536
esp=aes256-sha1
keyingtries=%forever
leftauth=psk
rightauth=psk
keyexchange=ikev1
ikelifetime=1h
lifetime=8h
dpddelay=30
dpdtimeout=120
dpdaction=restart
auto=start
EOFCode language: Bash (bash)
And:
sudo cat <<EOT > /etc/ipsec.secrets
131.153.155.210 185.28.188.0 : PSK "ksdbk78823kdcs92kwehsfkash"
EOTCode language: Bash (bash)
2. Start the strongSwan service on Ashburn:
sudo systemctl enable --now strongswanCode language: Bash (bash)
Step 5: Add Static Routes
Add static routes on the edge servers to enable communication with the on-premises data center, office, or remote site.
CentOS-Specific Static Routes
The following configuration applies to CentOS servers.
Phoenix side BMC servers
Add a static route on the server by running:
sudo ip route add 192.168.1.0/24 via 10.0.0.11 dev bond0.1101Code language: Bash (bash)
To make the routes persistent, add the following information to the network configuration file /etc/cloud/cloud.cfg.d/50-curtin-networking.cfg:
type: vlan
mtu: 9000
name: bond0.1101
vlan_id: 1101
vlan_link: bond0
subnets:
- address: 10.0.0.12/24
type: static
routes:
- gateway: 10.0.0.11
network: 192.168.1.0/24Code language: YAML (yaml)
Ashburn side BMC servers
Add a static route on the server by running:
sudo ip route add 192.168.1.0/24 via 10.1.0.11 dev bond0.1100Code language: Bash (bash)
Make the routes persistent by adding a routes section to the file /etc/cloud/cloud.cfg.d/50-curtin-networking.cfg:
type: vlan
mtu: 9000
name: bond0.1100
vlan_id: 1100
vlan_link: bond0
subnets:
- address: 10.1.0.12/24
type: static
routes:
- gateway: 10.1.0.11
network: 192.168.1.0/24Code language: YAML (yaml)
Ubuntu-Specific Static Routes
Use the following configuration on Ubuntu servers.
Phoenix side BMC servers
Add a static route on the server by running:
sudo ip route add 192.168.1.0/24 via 10.0.0.11 dev bond0.1101Code language: Bash (bash)
To make the routes persistent, add the following information to the network configuration file /etc/cloud/cloud.cfg.d/50-curtin-networking.cfg:
bond0.1101:
addresses:
- 10.0.0.12/24
id: 1101
link: bond0
mtu: 9000
routes:
- to: 192.168.1.0/24
via: 10.0.0.11Code language: YAML (yaml)
Ashburn side BMC servers
Add a static route on the server by running:
sudo ip route add 192.168.1.0/24 via 10.1.0.11 dev bond0.1100Code language: Bash (bash)
Make the routes persistent by adding a routes section to the file /etc/cloud/cloud.cfg.d/50-curtin-networking.cfg:
bond0.1100:
addresses:
- 10.1.0.12/24
id: 1100
link: bond0
mtu: 9000
routes:
- to: 192.168.1.0/24
via: 10.1.0.11Code language: YAML (yaml)
Step 6: Configure Cisco ASA Firewall
The final step includes an on-premises Cisco ASA firewall IPSec configuration. Your actual configuration may vary:
name 131.153.142.202 PHX-VPN-PEER
name 131.153.155.210 ASH-VPN-PEER
object-group network PHX-VPN-REMOTE
network-object 10.0.0.0 255.255.255.0
object-group network ASH-VPN-REMOTE
network-object 10.1.0.0 255.255.255.0
object-group network PHX-VPN-LOCAL
network-object 192.168.1.0 255.255.255.0
object-group network ASH-VPN-LOCAL
network-object 192.168.1.0 255.255.255.0
!
access-list PHXl2l_acl extended permit ip object-group PHX-VPN-LOCAL object-group PHX-VPN-REMOTE
access-list ASHl2l_acl extended permit ip object-group ASH-VPN-LOCAL object-group ASH-VPN-REMOTE
nat (inside,outside) source static PHX-VPN-LOCAL PHX-VPN-LOCAL destination static PHX-VPN-REMOTE PHX-VPN-REMOTE no-proxy-arp
nat (inside,outside) source static ASH-VPN-LOCAL ASH-VPN-LOCAL destination static ASH-VPN-REMOTE ASH-VPN-REMOTE no-proxy-arp
!
crypto ikev1 policy 10
authentication pre-share
encryption aes-256
hash sha
group 5
lifetime 3600
!
crypto ipsec ikev1 transform-set ESP-AES-256-SHA esp-aes-256 esp-sha-hmac
crypto map outside_map 10 match address PHXl2l_acl
crypto map outside_map 10 set peer PHX-VPN-PEER
crypto map outside_map 10 set ikev1 transform-set ESP-AES-256-SHA
crypto map outside_map 10 set security-association lifetime seconds 28800
crypto map outside_map 20 match address ASHl2l_acl
crypto map outside_map 20 set peer ASH-VPN-PEER
crypto map outside_map 20 set ikev1 transform-set ESP-AES-256-SHA
crypto map outside_map 20 set security-association lifetime seconds 28800
crypto map outside_map interface outside
crypto ikev1 enable outside
!
tunnel-group 131.153.142.202 type ipsec-l2l
tunnel-group 131.153.142.202 ipsec-attributes
ikev1 pre-shared-key ksdbk78823kdcs92kwehsfkphx
tunnel-group 131.153.155.210 type ipsec-l2l
tunnel-group 131.153.155.210 ipsec-attributes
ikev1 pre-shared-key
Code language: plaintext (plaintext)