1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

IBM Cloud VPC 内の Ubuntu に Veeam PN を導入し、 SSL VPN 接続する

Last updated at Posted at 2020-10-26

概要

このようなイメージで実機確認します。

Kobito.zLYedt.png

バージョン確認

こちらの Ubuntu 環境に導入します。

# cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.1 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.1 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

インストール

こちらにガイドに従って導入します。

※ WireGuard のレポジトリ追加は不要となったようです。


# curl -k http://repository.veeam.com/keys/veeam.gpg | apt-key add -
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  5469  100  5469    0     0  17641      0 --:--:-- --:--:-- --:--:-- 17641
OK

# echo "deb [arch=amd64] http://repository.veeam.com/pn/public pn stable" > /etc/apt/sources.list.d/veeampn.list
# apt-get update
Hit:1 http://mirrors.adn.networklayer.com/ubuntu bionic InRelease
Hit:2 http://mirrors.adn.networklayer.com/ubuntu bionic-updates InRelease             
Hit:3 http://mirrors.adn.networklayer.com/ubuntu bionic-backports InRelease            
Get:4 http://repository.veeam.com/pn/public pn InRelease [7,581 B]                                           
Hit:5 http://mirrors.adn.networklayer.com/ubuntu bionic-security InRelease        
Get:6 http://repository.veeam.com/pn/public pn/stable amd64 Packages [3,609 B]
Fetched 11.2 kB in 1s (8,616 B/s)     
Reading package lists... Done

apt-get -y install veeam-vpn-ui veeam-vpn-svc

以下の画面で「Yes」と答えるとインストール完了です。

Kobito.huOZGL.png

ログイン・初期設定

Veeam PN ポータルにアクセスして、ログイン・初期設定します。

Username: root
Password: 「Linuxのrootユーザーと同じパスワードが初期設定」

Kobito.d0gERP.png

Veeam PN ポータル用のパスワードを任意に設定します。

Kobito.VjCezL.png

まず最初に作成する必要があるのは、Network hub になります。
(その後に VPN 接続先として追加したいサイトには、Site gateway を配置します。)

  • Deploying Network Hub - Veeam PN User Guide
    The first step of the VPN infrastructure configuration is to deploy the network hub. The network hub is the core component in the VPN infrastructure that provides VPN connections and services to remote sites and users. All traffic in the VPN is routed through the network hub.

Kobito.Yn9NYA.png

自己署名の証明書を作成するのに必要な組織名を設定します。

Kobito.PLp64g.png

自己署名の証明書作成が完了します。

Kobito.amAEeA.png

VPN 接続エンドポイントとして公開する IP アドレスまたは DNS 名を設定します。
(今回は Ubuntu にバインドした Floating IP を設定します。)

Kobito.LnOwX9.png

最後にこちらのポータル画面が表示されれば設定完了です。
※ WireGuard 起動に失敗し、Site-to-Site が Stopped になってしまう場合は、しばらく経ってから再度 Site-to-Site を有効化してみてください。

Kobito.7oCU5F.png

Point-to-site VPN サーバー設定

Point-to-site VPN のユースケースを実機で確認します。
「Client」の作成から「Standalone Computer」を設定します。

Kobito.gv4aH4.png

「Client」の名前を設定します。

Kobito.PHFmNC.png

内容を確認して、設定を完了します。

Kobito.dED74v.png

すると、クライアント用の OpenVPN 設定ファイルをダウンロードするためのポップアップが表示されるので、こちらをダウンロードしてクライアントPCに保存します。

Kobito.3mtEun.png

最後に、リモートサイト内へのルーティングを追加するために以下の設定を追加します。

echo ' ' >> /etc/veeampn/EndpointOVPN.cfg
echo 'push "route 192.168.250.0 255.255.255.0"' >> /etc/veeampn/EndpointOVPN.cfg

その後、サーバー設定ファイルの変更を反映するために、Point-to-Site のサービスを OFF --> ON と再起動します。

