... # These are the default values for fields # which will be placed in the certificate. # Don't leave any of these fields blank. export KEY_COUNTRY="US" export KEY_PROVINCE="CA" export KEY_CITY="SanFrancisco" export KEY_ORG="Fort-Funston" export KEY_EMAIL="me@myhost.mydomain" export KEY_OU="MyOrganizationalUnit"
Output Generating a 2048 bit RSA private key ..........................................................................................+++ ...............................+++ writing new private key to 'ca.key' ----- You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [US]: State or Province Name (full name) [NY]: Locality Name (eg, city) [New York City]: Organization Name (eg, company) [DigitalOcean]: Organizational Unit Name (eg, section) [Community]: Common Name (eg, your name or your server's hostname) [DigitalOcean CA]: Name [server]: Email Address [admin@email.com]:
# # rules.before # # Rules that should be run before the ufw command line added rules. Custom # rules should be added to one of these chains: # ufw-before-input # ufw-before-output # ufw-before-forward #
# START OPENVPN RULES # NAT table rules *nat :POSTROUTING ACCEPT [0:0] # Allow traffic from OpenVPN client to wlp11s0 (change to the interface you discovered!) -A POSTROUTING -s 10.8.0.0/8 -o wlp11s0 -j MASQUERADE COMMIT # END OPENVPN RULES
# Don't delete these required lines, otherwise there will be errors *filter . . .
● openvpn@server.service - OpenVPN connection to server Loaded: loaded (/lib/systemd/system/openvpn@.service; enabled; vendor preset: enabled) Active: active (running) since Sat 2018-08-04 18:07:06 UTC; 2 days ago Docs: man:openvpn(8) https://community.openvpn.net/openvpn/wiki/Openvpn23ManPage https://community.openvpn.net/openvpn/wiki/HOWTO Main PID: 7130 (openvpn) CGroup: /system.slice/system-openvpn.slice/openvpn@server.service └─7130 /usr/sbin/openvpn --daemon ovpn-server --status /run/openvpn/server.status 10 --cd /etc/openvpn --script-secur
Aug 07 14:33:44 vultr.guest ovpn-server[7130]: 112.10.253.234:30160 [client1] Peer Connection Initiated with [AF_INET]112.10.253 Aug 07 14:33:44 vultr.guest ovpn-server[7130]: MULTI: new connection by client 'client1' will cause previous active sessions by Aug 07 14:33:44 vultr.guest ovpn-server[7130]: MULTI_sva: pool returned IPv4=10.8.0.6, IPv6=(Not enabled) Aug 07 14:33:44 vultr.guest ovpn-server[7130]: MULTI: Learn: 10.8.0.6 -> client1/112.10.253.234:30160 Aug 07 14:33:44 vultr.guest ovpn-server[7130]: MULTI: primary virtual IP for client1/112.10.253.234:30160: 10.8.0.6 Aug 07 14:33:48 vultr.guest ovpn-server[7130]: client1/112.10.253.234:30160 PUSH: Received control message: 'PUSH_REQUEST' Aug 07 14:33:48 vultr.guest ovpn-server[7130]: client1/112.10.253.234:30160 send_push_reply(): safe_cap=940 Aug 07 14:33:48 vultr.guest ovpn-server[7130]: client1/112.10.253.234:30160 SENT CONTROL [client1]: 'PUSH_REPLY,redirect-gateway Aug 07 14:37:48 vultr.guest ovpn-server[7130]: client1/112.10.253.234:30160 [client1] Inactivity timeout (--ping-restart), resta Aug 07 14:37:48 vultr.guest ovpn-server[7130]: client1/112.10.253.234:30160 SIGUSR1[soft,ping-restart] received, client-instance
你也可以通过以下命令来检查openvpn tun0接口是否可用:
1
ip addr show tun0
你应该看到一个配置接口:
1 2 3 4 5
Output 4: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 100 link/none inet 10.8.0.1 peer 10.8.0.2/32 scope global tun0 valid_lft forever preferred_lft forever
. . . # The hostname/IP and port of the server. # You can have multiple remote entries # to load balance between the servers. remote server_IP_address 1194 . . .
# SSL/TLS parms. # See the server config file for more # description. It's best to use # a separate .crt/.key file pair # for each client. A single ca # file can be used for all clients. #ca ca.crt #cert client.crt #key client.key