LoginSignup
5
5

More than 5 years have passed since last update.

aws VyOSを使用したPPTP接続

Last updated at Posted at 2015-11-01

aws vpc間通信時の設定メモ

やりたいこと

・VPCに対してクライアント(windows)からPPTP接続を行う

環境

VPCを用意

準備
VPC 10.0.0.0/16

VPC内にサブネットを用意

準備
publicサブネット
 10.0.100.0/24
privateサブネット
 10.0.200.0/24

publicサブネットにVyOS(ver1.05)を用意

準備
VPC のpublicサブネットにあるVyOSを用意
※マーケットプレイスからlaunch

VyOSにはeniを2つをアタッチしておく。

準備
VyOS
 public:eth0 10.0.100.123/24 
 private:eth1 10.0.200.123/24

※eniのsource dest.をすべて「無効化」にしておく。

VyOSのPublicのeni(eth0)にEIPを付与する

準備
VyOS - eth0:XXX.XXX.XXX.XXX

privateサブネットに疎通確認用のEC2(なんでもよい)を用意

準備
AmazonLinux 10.0.200.10

SecurityGroup

準備
VyOS A
 ・SSH ※source:自分の端末からのSSH接続
 ・GRE (IP Protocol 47) ※source:0.0.0.0/0
 ・UDP port500 ※source:0.0.0.0/0

AmazonLinux (疎通確認用なのでざっくり)
 ・ALL traffic ※source:10.0.0.0/16(VPC)

RouteTable

準備
privateサブネットのroutetableに
PPTPクライアントのアドレスプールに指定したIPへの通信はpublicサブネットのVyOSのeth1(eni-XXXXXXXX)を通る様、指定

ここからVyOS内の設定

eniを認識させる

VyOS-A_/etc/network/interfaces
以下追記
auto eth1
iface eth1 inet static
address 10.0.200.123
netmask 255.255.255.0

networkingを再起動

$sudo service networking restart

(EC2を再起動するとEIPに接続できなくなる?事象が発生したので、rc.localに以下を追記した。どなたか、詳しい方がいらっしゃいましたら仕組みを教えてください。)

/etc/rc.local
service networking restart

PPTP 設定

config
configure

#事前準備
MY_USER_NAME1=myuser1
MY_USER_PASSWORD1=myuser1
MY_USER_NAME2=myuser2
MY_USER_PASSWORD2=myuser2
MY_START_POOL_IP=10.0.100.1
MY_STOP_POOL_IP=10.0.100.100
MY_OUTSIDE_ADDRESS=10.0.100.123

set vpn pptp remote-access authentication mode local
set vpn pptp remote-access authentication local-users username $MY_USER_NAME1 password $MY_USER_PASSWORD1
set vpn pptp remote-access authentication local-users username $MY_USER_NAME2 password $MY_USER_PASSWORD2
set vpn pptp remote-access client-ip-pool start $MY_START_POOL_IP
set vpn pptp remote-access client-ip-pool stop $MY_STOP_POOL_IP
set vpn pptp remote-access outside-address $MY_OUTSIDE_ADDRESS
set vpn pptp remote-access dns-servers server-1 8.8.8.8
set vpn pptp remote-access dns-servers server-2 8.8.4.4

commit
save

windowsクライアントからPPTP接続を行い、
ローカルから接続確認用のec2に疎通が確認できればOK

5
5
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
5
5