{"id":543,"date":"2019-02-27T10:58:26","date_gmt":"2019-02-27T02:58:26","guid":{"rendered":"https:\/\/www.zhuyanbin.com\/?p=543"},"modified":"2019-03-01T10:27:36","modified_gmt":"2019-03-01T02:27:36","slug":"how-to-set-up-an-ikev2-vpn-server-with-strongswan-on-ubuntu-18-04","status":"publish","type":"post","link":"https:\/\/www.yanbin888.com\/?p=543","title":{"rendered":"Set Up an IKEv2 VPN Server on Ubuntu 18.04"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\" id=\"introduction\">Introduction<\/h1>\n\n\n\n<p>A virtual private network, or VPN, allows you to securely encrypt traffic as it travels through untrusted networks, such as those at the coffee shop, a conference, or an airport.<\/p>\n\n\n\n<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/Internet_Key_Exchange\">IKEv2<\/a>, or Internet Key Exchange v2, is a protocol that allows for direct IPSec tunneling between the server and client. In IKEv2 VPN implementations, IPSec provides encryption for the network traffic. IKEv2 is natively supported on some platforms (OS X 10.11+, iOS 9.1+, and Windows 10) with no additional applications necessary, and it handles client hiccups quite smoothly.<\/p>\n\n\n\n<p>In this tutorial, you&#8217;ll set up an IKEv2 VPN server using&nbsp;<a href=\"https:\/\/www.strongswan.org\/\">StrongSwan<\/a>&nbsp;on an Ubuntu 18.04 server and connect to it from Windows, macOS, Ubuntu, iOS, and Android clients.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"prerequisites\">Prerequisites<\/h1>\n\n\n\n<p>To complete this tutorial, you will need:<\/p>\n\n\n\n<p>One Ubuntu 18.04 server configured by following&nbsp;the Ubuntu 18.04 initial server setup guide, including a <strong>sudo<\/strong>&nbsp;non-root user and a firewall.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"step-1-\u2014-installing-strongswan\">Step 1 Installing StrongSwan<\/h1>\n\n\n\n<p>First, we&#8217;ll install StrongSwan, an open-source IPSec daemon which we&#8217;ll configure as our VPN server. We&#8217;ll also install the public key infrastructure component so that we can create a certificate authority to provide credentials for our infrastructure.<\/p>\n\n\n\n<p>Update the local package cache and install the software by typing:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo apt update\n$ sudo apt install strongswan strongswan-pki ufw<\/code><\/pre>\n\n\n\n<p>Now that everything&#8217;s installed, let&#8217;s move on to creating our certificates.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"step-2-\u2014-creating-a-certificate-authority\">Step 2 Creating a Certificate Authority<\/h1>\n\n\n\n<p>An IKEv2 server requires a certificate to identify itself to clients. To help us create the certificate required, the&nbsp;<strong>strongswan-pki<\/strong>&nbsp;package comes with a utility to generate a certificate authority and server certificates. To begin, let&#8217;s create a few directories to store all the assets we&#8217;ll be working on. The directory structure matches some of the directories in&nbsp;<strong>\/etc\/ipsec.d<\/strong>, where we will eventually move all of the items we create. We&#8217;ll lock down the permissions so that our private files can&#8217;t be seen by other users:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ mkdir -p ~\/pki\/{cacerts,certs,private}\n$ chmod 700 ~\/pki<\/code><\/pre>\n\n\n\n<p>Now that we have a directory structure to store everything, we can generate a root key. This will be a 4096-bit RSA key that will be used to sign our root certificate authority.<\/p>\n\n\n\n<p>Execute these commands to generate the key:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ipsec pki --gen --type rsa --size 4096 --outform pem \\\n> ~\/pki\/private\/ca-key.pem<\/code><\/pre>\n\n\n\n<p>Now that we have a key, we can move on to creating our root certificate authority, using the key to sign the root certificate:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ ipsec pki --self --ca --lifetime 3650 --in ~\/pki\/private\/ca-key.pem \\\n    --type rsa --dn \"CN=VPN root CA\" --outform pem > ~\/pki\/cacerts\/ca-cert.pem<\/code><\/pre>\n\n\n\n<p>You can change the&nbsp;<em>distinguished name<\/em>&nbsp;(DN) values to something else to if you would like. The common name here is just the indicator, so it doesn&#8217;t have to match anything in your infrastructure.<\/p>\n\n\n\n<p>Now that we&#8217;ve got our root certificate authority up and running, we can create a certificate that the VPN server will use.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"step-3-\u2014-generating-a-certificate-for-the-vpn-server\">Step 3 Generating a Certificate for the VPN Server<\/h1>\n\n\n\n<p>We&#8217;ll now create a certificate and key for the VPN server. This certificate will allow the client to verify the server&#8217;s authenticity using the CA certificate we just generated.<\/p>\n\n\n\n<p>First, create a private key for the VPN server with the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ ipsec pki --gen --type rsa --size 4096 --outform pem > ~\/pki\/private\/server-key.pem<\/code><\/pre>\n\n\n\n<p>Now, create and sign the VPN server certificate with the certificate authority&#8217;s key you created in the previous step. Execute the following command, but change the Common Name (CN) and the Subject Alternate Name (SAN) field to your VPN server&#8217;s DNS name or IP address:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ ipsec pki --pub --in ~\/pki\/private\/server-key.pem --type rsa \\\n    | ipsec pki --issue --lifetime 1825 \\\n        --cacert ~\/pki\/cacerts\/ca-cert.pem \\\n        --cakey ~\/pki\/private\/ca-key.pem \\\n        --dn \"CN=server_domain_or_IP\" --san \"server_domain_or_IP\" \\\n        --flag serverAuth --flag ikeIntermediate --outform pem \\\n    >  ~\/pki\/certs\/server-cert.pem\n<\/code><\/pre>\n\n\n\n<p>Now that we&#8217;ve generated all of the TLS\/SSL files StrongSwan needs, we can move the files into place in the&nbsp;<code>\/etc\/ipsec.d<\/code>&nbsp;directory by typing:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo cp -r ~\/pki\/* \/etc\/ipsec.d\/<\/code><\/pre>\n\n\n\n<p>In this step, we&#8217;ve created a certificate pair that would be used to secure communications between the client and the server. We&#8217;ve also signed the certificates with the CA key, so the client will be able to verify the authenticity of the VPN server using the CA certificate. Now that have all of the certificates ready, we&#8217;ll move on to configuring the software.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"step-4-\u2014-configuring-strongswan\">Step 4 Configuring StrongSwan<\/h1>\n\n\n\n<p>StrongSwan has a default configuration file with some examples, but we will have to do most of the configuration ourselves. Let&#8217;s back up the file for reference before starting from scratch:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo mv \/etc\/ipsec.conf{,.original}<\/code><\/pre>\n\n\n\n<p>Create and open a new blank configuration file by typing:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo vim \/etc\/ipsec.conf<\/code><\/pre>\n\n\n\n<p>First, we&#8217;ll tell StrongSwan to log daemon statuses for debugging and allow duplicate connections. Add these lines to the file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>config setup\n    charondebug=\"ike 1, knl 1, cfg 0\"\n    uniqueids=no\n\nconn ikev2-vpn\n    auto=add\n    compress=no\n    type=tunnel\n    keyexchange=ikev2\n    fragmentation=yes\n    forceencaps=yes\n    dpdaction=clear\n    dpddelay=300s\n    rekey=no\n    left=%any\n    leftid=@server_domain_or_IP\n    leftcert=server-cert.pem\n    leftsendcert=always\n    leftsubnet=0.0.0.0\/0\n    right=%any\n    rightid=%any\n    rightauth=eap-mschapv2\n    rightsourceip=10.10.10.0\/24\n    rightdns=8.8.8.8,8.8.4.4\n    rightsendcert=never\n    eap_identity=%identity<\/code><\/pre>\n\n\n\n<p>Save and close the file once you&#8217;ve verified that you&#8217;ve configured things as shown.<\/p>\n\n\n\n<p>Now that we&#8217;ve configured the VPN parameters, let&#8217;s move on to creating an account so our users can connect to the server.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"step-5-\u2014-configuring-vpn-authentication\">Step 5 Configuring VPN Authentication<\/h1>\n\n\n\n<p>Our VPN server is now configured to accept client connections, but we don&#8217;t have any credentials configured yet. We&#8217;ll need to configure a couple things in a special configuration file called&nbsp;<code>ipsec.secrets<\/code>:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>We need to tell StrongSwan where to find the private key for our server certificate, so the server will be able to authenticate to clients.<\/li><li>We also need to set up a list of users that will be allowed to connect to the VPN.<\/li><\/ul>\n\n\n\n<p>Let&#8217;s open the secrets file for editing:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo vim \/etc\/ipsec.secrets<\/code><\/pre>\n\n\n\n<p>First, we&#8217;ll tell StrongSwan where to find our private key,Then, we&#8217;ll define the user credentials. You can make up any username or password combination that you like:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>: RSA \"server-key.pem\"\nyour_username : EAP \"your_password\"<\/code><\/pre>\n\n\n\n<p>Save and close the file. Now that we&#8217;ve finished working with the VPN parameters, we&#8217;ll restart the VPN service so that our configuration is applied:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo systemctl restart strongswan<\/code><\/pre>\n\n\n\n<p>Now that the VPN server has been fully configured with both server options and user credentials, it&#8217;s time to move on to configuring the most important part: the firewall.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"step-6-\u2014-configuring-the-firewall-amp-kernel-ip-forwarding\">Step 6 Configuring the Firewall &amp; Kernel IP Forwarding<\/h1>\n\n\n\n<p>With the StrongSwan configuration complete, we need to configure the firewall to forward and allow VPN traffic through.<\/p>\n\n\n\n<p>If you followed the prerequisite tutorial, you should have a very basic UFW firewall enabled. If you don&#8217;t yet have UFW configured, you can create a baseline configuration and enable it by typing:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo ufw allow OpenSSH\n$ sudo ufw enable<\/code><\/pre>\n\n\n\n<p>Now, add a rule to allow UDP traffic to the standard IPSec ports, 500 and 4500:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo ufw allow 500,4500\/udp<\/code><\/pre>\n\n\n\n<p>Next, we will open up one of UFW&#8217;s configuration files to add a few low-level policies for routing and forwarding IPSec packets. Before we do, we need to find which network interface on our server is used for internet access. We can find that by querying for the interface associated with the default route:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ ip route | grep default<\/code><\/pre>\n\n\n\n<p>Your public interface should follow the word &#8220;dev&#8221;. For example, this result shows the interface named&nbsp;<strong>eth0<\/strong>, which is highlighted below:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Output\ndefault via 203.0.113.7 dev eth0 proto static<\/code><\/pre>\n\n\n\n<p>When you have your public network interface, open the&nbsp;<code>\/etc\/ufw\/before.rules<\/code>&nbsp;file in your text editor:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo nano \/etc\/ufw\/before.rules<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">Near the top of the file (before the&nbsp;<code>*filter<\/code>&nbsp;line), add the following configuration block:<br><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>*nat\n-A POSTROUTING -s 10.10.10.0\/24 -o eth0 -m policy --pol ipsec --dir out -j ACCEPT\n-A POSTROUTING -s 10.10.10.0\/24 -o eth0 -j MASQUERADE\nCOMMIT\n\n*mangle\n-A FORWARD --match policy --pol ipsec --dir in -s 10.10.10.0\/24 -o eth0 -p tcp -m tcp --tcp-flags SYN,RST SYN -m tcpmss --mss 1361:1536 -j TCPMSS --set-mss 1360\nCOMMIT\n\n*filter\n:ufw-before-input - [0:0]\n:ufw-before-output - [0:0]\n:ufw-before-forward - [0:0]\n:ufw-not-local - [0:0]\n. . .<\/code><\/pre>\n\n\n\n<p>Change each instance of&nbsp;<strong>eth0<\/strong>&nbsp;in the above configuration to match the interface name you found with&nbsp;<strong>ip route<\/strong>. The&nbsp;<strong>*nat<\/strong>&nbsp;lines create rules so that the firewall can correctly route and manipulate traffic between the VPN clients and the internet. The&nbsp;<strong>*mangle<\/strong>&nbsp;line adjusts the maximum packet segment size to prevent potential issues with certain VPN clients.<\/p>\n\n\n\n<p>Next, after the&nbsp;<code>*filter<\/code>&nbsp;and chain definition lines, add one more block of configuration:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>. . .\n*filter\n:ufw-before-input - [0:0]\n:ufw-before-output - [0:0]\n:ufw-before-forward - [0:0]\n:ufw-not-local - [0:0]\n\n-A ufw-before-forward --match policy --pol ipsec --dir in --proto esp -s 10.10.10.0\/24 -j ACCEPT\n-A ufw-before-forward --match policy --pol ipsec --dir out --proto esp -d 10.10.10.0\/24 -j ACCEPT<\/code><\/pre>\n\n\n\n<p>These lines tell the firewall to forward&nbsp;<a href=\"https:\/\/wiki.wireshark.org\/ESP\">ESP<\/a>&nbsp;(Encapsulating Security Payload) traffic so the VPN clients will be able to connect. ESP provides additional security for our VPN packets as they&#8217;re traversing untrusted networks.<\/p>\n\n\n\n<p>When you&#8217;re finished, save and close the file.<\/p>\n\n\n\n<p>Before we restart the firewall, we&#8217;ll change some network kernel parameters to allow routing from one interface to another. Open UFW&#8217;s kernel parameters configuration file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo nano \/etc\/ufw\/sysctl.conf<\/code><\/pre>\n\n\n\n<p>We&#8217;ll need to configure a few things here:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>First, we&#8217;ll enable IPv4 packet forwarding.<\/li><li>We&#8217;ll disable Path MTU discovery to prevent packet fragmentation problems.<\/li><li>We also won&#8217;t accept ICMP redirects nor send ICMP redirects to prevent&nbsp;<a href=\"https:\/\/en.wikipedia.org\/wiki\/Man-in-the-middle_attack\">man-in-the-middle<\/a>&nbsp;attacks.<\/li><\/ul>\n\n\n\n<p>The changes you need to make to the file are highlighted in the following code:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>. . .\n\n# Enable forwarding\n# Uncomment the following line\nnet\/ipv4\/ip_forward=1\n\n. . .\n\n# Do not accept ICMP redirects (prevent MITM attacks)\n# Ensure the following line is set\nnet\/ipv4\/conf\/all\/accept_redirects=0\n\n# Do not send ICMP redirects (we are not a router)\n# Add the following lines\nnet\/ipv4\/conf\/all\/send_redirects=0\nnet\/ipv4\/ip_no_pmtu_disc=1<\/code><\/pre>\n\n\n\n<p>Save the file when you are finished. UFW will apply these changes the next time it starts.<\/p>\n\n\n\n<p>Now, we can enable all of our changes by disabling and re-enabling the firewall:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo ufw disable\n$ sudo ufw enable<\/code><\/pre>\n\n\n<p>You&#8217;ll be prompted to confirm the process. Type&nbsp;<strong>Y<\/strong>&nbsp;to enable UFW again with the new settings.<\/p>\n\n\n<p>Reboot server to make it active.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"step-7-\u2013-testing-the-vpn-connection-on-windows-ios-and-macos\">Step 7 Testing the VPN Connection on iOS, and macOS<\/h1>\n\n\n\n<p>Now that you have everything set up, it&#8217;s time to try it out. First, you&#8217;ll need to copy the CA certificate you created and install it on your client device(s) that will connect to the VPN. The easiest way to do this is to log into your server and output the contents of the certificate file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ cat \/etc\/ipsec.d\/cacerts\/ca-cert.pem<\/code><\/pre>\n\n\n\n<p>You&#8217;ll see output similar to this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>-----BEGIN CERTIFICATE-----\nMIIFQjCCAyqgAwIBAgIIFkQGvkH4ej0wDQYJKoZIhvcNAQEMBQAwPzELMAkGA1UE\n\n. . .\n\nEwbVLOXcNduWK2TPbk\/+82GRMtjftran6hKbpKGghBVDPVFGFT6Z0OfubpkQ9RsQ\nBayqOb\/Q\n-----END CERTIFICATE-----<\/code><\/pre>\n\n\n\n<p>Copy this output to your computer, including the&nbsp;<strong>&#8212;&#8211;BEGIN CERTIFICATE&#8212;&#8211;<\/strong>&nbsp;and&nbsp;<strong>&#8212;&#8211;END CERTIFICATE&#8212;&#8211;<\/strong>&nbsp;lines, and save it to a file with a recognizable name, such as&nbsp;<strong>ca-cert.pem<\/strong>. Ensure the file you create has the&nbsp;<strong>.pem<\/strong>&nbsp;extension.<\/p>\n\n\n\n<p>Alternatively,&nbsp;use SFTP to transfer the file to your computer.<\/p>\n\n\n\n<p>Once you have the&nbsp;<strong>ca-cert.pem<\/strong>&nbsp;file downloaded to your computer, you can set up the connection to the VPN.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"connecting-from-ios\">Connecting from iOS<\/h2>\n\n\n\n<p>To configure the VPN connection on an iOS device, follow these steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Send yourself an email with the root certificate attached.<\/li><li>Open the email on your iOS device and tap on the attached certificate file, then tap&nbsp;<strong>Install<\/strong>&nbsp;and enter your passcode. Once it installs, tap&nbsp;<strong>Done<\/strong>.<\/li><li>Go to&nbsp;<strong>Settings<\/strong>,&nbsp;<strong>General<\/strong>,&nbsp;<strong>VPN<\/strong>&nbsp;and tap&nbsp;<strong>Add VPN Configuration<\/strong>. This will bring up the VPN connection configuration screen.<\/li><li>Tap on&nbsp;<strong>Type<\/strong>&nbsp;and select&nbsp;<strong>IKEv2<\/strong>.<\/li><li>In the&nbsp;<strong>Description<\/strong>&nbsp;field, enter a short name for the VPN connection. This could be anything you like.<\/li><li>In the&nbsp;<strong>Server<\/strong>&nbsp;and&nbsp;<strong>Remote ID<\/strong>&nbsp;field, enter the server&#8217;s domain name or IP address. The&nbsp;<strong>Local ID<\/strong>&nbsp;field can be left blank.<\/li><li>Enter your username and password in the&nbsp;<strong>Authentication<\/strong>&nbsp;section, then tap&nbsp;<strong>Done<\/strong>.<\/li><li>Select the VPN connection that you just created, tap the switch on the top of the page, and you&#8217;ll be connected.<\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"connecting-from-macos\">Connecting from macOS<\/h2>\n\n\n\n<p>Follow these steps to import the certificate:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Double-click the certificate file.&nbsp;<strong>Keychain Access<\/strong>&nbsp;will pop up with a dialog that says &#8220;Keychain Access is trying to modify the system keychain. Enter your password to allow this.&#8221;<\/li><li>Enter your password, then click on&nbsp;<strong>Modify Keychain<\/strong><\/li><li>Double-click the newly imported VPN certificate. This brings up a small properties window where you can specify the trust levels. Set&nbsp;<strong>IP Security (IPSec)<\/strong>&nbsp;to&nbsp;<strong>Always Trust<\/strong>&nbsp;and you&#8217;ll be prompted for your password again. This setting saves automatically after entering the password.<\/li><\/ol>\n\n\n\n<p>Now that the certificate is important and trusted, configure the VPN connection with these steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Go to&nbsp;<strong>System Preferences<\/strong>&nbsp;and choose&nbsp;<strong>Network<\/strong>.<\/li><li>Click on the small &#8220;plus&#8221; button on the lower-left of the list of networks.<\/li><li>In the popup that appears, Set&nbsp;<strong>Interface<\/strong>&nbsp;to&nbsp;<strong>VPN<\/strong>, set the&nbsp;<strong>VPN Type<\/strong>&nbsp;to&nbsp;<strong>IKEv2<\/strong>, and give the connection a name.<\/li><li>In the&nbsp;<strong>Server<\/strong>&nbsp;and&nbsp;<strong>Remote ID<\/strong>&nbsp;field, enter the server&#8217;s domain name or IP address. Leave the&nbsp;<strong>Local ID<\/strong>blank.<\/li><li>Click on&nbsp;<strong>Authentication Settings<\/strong>, select&nbsp;<strong>Username<\/strong>, and enter your username and password you configured for your VPN user. Then click&nbsp;<strong>OK<\/strong>.<\/li><\/ol>\n\n\n\n<p>Finally, click on&nbsp;<strong>Connect<\/strong>&nbsp;to connect to the VPN. You should now be connected to the VPN.<\/p>\n\n\n\n<p>Link: <a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-set-up-an-ikev2-vpn-server-with-strongswan-on-ubuntu-18-04-2\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-set-up-an-ikev2-vpn-server-with-strongswan-on-ubuntu-18-04-2<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction A virtual private network, or VPN, allows  <span class=\"ellipsis\">&hellip;<\/span> <span class=\"more-link-wrap\"><a href=\"https:\/\/www.yanbin888.com\/?p=543\" class=\"more-link\"><span>Read More &rarr;<\/span><\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-543","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.yanbin888.com\/index.php?rest_route=\/wp\/v2\/posts\/543","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yanbin888.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yanbin888.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yanbin888.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yanbin888.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=543"}],"version-history":[{"count":37,"href":"https:\/\/www.yanbin888.com\/index.php?rest_route=\/wp\/v2\/posts\/543\/revisions"}],"predecessor-version":[{"id":584,"href":"https:\/\/www.yanbin888.com\/index.php?rest_route=\/wp\/v2\/posts\/543\/revisions\/584"}],"wp:attachment":[{"href":"https:\/\/www.yanbin888.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=543"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yanbin888.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=543"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yanbin888.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=543"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}