ユーザ用ツール

サイト用ツール


05_network:04_vyatta:vyatta_openvpn

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン前のリビジョン
次のリビジョン
前のリビジョン
05_network:04_vyatta:vyatta_openvpn [2012/12/07 01:02] matsui05_network:04_vyatta:vyatta_openvpn [2012/12/14 08:23] (現在) – [vyatta-B] matsui
行 1: 行 1:
 +====== Vyatta Openvpn ======
  
 +|Name|eth0|eth1|vtun0|
 +|vyatta-A|10.10.10.246/24|192.168.10.246/24|172.16.100.246|
 +|vyatta-B|10.10.20.75/24|192.168.20.75/24|172.16.100.75|
 +
 +<code>
 +     +----------+                                    +----------+         +----------+
 +              |                                    |          |                  |
 + eth1|          |eth0                                |          |     eth0|          |eth1
 +-----+ vyatta-A +-------------  INTERNET ------------+ Natruote +---------+ vyatta-B +-----
 +              |                                    |          |                  |
 +              |                                    |          |                  |
 +     +----+-----+                                    +----+-----+         +----+-----+
 +</code>
 +
 +====== インターフェース設定 ======
 +===== vyatta-A =====
 +<code>
 +set system hostname router-A
 +set interfaces ethernet eth0 address 10.10.10.246/24
 +set interfaces ethernet eth1 address 192.168.10.246/24
 +set service nat rule 10 outbound-interface eth0
 +set service nat rule 10 source address 192.168.10.246/24
 +set service nat rule 10 type masquerade
 +</code>
 +
 +
 +===== vyatta-B =====
 +<code>
 +set system hostname router-B
 +set interfaces ethernet eth0 address 10.10.20.75/24
 +set interfaces ethernet eth1 address 192.168.20.75/24
 +set service nat rule 10 outbound-interface eth0
 +set service nat rule 10 source address 192.168.20.75/24
 +set service nat rule 10 type masquerade
 +</code>
 +
 +====== Generating Pre-Shared Key ======
 +vyatta-A, vyatta-B ともに同じキーをコピーしておく。
 +<code>
 +$ generate openvpn key /config/auth/key.psk
 +</code>
 +
 +
 +====== openvpn設定 ======
 +===== vyatta-A =====
 +<code>
 +set interfaces openvpn vtun0
 +set interfaces openvpn vtun0 mode site-to-site
 +set interfaces openvpn vtun0 local-address 172.16.100.246
 +set interfaces openvpn vtun0 remote-address 172.16.100.75
 +set interfaces openvpn vtun0 shared-secret-key-file /config/auth/key.psk
 +</code>
 +
 +===== vyatta-B =====
 +<code>
 +set interfaces openvpn vtun0
 +set interfaces openvpn vtun0 mode site-to-site
 +set interfaces openvpn vtun0 local-address 172.16.100.75
 +set interfaces openvpn vtun0 remote-address 172.16.100.246
 +set interfaces openvpn vtun0 remote-host 10.10.10.246
 +set interfaces openvpn vtun0 shared-secret-key-file /config/auth/key.psk
 +</code>
 +
 +
 +====== static route ======
 +===== vyatta-A =====
 +  set protocols static route 192.168.20.0/24 next-hop 172.16.100.75
 +
 +===== vyatta-B =====
 +  set protocols static route 192.168.10.0/24 next-hop 172.16.100.246