GithubHelp home page GithubHelp logo

aws-client-vpn's Introduction

内容

awsのクライアントVPNエンドポイントから固定IPでインターネット接続をするメモ

相互認証のための証明書作成

https://docs.aws.amazon.com/ja_jp/vpn/latest/clientvpn-admin/client-authentication.html#mutual

git clone https://github.com/OpenVPN/easy-rsa.git
cd easy-rsa/easyrsa3
./easyrsa init-pki
./easyrsa build-ca nopass
> Enter
./easyrsa build-server-full sample-vpn-server nopass
> yes
./easyrsa build-client-full sample-vpn-client1.domain.tld nopass
> yes

# 別フォルダに必要なものをコピー
mkdir ~/sample-vpn/
cp pki/ca.crt ~/sample-vpn/
cp pki/issued/sample-vpn-server.crt ~/sample-vpn/
cp pki/private/sample-vpn-server.key ~/sample-vpn/
cp pki/issued/sample-vpn-client1.domain.tld.crt ~/sample-vpn
cp pki/private/sample-vpn-client1.domain.tld.key ~/sample-vpn/
cd ~/sample-vpn

# ACMに登録
aws acm import-certificate --certificate fileb://sample-vpn-server.crt --private-key fileb://sample-vpn-server.key --certificate-chain fileb://ca.crt
aws acm import-certificate --certificate fileb://sample-vpn-client1.domain.tld.crt --private-key fileb://sample-vpn-client1.domain.tld.key --certificate-chain fileb://ca.crt

AWS構成

  • VPC作成
  • サブネット作成
    • private-subnet
    • public-subnet
  • nat-gateway作成
    • public-subnet内
    • Elastic IPあり
  • internet-gateway作成
  • ルートテーブル
    • private-subnet -> 0.0.0.0/0 nat-gateway
    • public-subnet -> 0.0.0.0/0 internet-gateway
  • クライアントVPNエンドポイント作成
    • サーバー証明書 ACMのserver
    • 相互認証 -> クライアント証明書 ACMのclient
    • スプリットトンネル無効
    • ターゲットネットワークをprivate-subnet
    • 承認ルール 0.0.0.0/0追加
    • ルートテーブル 0.0.0.0/0(private-subnet)追加

CIDR参考

※ クライアントVPNエンドポイントは被らないように

  • vpc 172.19.0.0/16
  • public-subnet 172.19.0.0/21
  • private-subnet 172.19.16.0/21
  • クライアントVPNエンドポイント 172.19.32.0/21

ovpnファイルの作成

作成したクライアントVPNエンドポイントからクライアント設定**.ovpnをダウンロード 編集してsample-vpn-client1-domain.tld.crt, ample-vpn-client1-domain.tld.keyの情報を追記

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

</ca>

<cert>
-----BEGIN CERTIFICATE-----
***
-----END CERTIFICATE-----
</cert>

<key>
-----BEGIN PRIVATE KEY-----
***
-----END PRIVATE KEY-----
</key>

OpenVPNクライアント

https://docs.aws.amazon.com/ja_jp/vpn/latest/clientvpn-user/windows.html

Ref

https://hotatekun.hatenablog.com/entry/2022/09/19/204549

aws-client-vpn's People

Contributors

ktanoooo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.