Thursday, October 4, 2007

[Linux] Ubuntu 上安裝 L2TP over IPSec VPN Server

1. Requirement:
l2tpd
openswan
ipsec-tools
ppp

2. Installation:
apt-get install openswan
apt-get install l2tpd
檢查是否已經安裝完成需要的package
dpkg --get-selections | grep -E "ipsec-tools|l2tp|openswan|ppp"
此時應該會出現
ipsec-tools install
l2tpd install
openswan install
ppp install

3. Configuration
設定帳號與密碼
vi /etc/ppp/chap-secrets
Ex : username * password *
設定l2tpd設定檔
vi /etc/l2tpd/l2tpd.conf
Ex :
[global]
auth file = /etc/ppp/chap-secrets
[lns default]
ip range = 192.168.1.1-192.168.1.20
local ip = 192.168.1.2
require chap = yes
refuse pap = yes
require authentication = yes
name = ubuntuVPNServer
ppp debug = yes
pppoptfile = /etc/ppp/options.l2tpd.lns
flow bit = yes
設定/etc/ppp/options.l2tpd.lns
vi /etc/ppp/options.l2tpd.lns
Ex :
ipcp-accept-local
ipcp-accept-remote
ms-dns 192.168.1.1
ms-dns 192.168.1.3
ms-wins 192.168.1.2
ms-wins 192.168.1.4
noccp
auth
crtscts
idle 1800
nodefaultroute
debug
lock
proxyarp
connect-delay 5000
logfile /var/log/l2tpd.log
設定IPSec
ipsec newhostkey -outfile /etc/ipsec.secrets
vi /etc/ipsec.secrets
Ex :
include /etc/ipsec.d/*.secrets
10.1.233.233 %any : PSK "1234567890"
設定l2tp-psk.conf
cp /etc/ipsec.d/examples/l2tp-psk.conf /etc/ipsec.d/
chmod 755 /etc/ipsec.d/l2tp-psk.conf

4. Start Service
啟動L2TP Server
/etc/init.d/l2tpd restart
啟動IPSec
/etc/init.d/ipsec restart

5. Check IPSEC status
ipsec verify
如果出現
Two or more interfaces found, checking IP forwarding [FAILED]
檢查 /proc/sys/net/ipv4/ip_forward 裏面的值是不是1,如果是0的話
vi /etc/sysctl.conf
加入
net.ipv4.ip_forward = 1
sysctl -p


未完,待續

ref:

http://go-linux.blogspot.com/2007/08/setup-l2tp-over-ipsec-vpn-server-on.html

Tuesday, October 2, 2007

[glftpd] compile eggdrop 1.6.18 ssl on redhat linux

1. 下載eggdrop的source
wget ftp://ftp.eggheads.org/pub/eggdrop/source/1.6/eggdrop1.6.18.tar.bz2
wget http://www.egghelp.org/files/patches/eggdrop-1.6.18-ssl.patch.gz

2. 解壓縮source
tar -zxvf eggdrop1.6.18.tar.gz
gzip -d eggdrop-1.6.18-ssl.patch.gz

3. Compile eggdrop
cd eggdrop1.6.18
patch -p0 < ../eggdrop-1.6.18-ssl.patch
./configure --with-ssl=/path/to/openssl/
make config
make
make install

4. 在eggdrop.conf中加入"set use-ssl 1",開啟SSL

ref :
http://remus.oru.se/tsub/eggdrop-ssl/

Monday, October 1, 2007

[MAC] MAC MINI 拆機




ref :
http://www.centurys.net/viewthread.php?tid=1269&sid=lb1zXk

[MAC] 讓終端機正確顯示輸入的 Unicode 中文

在Home Directory,新增.inputrc這個檔案

檔案內容如下:

set convert-meta off
set meta-flag on
set output-meta on


ref :
http://www.frostyplace.com/index.php?story_id=1092
http://docs.info.apple.com/article.html?artnum=107258

[MAC] OSX Compile pftpfxp-mew edition

compile pftpfxp 需要用到 pthreads library,但是OSX並沒有這東西,因為已經build in Darwin kernel了,所以要修改Makefile之後才能完成compile.

做法如下:

cd ~/Desktop
tar xvzf pftpfxp-v0.11.4mew6.tgz
cd ~/Desktop/pftpfxp-mew/
./configure bsd
vi ~/Desktop/pftpfxp-mew/src/Makefile
找到這一行"LINKFLAGS = -pthread -lpanel -lncurses"
然後把-pthread拿掉
make static 或是 make dynamic

ref :
http://www.macosxhints.com/article.php?story=20040413105107877