softasap.sa-vpn-softether
sa-vpn-softether
Example of Use: Check Box-Example
Possible Configuration:
softether_option_securenat: true
softether_option_bridge: false
softether_location: /opt
softether_home: "{{softether_location}}/vpnserver"
softether_lang: en
softether_fqdn: "{{ansible_host}}"
# ============== IPSEC ===================
softether_option_ipsec: true
softether_ipsec_l2tp: yes
softether_ipsec_l2tpraw: yes
softether_ipsec_etherip: no
softether_ipsec_presharedkey: "zzz"
# /============== IPSEC ===================
# ============== OPENVPN ===================
softether_option_openvpn: true
softether_openvpn_port: 1194
softether_openvpn_config: "{{softether_home}}/generated/openvpn_config.zip"
# /============== OPENVPN ===================
# ============== Bridge ===================
softether_bridge_device: soft
softether_bridge_tap: no
# ============== /Bridge ===================
# ============== Users ===================
softether_vpn_users:
- {
name: "test",
password: "test"
}
# ============== /Users ===================
softether_sysctl_conf_lines:
- {
name: 'net.ipv4.ip_forward',
value: '1'
}
Simple Usage:
vars:
- my_softether_vpn_users:
- {
name: "my_user",
password: "my_password"
}
- my_softether_ipsec_presharedkey: "[1KH;+r-X#cvhpv7Y6=#;[{u"
roles:
- {
role: "sa-vpn-softether",
softether_vpn_users: "{{my_softether_vpn_users}}",
softether_ipsec_presharedkey: "{{my_softether_ipsec_presharedkey}}"
}
Advanced Usage:
vars:
- my_softether_vpn_users:
- {
name: "my_user",
password: "my_password"
}
- my_softether_ipsec_presharedkey: "[1KH;+r-X#cvhpv7Y6=#;[{u"
roles:
- {
role: "sa-vpn-softether",
softether_vpn_users: "{{my_softether_vpn_users}}",
softether_ipsec_presharedkey: "{{my_softether_ipsec_presharedkey}}",
softether_option_securenat: true,
softether_option_bridge: false,
softether_fqdn: "{{ansible_host}}",
# ============== IPSEC ===================
softether_option_ipsec: true,
softether_ipsec_l2tp: yes,
softether_ipsec_l2tpraw: yes,
softether_ipsec_etherip: no,
# /============== IPSEC ===================
# ============== OPENVPN ===================
softether_option_openvpn: true,
softether_openvpn_port: 1194,
softether_openvpn_config: "{{softether_home}}/generated/openvpn_config.zip",
# /============== OPENVPN ===================
# ============== Bridge ===================
softether_bridge_device: soft,
softether_bridge_tap: no
# ============== /Bridge ===================
}
Adding VPN Server Initialization:
If you need to set up the VPN server later, use:
softether_init_script: scenarios/dummy
Using Ansible Galaxy Workflow
If you installed the sa-vpn-softether role using:
ansible-galaxy install softasap.sa-vpn-softether
The role will be in the folder library/softasap.sa-vpn-softether
. Adjust the path as needed.
- {
role: "softasap.sa-vpn-softether"
}
Connecting to OpenVPN from Client
After running the last play step, you'll have a .cer
file for IPsec and a .zip
file with OpenVPN configuration.
- Unpack the ZIP file and ensure you have the OpenVPN GUI ready. If the "Import saved VPN configuration" option is missing, install it by running:
sudo apt install network-manager-openvpn network-manager-openvpn-gnome network-manager-pptp network-manager-vpnc
After logging out/back in or rebooting, you will find the option "Import saved VPN configuration".
Import the file named
yourhostname_l3.ovpn
. Use your user in the formatuser@vpn
, e.g.,test@vpn
, followed by the password (e.g.,test
).If you have only one hub, you can use just the username.
To troubleshoot, you can use the native OpenVPN client interactively:
sudo openvpn --config my.ovpn
OpenVPN Connection Details
About Files: When you open the ZIP file, you will find configuration files related to L3 (IP Routing) and L2 (Ethernet Bridging):
openvpn_remote_access_l3.ovpn
for L3 connections.openvpn_site_to_site_bridge_l2.ovpn
for L2 connections.
L3 vs. L2:
- Use L3 for remote access from a regular computer.
- Use L2 for connecting entire networks transparently.
Username and Password: Enter the same username and password defined on the VPN server's Virtual HUB. If there are multiple hubs, specify the hub name with the username.
Protocol and Port: You can use both TCP and UDP to connect to the VPN server. Make sure to use the appropriate port based on your server configuration.
Copyright and License
This code is available under the BSD 3-Clause and MIT License. Choose whichever license suits you.
Get in Touch
- Follow us for updates on Facebook
- Join discussions on Gitter
- Explore more roles at SoftAsap Roles Registry
- Check out our blog at SoftAsap Blog
softether multi protocol vpn
ansible-galaxy install softasap.sa-vpn-softether