OPENVPN:LinuxでのIPv6対応VPN設定の問題

OPENVPN:LinuxでのIPv6対応VPN設定の問題

OrangePi(Raspberry Piと同じ小さなコンピュータ)でVPNを設定できません。

私のプロジェクトは彼にipv6 VPNを設定することです。だから私はこれを自動的に生成することを提案するプロジェクトをgithubで見つけました。

https://github.com/xl-tech/OpenVPN-easy-setup(通過マインドテクノロジー)

OrangePiをテストする前に、実行中のVMでこのスクリプトを実行してみましたが、うまくいきUbuntu 16.04 LTS 64Bitsました。しかし、OrangePiで実行すると動作しません。

表示されたエラーメッセージ(iptablesファイアウォールが設定されていないことに関連しているようです)を見た後、実際に動作を妨げる原因が見つかりません...

まだ学ぶべきことが多く、何時間もブロックしていましたが、なぜこれがうまくいかないのかわかりません。

私のOrangePiはUbuntu 14.04.5 LTS(GNU/Linux 3.4.39 armv7l)

私を正しい道に導くことができますか? :(

このスクリプトは私のOrangePiから返されます。

root@OrangePI:~/OpenVPN-easy-setup# bash openvpnsetup.sh
TUN/TAP is enabled
IPv4 forwarding is already enabled
NAME="Ubuntu"
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package netfilter-persistent
Firewall stopped and disabled on system startup
awk: line 0: regular expression compile failed (missing operand)
[       ]+|
Select server IP to listen on (only used for IPv4):
1) Internal IP - 192.168.1.11 25.33.106.84 2620:9b::1921:6a54  (in case you are behind NAT)
2) External IP - 90.51.33.97

2
Select server PORT to listen on:
1) tcp 443 (recommended)
2) udp 1194 (default)
3) Enter manually (proto (lowercase!) port)

2
Select server cipher:
1) AES-256-GCM (default for OpenVPN 2.4.x, not supported by Ubuntu Server 16.x)
2) AES-256-CBC
3) AES-128-CBC (default for OpenVPN 2.3.x)
4) BF-CBC (insecure)

2
Enable IPv6? (ensure that your machine have IPv6 support):
1) Yes
2) No

1
Check your selection
Server will listen on 90.51.33.97
Server will listen on udp 1194
Server will use AES-256-CBC cipher
IPv6 - 1 (1 is enabled, 0 is disabled)
Press enter to continue...
NAME="Ubuntu"
Using CA Common Name: Fort-Funston CA
Generating a 2048 bit RSA private key
....................................+++
...+++
writing new private key to 'ca.key'
-----
Generating a 2048 bit RSA private key
............+++
....+++
writing new private key to 'server-cert.key'
-----
Using configuration from /etc/openvpn/easy-rsa/openssl-1.0.0.cnf
Check that the request matches the signature
Signature ok
The Subject's Distinguished Name is as follows
countryName           :PRINTABLE:'US'
stateOrProvinceName   :PRINTABLE:'CA'
localityName          :PRINTABLE:'SanFrancisco'
organizationName      :PRINTABLE:'Fort-Funston'
organizationalUnitName:PRINTABLE:'MyVPN'
commonName            :PRINTABLE:'server-cert'
name                  :PRINTABLE:'EasyRSA'
emailAddress          :IA5STRING:'[email protected]'
Certificate is to be certified until Sep 21 10:09:07 2023 GMT (1825 days)

Write out database with 1 new entries
Data Base Updated
Generating DH parameters, 2048 bit long safe prime, generator 2
This is going to take a long time
.........+..................................+................................................................................................+..........................................................................................................................................................................................................................................+.................................+....................................................................................................................................................+....+..................................................................................................................................................................................................+.................................................+.........................................+...........................................................................................................................................................................................................................................................................+.................................................................................................+................................................................................................+...........................................................................................................................................+....+....................................................................................+...........................................................................................................................................................................++*++*
Generating a 2048 bit RSA private key
...........+++
..+++
writing new private key to 'revoked.key'
-----
Using configuration from /etc/openvpn/easy-rsa/openssl-1.0.0.cnf
Check that the request matches the signature
Signature ok
The Subject's Distinguished Name is as follows
countryName           :PRINTABLE:'US'
stateOrProvinceName   :PRINTABLE:'CA'
localityName          :PRINTABLE:'SanFrancisco'
organizationName      :PRINTABLE:'Fort-Funston'
organizationalUnitName:PRINTABLE:'MyVPN'
commonName            :PRINTABLE:'revoked'
name                  :PRINTABLE:'EasyRSA'
emailAddress          :IA5STRING:'[email protected]'
Certificate is to be certified until Sep 21 10:17:42 2023 GMT (1825 days)

