apt install openvpn -y\r\n\r\n#test\r\nopenvpn --config test.ovpn\r\n\r\n#\u958b\u6a5f\u555f\u52d5\r\nvi \/etc\/default\/openvpn\r\nAUTOSTART=\"all\" #\u79fb\u9664\u8a3b\u89e3\r\ncd \/etc\/openvpn\r\nmv test.ovpn client.conf\r\nsystemctl enable openvpn@client.service\r\nsystemctl start openvpn@client.service\r\n\r\n#iptables Server\u7aef\r\niptables -t nat -A POSTROUTING -s 10.8.0.0\/24 -o $EXTIF -j MASQUERADE\r\n#iptables Client\u7aef\r\niptables -t nat -A POSTROUTING -s \u5de5\u4f5c\u7aef\u7db2\u6bb5\/24 -o tun0 -j MASQUERADE\r\n<\/pre>\n<\/p>\n","protected":false},"excerpt":{"rendered":"
apt install openvp […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[88],"tags":[],"class_list":["post-1695","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/linjakson.com\/wp-json\/wp\/v2\/posts\/1695","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linjakson.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linjakson.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linjakson.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linjakson.com\/wp-json\/wp\/v2\/comments?post=1695"}],"version-history":[{"count":1,"href":"https:\/\/linjakson.com\/wp-json\/wp\/v2\/posts\/1695\/revisions"}],"predecessor-version":[{"id":1696,"href":"https:\/\/linjakson.com\/wp-json\/wp\/v2\/posts\/1695\/revisions\/1696"}],"wp:attachment":[{"href":"https:\/\/linjakson.com\/wp-json\/wp\/v2\/media?parent=1695"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linjakson.com\/wp-json\/wp\/v2\/categories?post=1695"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linjakson.com\/wp-json\/wp\/v2\/tags?post=1695"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}