このページの翻訳:
- 日本語 (ja)
- English (en)
最近の更新
- 02 Apache2で自己認証ssl [中間証明書の整合性確認]
最近の更新
Name | eth0 | eth1 | localPC |
vyatta-A | 10.10.10.246/24 | 192.168.10.246/24 | 192.168.10.5/24 |
vyatta-B | 10.10.20.75/24 | 192.168.20.75/24 | 192.168.20.250/24 |
+----------+ +----------+ +----------+ +----------+ | | | | | | | | | |eth0 eth1| |eth0 eth0| |eth1 eth0| | +localPC-A +---------+ vyatta-A +-------- INTERNET --------+ vyatta-B +-----------+localPC-B + | | | | | | | | | | | | | | | | +----+-----+ +----+-----+ +----+-----+ +----+-----+
# set interfaces ethernet eth0 address 10.10.10.246/24 # set interfaces ethernet eth1 address 192.168.10.246/24 # set system gateway-address 039;10.10.10.1039; # set system host-name 039;vyatta-A039;
# set interfaces ethernet eth0 address 10.10.20.75/24 # set interfaces ethernet eth1 address 192.168.20.75/24 # set system gateway-address 039;10.10.20.1039; # set system host-name 039;vyatta-A039;
# set vpn ipsec esp-group ns-esp mode 039;tunnel039; # set vpn ipsec esp-group ns-esp pfs 039;enable039; # set vpn ipsec esp-group ns-esp proposal 1 encryption 039;aes128039; # set vpn ipsec ike-group ns-ike lifetime 039;28800039; # set vpn ipsec ike-group ns-ike proposal 1 dh-group 039;2039; # set vpn ipsec ike-group ns-ike proposal 1 encryption 039;aes128039; # set vpn ipsec ike-group ns-ike proposal 1 hash 039;sha1039; # set vpn ipsec ipsec-interfaces interface 039;eth0039; # set vpn ipsec nat-networks allowed-network 039;192.168.10.0/24039; # set vpn ipsec nat-traversal 039;enable039; # set vpn ipsec site-to-site peer 10.10.20.75 authentication mode 039;pre-shared-secret039; # set vpn ipsec site-to-site peer 10.10.20.75 authentication pre-shared-secret 039;pre-shared-secret039; # set vpn ipsec site-to-site peer 10.10.20.75 connection-type 039;initiate039; # set vpn ipsec site-to-site peer 10.10.20.75 ike-group 039;ns-ike039; # set vpn ipsec site-to-site peer 10.10.20.75 local-ip 039;10.10.10.246039; # set vpn ipsec site-to-site peer 10.10.20.75 tunnel 1 esp-group 039;ns-esp039; # set vpn ipsec site-to-site peer 10.10.20.75 tunnel 1 local subnet 039;192.168.10.0/24039; # set vpn ipsec site-to-site peer 10.10.20.75 tunnel 1 remote subnet 039;192.168.20.0/24039;
※pre-shared-secretは任意のものを設定
vyatta-B側は、インターネットからL2TPで接続できるようにするので
allow-networkは0.0.0.0/0にしておく
# set vpn ipsec esp-group ns-esp mode 039;tunnel039; # set vpn ipsec esp-group ns-esp pfs 039;enable039; # set vpn ipsec esp-group ns-esp proposal 1 encryption 039;aes128039; # set vpn ipsec ike-group ns-ike lifetime 039;28800039; # set vpn ipsec ike-group ns-ike proposal 1 dh-group 039;2039; # set vpn ipsec ike-group ns-ike proposal 1 encryption 039;aes128039; # set vpn ipsec ike-group ns-ike proposal 1 hash 039;sha1039; # set vpn ipsec ipsec-interfaces interface 039;eth0039; # set vpn ipsec nat-networks allowed-network 039;0.0.0.0/0039; # set vpn ipsec nat-traversal 039;enable039; # set vpn ipsec site-to-site peer 10.10.20.75 authentication mode 039;pre-shared-secret039; # set vpn ipsec site-to-site peer 10.10.20.75 authentication pre-shared-secret 039;pre-shared-secret039; # set vpn ipsec site-to-site peer 10.10.20.75 connection-type 039;initiate039; # set vpn ipsec site-to-site peer 10.10.20.75 ike-group 039;ns-ike039; # set vpn ipsec site-to-site peer 10.10.20.75 local-ip 039;10.10.20.75039; # set vpn ipsec site-to-site peer 10.10.20.75 tunnel 1 esp-group 039;ns-esp039; # set vpn ipsec site-to-site peer 10.10.20.75 tunnel 1 local subnet 039;192.168.20.0/24039; # set vpn ipsec site-to-site peer 10.10.20.75 tunnel 1 remote subnet 039;192.168.10.0/24039;
※pre-shared-secretは任意のものを設定
下記のNat設定を追加して、LocalPC-A - LocalPC-B 間でPing疎通が取れて
LocalPC-A - LocalPC-B共に外部へ接続する事ができれば完成。
この際に、Natを通っては行けない相手側のネットワークを
Not条件でしてしておくのがポイント。
# set nat source rule 10 destination address 039;!192.168.20.0/24039; # set nat source rule 10 outbound-interface 039;eth0039; # set nat source rule 10 translation address 039;masquerade039;
# set nat source rule 10 destination address 039;!192.168.10.0/24039; # set nat source rule 10 outbound-interface 039;eth0039; # set nat source rule 10 translation address 039;masquerade039;
最後に、vyatta-Bへ外部からL2TPで接続する用の設定
基本的にVyatta - L2TP(IPSec)と同じ
設定後、L2TPで接続したPCからLocalPC-A,LocalPC-BにPing疎通が取れていれば完成
# set vpn l2tp remote-access authentication local-users username vpn-user password 039;vpn-user-passwod039; # set vpn l2tp remote-access authentication mode 039;local039; # set vpn l2tp remote-access client-ip-pool start 039;192.168.20.200039; # set vpn l2tp remote-access client-ip-pool stop 039;192.168.20.220039; # set vpn l2tp remote-access dns-servers server-1 039;10.10.20.1039; # set vpn l2tp remote-access ipsec-settings authentication mode 039;pre-shared-secret039; # set vpn l2tp remote-access ipsec-settings authentication pre-shared-secret 039;pre-shared-secret039; # set vpn l2tp remote-access ipsec-settings ike-lifetime 039;3600039; # set vpn l2tp remote-access outside-address 039;10.10.20.75039;
※vpn-user-passwodは任意のものを設定
※pre-shared-secretは任意のものを設定
KVMで同じethから出てる、3台目のサーバを追加してみたら下記のようなエラーでブツブツとVPNが切れて
パケロスが50%くらい出ました。
同じethが出てるのが問題なのかな・・・たぶん
Dec 14 00:45:12 vyatta01 pluto[20335]: packet from 10.10.20.76:500: Informational Exchange is for an unknown (expired?) SA