Kobito.uF7Bjy.png

Point-to-site VPN クライアント設定

VPN クライアントには OpenVPN クライアントをインストールします。

macOS の場合は Tunnelblick | Free open source OpenVPN VPN client server software for macOS を使います。

先ほどダウンロードした khayama-test.ovpn を接続先として登録します。

Kobito.cZH8Om.png

接続が完了すると、以下のような画面になります。
※ つながらない場合は、VPC の Security Group のルールで通信が許可されているか確認します。

Kobito.gcNv7C.png

さいごに

IBM Cloud の Classic Infra にはある SSL-VPN 接続が VPC では現時点で提供がないので、VPN が必要な場合には Veeam PN が簡単に導入できてよさそうです。
また、災害対策先のサイトも VPN はシングル構成であることも多いので、このようなソリューションで簡易にサイト間も接続しておくこともできそうです。

参考 : /etc/veeampn/EndpointOVPN.cfg のデフォルト

サーバー設定ファイルの変更を反映するには、Point-to-Site のサービスを再起動します。

  • クライアントに割り当てたいアドレス帯を変更するには server 10.210.0.0 255.255.0.0 を変更する
  • クライアントにリモートサイト内へのルーティングを追加するには push "route 192.168.250.0 255.255.255.0" を追加する
/etc/veeampn/EndpointOVPN.cfg
mode server

port 6179
proto udp
server 10.210.0.0 255.255.0.0

dev tun.veeampn

persist-key
persist-tun

topology subnet

auth SHA256
auth-nocache
cipher AES-256-CBC

tls-server
tls-version-min 1.2
tls-cipher TLS-ECDHE-RSA-WITH-AES-256-GCM-SHA384:TLS-DHE-RSA-WITH-AES-256-GCM-SHA384

remote-cert-tls client

fast-io
mssfix 1380
txqueuelen 1000

sndbuf 1048576
rcvbuf 1048576

keepalive 10 20


management mgmtEndpointOVPN unix
auth-user-pass-optional
management-client-auth
management-hold

<ca>
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----

</ca>

<cert>
Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number: 1 (0x1)
        Signature Algorithm: sha256WithRSAEncryption
        Issuer: C=US, ST=CA, L=SanFrancisco, O=org, OU=Acme, CN=org CA/name=khayama.org/emailAddress=nonexistent@acme.org
        Validity
            Not Before: Oct 23 08:39:05 2020 GMT
            Not After : Oct 21 08:39:05 2030 GMT
        Subject: C=US, ST=CA, L=SanFrancisco, O=org, OU=Acme, CN=EndpointOVPN/name=khayama.org/emailAddress=nonexistent@acme.org
        Subject Public Key Info:
            Public Key Algorithm: rsaEncryption
                RSA Public-Key: (2048 bit)
                Modulus:
                    00:
                Exponent: 65537 (0x10001)
        X509v3 extensions:
            X509v3 Basic Constraints: 
                CA:FALSE
            Netscape Cert Type: 
                SSL Server
            Netscape Comment: 
                Easy-RSA Generated Server Certificate
            X509v3 Subject Key Identifier: 
                C9:
            X509v3 Authority Key Identifier: 
                keyid:
                DirName:/C=US/ST=CA/L=SanFrancisco/O=org/OU=Acme/CN=org CA/name=khayama.org/emailAddress=nonexistent@acme.org
                serial:

            X509v3 Extended Key Usage: 
                TLS Web Server Authentication
            X509v3 Key Usage: 
                Digital Signature, Key Encipherment
            X509v3 Subject Alternative Name: 
                DNS:EndpointOVPN
    Signature Algorithm: sha256WithRSAEncryption
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
</cert>
<key>
-----BEGIN PRIVATE KEY-----

-----END PRIVATE KEY-----
</key>
<dh>
-----BEGIN DH PARAMETERS-----
-----END DH PARAMETERS-----
</dh>
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?