LoginSignup
2
0

More than 1 year has passed since last update.

OpenVPNのクライアント端末ルーティング設定

Last updated at Posted at 2022-03-30

OpenVPNのクライアント側のルーティング設定のメモです。
設定はすべてクライアントPC端末上で行います。

1.クライアント端末

PC:Windows10 Professional
ソフトウェア:OpenVPN GUI v11.26.0.0
設定ファイル:config.opvn

2.ネットワーク構成

image.png

3.すべてのトラフィックをVPNへ向ける設定

config.opvn

client
dev tun
proto udp
remote xxx.xxx.xxx.xxx 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert xxxxxxxxxxxxxxxxxxx.crt
key xxxxxxxxxxxxxxxxxxx.key
cipher AES-128-CBC
;comp-lzo
verb 4
redirect-gateway autolocal         /すべてのトラフィックをVPN経由にする
dhcp-option DNS 8.8.8.8         /DNSを指定
block-outside-dns             /VPN経由でDNSを解決

4.特定のトラフィックをVPNへ向ける設定

config.opvn

client
dev tun
proto udp
remote xxx.xxx.xxx.xxx 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert xxxxxxxxxxxxxxxxxxx.crt
key xxxxxxxxxxxxxxxxxxx.key
cipher AES-128-CBC
;comp-lzo
verb 4
route 10.0.0.0 255.0.0.0           /Staticで特定のネットーワークをVPN経由にする
dhcp-option DNS 8.8.8.8         /DNSを指定
block-outside-dns             /VPN経由でDNSを解決

Windows上のroute print

C:\Users>route print
Network Destination        Netmask          Gateway       Interface  Metric
       10.0.0.0    255.0.0.0      192.168.2.1     192.168.2.2    259

5.補足

すべてのトラフィックを向けるのとStaticで特定のネットワークのみにする設定は要件により使い分けてもらえればと思います。

2
0
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
2
0