Write out database with 1 new entries
Data Base Updated
Using configuration from /etc/openvpn/easy-rsa/openssl-1.0.0.cnf
Revoking Certificate 01.
Data Base Updated
Using configuration from /etc/openvpn/easy-rsa/openssl-1.0.0.cnf
revoked.crt: C = US, ST = CA, L = SanFrancisco, O = Fort-Funston, OU = MyVPN, CN = revoked, name = EasyRSA, emailAddress = [email protected]
error 23 at 0 depth lookup:certificate revoked
Error 23 indicates that revoke is successful
IPv6 forwarding is already enabled
OpenVPN 2.3.2 arm-unknown-linux-gnueabihf [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [eurephia] [MH] [IPv6] built on Jun 22 2017
NAME="Ubuntu"
openvpnsetup.sh: line 360: systemctl: command not found
openvpnsetup.sh: line 360: systemctl: command not found
openvpnsetup.sh: line 361: systemctl: command not found
openvpnsetup.sh: line 361: systemctl: command not found
openvpnsetup.sh: line 362: systemctl: command not found
Setup is complete. Happy VPNing!
Use /etc/openvpn/newclient.sh to generate client config

だから:

root@OrangePI:~/OpenVPN-easy-setup# /etc/openvpn/newclient.sh try
Script to generate unified config for Windows App
sage: newclient.sh <common-name>
Generating a 2048 bit RSA private key
.......................................+++
...............................................................................................................................+++
writing new private key to 'try.key'
-----
Using configuration from /etc/openvpn/easy-rsa/openssl-1.0.0.cnf
Check that the request matches the signature
Signature ok
The Subject's Distinguished Name is as follows
countryName           :PRINTABLE:'US'
stateOrProvinceName   :PRINTABLE:'CA'
localityName          :PRINTABLE:'SanFrancisco'
organizationName      :PRINTABLE:'Fort-Funston'
organizationalUnitName:PRINTABLE:'MyVPN'
commonName            :PRINTABLE:'try'
name                  :PRINTABLE:'EasyRSA'
emailAddress          :IA5STRING:'[email protected]'
Certificate is to be certified until Sep 21 10:56:28 2023 GMT (1825 days)

Write out database with 1 new entries
Data Base Updated
OpenVPN 2.3.2 arm-unknown-linux-gnueabihf [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [eurephia] [MH] [IPv6] built on Jun 22 2017
COMPLETE! Copy the new unified config from here: /etc/openvpn/bundles/try.ovpn

ベストアンサー1

スクリプトがコマンドを見つけることができないため、次のエラーメッセージが表示されますsystemctl

openvpnsetup.sh: line 360: systemctl: command not found

欠落しているコマンドは、systemdヒント(時には前端)initサブシステムを制御するためのものです。

~によるとこの古いUbuntu Wikiページは、Ubuntuで導入された可能性のある最も初期のバージョンはsystemd14.10または15.04の可能性が高いです。 14.04.5を実行しています。年をとるそれらのどれよりも。以前は、UbuntuがUbuntuのサブシステムだったsystemdと思いました。upstartinit

あるタイプのサブシステムから別のタイプへの変換はinitかなりの変化である。これは、システムの開始と終了の実行方法と、システムサービスの定義と制御方法に影響します。ちなみに、systemdこのsystemctlコマンドはほとんどのサービス管理タスクのための汎用ツールです。

スクリプトから行#360、#361、および#362を読み、その行のコマンドが実行したい操作をopenvpnsetup.sh見つけて、それをinitサブシステムの適切なコマンドに置き換える必要があります。おそらく、あなたが入れたファイルを見つけて-styleサービス定義に置き換える必要があります。systemctlupstart/etc/systemd/systemupstart

githubリンクでは、次の行は次のようになります。

systemctl enable netfilter-persistent & systemctl start netfilter-persistent
systemctl enable openvpn@server & systemctl start openvpn@server
systemctl restart netfilter-persistent

netfilter-persistentこれは、openVPNサーバーサービスが起動時に自動的に開始され、すぐに開始され、次にサービスを再起動することを有効にすることですnetfilter-persistent。おそらく、OpenVPNの起動時に変更されたファイアウォールルールがすぐに永久に保存されるようにすることです。

おすすめ記事