Skip to content

Instantly share code, notes, and snippets.

@CLCL
CLCL / CentOS6-L2TP-IPsec.md
Last active September 26, 2022 18:21
L2TP/IPsec(AndroidやiPhoneからのVPN接続)を経路を用意すべくVPSにL2TP/IPsecサーバを設置するとき、ネットにある情報だとなかなかつながらないから、標準環境としてAWSのCentOS 6.3 x86_64 Release Media(ami-3fe8603e)の起動直後から最短距離で設定する方法をまとめた。

CentOS 6でとにかくL2TP/IPsecサーバ

  • AWSでEC2のインスタンスを借りる
  • 今回は東京リージョンのCentOS 6.3 x86_64 Release MediaのAIM(ami-3fe8603e)でインスタンスを建てる
  • Security Group: L2TP/IPsec(Inbound 22/TCP: SSH, 500/UDP: ISAKMP, 1701/UDP: L2TP, 4500/UDP: IPSec NAT Traversal)を許可
  • ec2-54-249-173-214.ap-northeast-1.compute.amazonaws.com(グローバルIPアドレス:54.249.173.214)にrootでログイン

SELinuxを無効にする

[root@ip-10-132-164-105 ~]# setenforce 0
@myaumyau
myaumyau / NumRefToString.js
Created February 18, 2013 03:55
[js]数値文字参照(16進数, 10進数)を文字列に変換
function hexNumRefToString(hexNumRef) {
return hexNumRef.replace(/&#x([0-9a-f]+);/ig, function(match, $1, idx, all) {
return String.fromCharCode('0x' + $1);
});
}
function decNumRefToString(decNumRef) {
return decNumRef.replace(/&#(\d+);/ig, function(match, $1, idx, all) {
return String.fromCharCode($1);
});
}