certificate as follows:
Ll keys/
We can see that three files, ilanni. csr, ilanni. crt, and ilanni. key, have been generated. Here, we use the ilanni. crt and ilanni. key Files.
In this way, the Client certificate is created.
4. Configure the Server
After all the certificates are created, we now start to configure the Server. Server configuration file, which can be copied from the openvpn built-in template. As follows:
Cp/usr/share/doc/
routing mode.
Ifconfig-pool-persist ipp.txt
Define the relationship between the client and the virtual IP address. Especially when openvpn is restarted, the client connected again will still be assigned and the previous IP address will be disconnected.
Server-bridge 10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100
Defines the IP address segment allocated to the client when openvpn uses the tap Bridge Mode.
NO
Hz. key Hangzhou only hz Key YES
According to the table above, copy all the files to the host that requires these files.
4.5.2 OpenVPN Server Configuration
When openvpn is installed, the/opt/openvpn directory contains only the sbin and man folders. For convenience, we can create other folders under this directory.
Code:
Directory Name
The main program
attention to the file permissions to prevent theft.Key/etc/openvpn/keys/server. key # This file shocould be kept secret# Diffie-Hellman file generated by builddhDh/etc/openvpn/keys/dh1024.pem# Configure the network used by the VPN. Openvpn will automatically provide the DHCP service based on this network segment, but it cannot repeat with the LAN end of any part
/openvpn/directory and execute the command:
Cp/etc/openvpn/easy-rsa/easyrsa3/pki/ca. crt/etc/openvpnCp/etc/openvpn/easy-rsa/easyrsa3/pki/private/server. key/etc/openvpnCp/etc/openvpn/easy-rsa/easyrsa3/pki/issued/server. crt/etc/openvpnCp/etc/openvpn/easy-rsa/easyrsa3/pki/d
uses two users, client1 and client2, as an example.[Root @ openvpn-server 2.0] #./build-key client1
[Root @ openvpn-server 2.0] #./build-key client2 # Same as above[Root @ openvpn-server 2.0] # ls-lsart keys
Modify the configuration file/etc/server. conf of the openvpn server[Root @
certified until Mar 08:22:00 2016 GMT (3650 days)Sign the certificate? [Y/n]:y 1 out of 1 certificate requests certified, commit? [Y/n]yWrite out database with 1 new entriesData Base Updated Generate additional client certificates in turn/keyCode:./build-key Client2./build-key Client3 Note When entering Common name (eg, your name or your server ' s hostname) []: The name of each certificate entry must be different. Generates Diffie Hellman parameters. Code:./BUILD-DH Package all files under th
'/^ SELINUX =/c \ SELINUX = disabled'/etc/selinux/config# Install openssl and lzo. lzo is used to compress communication data and speed up transmission.Yum-y install openssl-develYum-y install lzo# Install the epel SourceRpm-ivh http://mirrors.sohu.com/Fedora-epel/6/x86_64/epel-release-6-8.noarch.rpmSed-I's/^ secure list = https/secure list = http/'/etc/yum. repos. d/epel. repo
2. install and configure OpenVPN
Security Group.
10. Configure the OpenVPN ClientCopy the certificate generated by the server to one place. For example, for rainbow users:# Mkdir-p/home/rainbow/tmp/openvpn_heylinux# Cd/home/rainbow/tmp/openvpn_heylinux# Cp-rpa/etc/openvpn/easy-rsa/2.0/keys/ta. key.# Cp-rpa/etc/openvpn/easy-rsa/2.0/keys/ca. crt.# Cp-rpa/etc/
: '2017 @ qq.com 'Certificate is to be certified until Dec 2 04:15:50 905407204 GMT (2022 days) Sign the certificate? [Y/n]: y 1 out of 1 certificate requests certified, commit? [Y/n] yWrite out database with 1 new entriesData Base Updated and so on to create other client keys #. /build-key client2 #. /build-key client3 note that when entering the Common Name (eg, your name or your server's hostname) []: input, each certificate must have a different Name. 5. generate the Diffie Hellman parameter
The first bottleneck of openvpn is that the Tun character device reads and writes frames at one link layer. The reason why the user-mode openvpn process must have the same link-MTU on both ends, it is because each time openvpn reads a complete Ethernet frame from the/dev/NET/TUN character device, there are not many, and the library interface: ssize_t read (int fd
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.