<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>张微波的BLOG</title>
<link>http://blog.5ilinux.com/</link>
<description></description>
<language>en</language>
<copyright>Copyright 2007</copyright>
<lastBuildDate>Tue, 07 Aug 2007 22:39:37 +0800</lastBuildDate>
<generator>http://www.movabletype.org/?v=3.33</generator>
<docs>http://blogs.law.harvard.edu/tech/rss</docs> 

<item>
<title>postfix FAQ (2)</title>
<description><![CDATA[<p>问题一：<br />
Aug  7 22:26:22 mail postfix/smtpd[16829]: warning: xsasl_cyrus_server_get_mechanism_list: no applicable SASL mechanisms<br />
Aug  7 22:26:22 mail postfix/smtpd[16829]: fatal: no SASL authentication mechanisms<br />
Aug  7 22:26:23 mail postfix/master[16825]: warning: process /usr/libexec/postfix/smtpd pid 16829 exit status 1<br />
Aug  7 22:26:23 mail postfix/master[16825]: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling<br />
Aug  7 22:28:06 mail postfix/smtpd[16830]: warning: xsasl_cyrus_server_get_mechanism_list: no applicable SASL mechanisms<br />
Aug  7 22:28:06 mail postfix/smtpd[16830]: fatal: no SASL authentication mechanisms<br />
Aug  7 22:28:07 mail postfix/master[16825]: warning: process /usr/libexec/postfix/smtpd pid 16830 exit status 1</p>

<p>解决方法：</p>

<p># ln -s /usr/local/lib/sasl2 /usr/lib/sasl2</p>

<p></p>

<p>问题二：<br />
Jan 15 20:24:43 localhost postfix/smtpd[3048]: warning: SASL authentication problem: unable to open Berkeley db /etc/sasldb2: No such file or directory</p>

<p>原因:系统已经安装sasl-cyrus 删除掉，然后编译重装</p>]]></description>
<link>http://blog.5ilinux.com/archives/2007/08/postfix_faq_1.html</link>
<guid>http://blog.5ilinux.com/archives/2007/08/postfix_faq_1.html</guid>
<category>mail</category>
<pubDate>Tue, 07 Aug 2007 22:39:37 +0800</pubDate>
</item>
<item>
<title>mysql,php升级笔记</title>
<description><![CDATA[<p>1:mysql 5.0.45</p>

<p>useradd -M -o -r -d /www/mysql -s /bin/bash -c "MySQL Server" -u 27 mysql</p>

<p>./configure --prefix=/usr/local/mysql5 --sysconfdir=/etc --enable-assembler --with-mysqld-ldflags=-all-static --localstatedir=/www/mysql --with-big-tables --with-low-memory --with-extra-charsets=all --enable-thread-safe-client</p>

<p>make</p>

<p>make install</p>

<p>cp support-files/my-large.cnf /etc/my.cnf  (针对512M的,不同的内存有不同的配置文件)</p>

<p>cp support-files/mysql.server /etc/rc.d/init.d/mysqld5</p>

<p>chmod 755 /etc/rc.d/init.d/mysqld</p>

<p>chkconfig --add mysqld</p>

<p>/usr/local/mysql5/bin/mysql_install_db --user=mysql</p>

<p><br />
vi /etc/ld.so.conf</p>

<p>增加   <br />
/usr/local/mysql5/lib/mysql/</p>

<p>保存ldconfig</p>

<p><br />
修改 /etc/profile</p>

<p>export PATH=$PATH:/usr/local/mysql5/bin</p>

<p>设置密码</p>

<p>mysqladmin -u root password 'password'</p>

<p><br />
2:iconv</p>

<p>wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.11.tar.gz</p>

<p>./configure --prefix=/usr<br />
make<br />
make install</p>

<p>ldconfig</p>

<p>3:gd</p>

<p>wget http://www.libgd.org/releases/gd-2.0.35.tar.gz<br />
./configure<br />
make<br />
make install</p>

<p>4:t1lib</p>

<p>./configure</p>

<p>make without_doc<br />
make install</p>

<p></p>

<p>5:freetds</p>

<p>wget ftp://ftp.ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz</p>

<p>tar zvxf freetds-stable.tgz<br />
cd freetds-0.64<br />
./configure --prefix=/usr/local/freetds --with-tdsver=8.0 --enable-msdblib<br />
make<br />
make install</p>

<p><br />
6:libxm2</p>

<p>wget ftp://xmlsoft.org/libxml2/libxml2-sources-2.6.29.tar.gz</p>

<p>./configure<br />
make<br />
make install</p>

<p><br />
7:php</p>

<p>./configure --prefix=/usr/local/php5 --enable-exif --with-iconv=/usr --with-xml=/usr/local --with-curl=/usr --with-gdbm --with-gettext --enable-track-vars --with-calendar=shared --enable-magic-quotes --enable-trans-sid --enable-wddx --enable-ftp --enable-inline-optimization --with-gd=/usr/local --with-zlib --enable-gd-native-tt --with-t1lib=/usr/local --with-jpeg-dir=/usr --with-zlib-dir=/usr --with-ttf --with-freetype-dir=/usr --with-gd --with-png-dir=/usr --with-jpeg-dir=/usr --with-mysql=/usr/local/mysql5 --enable-force-cgi-redirect --with-apxs2=/usr/local/apache2/bin/apxs --with-mssql=/usr/local/freetds --with-pdo-mysql=/usr/local/mysql5</p>

<p>修改httpd.conf</p>

<p>AddType application/x-httpd-php .php<br />
AddType application/x-httpd-php-source .phps</p>

<p>修改默认首页 index.php</p>

<p>cp php.ini-dist /usr/local/php5/lib/php.ini</p>

<p>修改php.ini文件<br />
register_globals = On<br />
</p>]]></description>
<link>http://blog.5ilinux.com/archives/2007/08/mysqlphp.html</link>
<guid>http://blog.5ilinux.com/archives/2007/08/mysqlphp.html</guid>
<category>linux</category>
<pubDate>Thu, 02 Aug 2007 09:29:11 +0800</pubDate>
</item>
<item>
<title>zhangweibo.cn居然也有人抢注</title>
<description><![CDATA[<p>易名中国太缺德，赚钱赚到这种程度，咳！ 本来zhangweibo这个名字就少，这不是明显的针对我吗，气死我了！！！！！！！</p>]]></description>
<link>http://blog.5ilinux.com/archives/2007/07/zhangweibocn.html</link>
<guid>http://blog.5ilinux.com/archives/2007/07/zhangweibocn.html</guid>
<category>essay</category>
<pubDate>Fri, 27 Jul 2007 11:33:37 +0800</pubDate>
</item>
<item>
<title>爱唠叨</title>
<description><![CDATA[<p><a href="http://www.ilaodao.cn">http://www.ilaodao.cn</a>很有特色的twritter中国版克隆，虽然国内已经有很多了，但这个网站做的也相对来说不错</p>]]></description>
<link>http://blog.5ilinux.com/archives/2007/07/post_13.html</link>
<guid>http://blog.5ilinux.com/archives/2007/07/post_13.html</guid>
<category>bookmark</category>
<pubDate>Tue, 24 Jul 2007 18:05:07 +0800</pubDate>
</item>
<item>
<title>RHEL 5 安装 序列号</title>
<description><![CDATA[<p>RHEL 5 安装 序列号</p>

<p><br />
Server:</p>

<p>* Red Hat Enterprise Linux (Server including virtualization):<br />
2515dd4e215225dd</p>

<p>+ Red Hat Enterprise Linux Virtualization Platform:<br />
49af89414d147589</p>

<p>Client:</p>

<p>* Red Hat Enterprise Linux Desktop:<br />
660266e267419c67</p>

<p>+ Red Hat Enterprise Linux Desktop + Workstation Option:<br />
da3122afdb7edd23</p>

<p>+ Red Hat Enterprise Linux Desktop + Workstation + DualOS Option<br />
(Virtualization):<br />
7fcc43557e9bbc42</p>

<p>+ Red Hat Enterprise Linux Desktop + DualOS Option (Virtualization):<br />
fed67649ff918c77</p>

<p>测试过，可行！<br />
</p>]]></description>
<link>http://blog.5ilinux.com/archives/2007/07/rhel_5.html</link>
<guid>http://blog.5ilinux.com/archives/2007/07/rhel_5.html</guid>
<category>linux</category>
<pubDate>Fri, 20 Jul 2007 17:37:48 +0800</pubDate>
</item>
<item>
<title>bind9编译笔记</title>
<description><![CDATA[<p>tar zxvf bind-9.3.2-P1.tar.gz<br />
cd bind-9.3.2-P1<br />
./configure --prefix=/usr/local/named --enable-threads --disable-openssl-version-check</p>

<p>或者<br />
./configure --prefix=/usr/local/named --enable-threads --with-openssl=/usr/local/openssl</p>

<p>make<br />
make install</p>

<p>--enable-threads 开启多线程支持</p>

<p>groupadd bind<br />
useradd -g bind -d /usr/local/named -s /sbin/nologin bind</p>

<p>cd /usr/local/named</p>

<p>mkdir etc</p>

<p>sbin/rndc-confgen > etc/rndc.conf</p>

<p>cd etc </p>

<p>tail -10 rndc.conf | head -9 | sed s/#\ //g > named.conf</p>

<p><br />
mkdir /usr/local/named/var</p>

<p>chmod 777 /usr/local/named/var</p>

<p><br />
cd /usr/local/named/var</p>

<p>vi localhost.zone</p>

<p><br />
$TTL    86400 <br />
$ORIGIN localhost. <br />
@                       1D IN SOA       @ root ( <br />
                                        42              ; serial (d. adams) <br />
                                        3H              ; refresh <br />
                                        15M             ; retry <br />
                                        1W              ; expiry <br />
                                        1D )            ; minimum <br />
                        1D IN NS        @ <br />
                        1D IN A         127.0.0.1</p>

<p>建立named.local文件 <br />
vi named.local </p>

<p><br />
$TTL    86400 <br />
@       	IN      SOA     localhost. root.localhost.  ( <br />
                                      1997022700 ; Serial <br />
                                      28800      ; Refresh <br />
                                      14400      ; Retry <br />
                                      3600000    ; Expire <br />
                                      86400 )    ; Minimum <br />
		IN      NS      localhost. </p>

<p>1       	IN      PTR     localhost. </p>

<p></p>

<p>dig命令直接生成named.root文件</p>

<p>dig > named.root</p>

<p><br />
vi common.zone<br />
内容如下</p>

<p>zone "." IN {<br />
        type hint;<br />
        file "named.root";<br />
};</p>

<p>zone "localhost" IN {<br />
        type master;<br />
        file "localhost.zone";<br />
        allow-update { none; };<br />
};</p>

<p>zone "0.0.127.in-addr.arpa" IN {<br />
        type master;<br />
        file "named.local";<br />
        allow-update { none; };<br />
};</p>

<p>vi /usr/local/named/etc/named.conf<br />
主要内容如下</p>

<p>options {<br />
directory "/usr/local/named/var";<br />
pid-file "named.pid";<br />
version "I am bind";<br />
listen-on {x.x.x.x;};<br />
};</p>

<p>controls {<br />
        inet 127.0.0.1 port 953<br />
                allow { 127.0.0.1; } keys { "rndc-key"; };<br />
};</p>

<p>include "common.zone";</p>

<p><br />
chown -R bind:bind /usr/local/named</p>

<p>启动服务测试一下<br />
/usr/local/named/sbin/named  -c /usr/local/named/etc/named.conf -u bind &</p>

<p><br />
查看状态</p>

<p>/usr/local/named/sbin/rndc status</p>

<p><br />
为了方便建立启动脚本： </p>

<p>vi /etc/rc.d/init.d/named</p>

<p>#!/bin/bash <br />
# named a network name service. <br />
# chkconfig: 545 35 75 <br />
# description: a name server </p>

<p>if [ `id -u` -ne 0 ]<br />
then<br />
echo "ERROR:For bind to port 53,must run as root." <br />
exit 1<br />
fi<br />
case "$1" in<br />
start)<br />
if [ -x /usr/local/named/sbin/named ]; then<br />
/usr/local/named/sbin/named -c /usr/local/named/etc/named.conf -u bind && echo . && echo 'BIND9 server started' <br />
fi<br />
;;<br />
stop)<br />
kill `cat /usr/local/named/var/named.pid` && echo . && echo 'BIND9 server stopped' <br />
;;<br />
restart)<br />
echo . <br />
echo "Restart BIND9 server" <br />
$0 stop<br />
sleep 10<br />
$0 start<br />
;;<br />
reload)<br />
/usr/local/named/sbin/rndc reload<br />
;;<br />
status)<br />
/usr/local/named/sbin/rndc status<br />
;;<br />
*)<br />
echo "$0 start | stop | restart |reload |status" <br />
;;<br />
esac</p>

<p><br />
chmod 755 /etc/rc.d/init.d/named</p>

<p>***********************************************************************<br />
***********************************************************************</p>

<p>加入log配置</p>

<p>mkdir /usr/local/named/log</p>

<p>vi /usr/local/named/var/log.conf</p>

<p>logging {<br />
         channel warning<br />
         { file "/usr/local/named/log/dns_warnings" versions 3 size 100m;<br />
         severity warning;<br />
         print-category yes;<br />
         print-severity yes;<br />
         print-time yes;<br />
         };<br />
         channel general_dns<br />
         { file "/usr/local/named/log/dns_logs" versions 3 size 100m;<br />
         severity info;<br />
         print-category yes;<br />
         print-severity yes;<br />
         print-time yes;<br />
         };<br />
         category default { warning; };<br />
         category queries { general_dns; };<br />
};</p>

<p><br />
chown -R bind:bind /usr/local/named </p>

<p></p>

<p>说明：<br />
1：print-time是设定在日志中是否需要写入时间，print-severity是设定在日志中是否需要写入消息级别，print-category是设定在日志中是否需要写入日志类别。<br />
2：severity是指定记录消息的级别。在bind中主要有以下几个级别（按照严重性递减的顺序）：</p>

<p>critical<br />
error<br />
warning<br />
notice<br />
info<br />
debug [ level ]<br />
dynamic</p>

<p>定义了某个级别后，系统会记录包括该级别以及比该级别更严重的级别的所有消息。比如定义级别为error，则会记录critical和error两个级别的信息。一般情况下，我们记录到info级别就可以了。</p>

<p></p>

<p>然后在/usr/local/named/etc/named.conf 加入下列语句</p>

<p>include "log.conf";</p>

<p><br />
/usr/local/named/sbin/rndc reconfig</p>

<p>默认是不启用日志的，你可以通过</p>

<p>/usr/local/named/sbin/rndc status</p>

<p>看到：<br />
query logging is OFF</p>

<p>所以我们用以下命令启用log日志</p>

<p>/usr/local/named/sbin/rndc querylog<br />
</p>]]></description>
<link>http://blog.5ilinux.com/archives/2007/01/bind9.html</link>
<guid>http://blog.5ilinux.com/archives/2007/01/bind9.html</guid>
<category>linux</category>
<pubDate>Tue, 16 Jan 2007 22:45:02 +0800</pubDate>
</item>
<item>
<title>bind9的部分FAQ</title>
<description><![CDATA[<p>log日志报如下错误：</p>

<p>27-Dec-2006 23:02:57.118 general: error: dns_master_load: localhost.zone:2: unexpected end of line<br />
27-Dec-2006 23:02:57.118 general: error: dns_master_load: localhost.zone:1: unexpected end of input<br />
27-Dec-2006 23:02:57.118 general: error: zone localhost/IN: loading master file localhost.zone: unexpected end of input</p>

<p>解决办法：</p>

<p>localhost.zone配置文件里TTL前加上$</p>

<p><br />
</p>]]></description>
<link>http://blog.5ilinux.com/archives/2006/12/bind9faq.html</link>
<guid>http://blog.5ilinux.com/archives/2006/12/bind9faq.html</guid>
<category>linux</category>
<pubDate>Wed, 27 Dec 2006 23:15:18 +0800</pubDate>
</item>
<item>
<title>process `named&apos; is using obsolete setsockopt SO_BSDCOMPAT</title>
<description><![CDATA[<p>今天安装bind 9.3.3，成功安装后，message报如下错误<br />
process `named' is using obsolete setsockopt SO_BSDCOMPAT</p>

<p>解决办法：</p>

<p>将Bind得tar包解压后,在其/lib/isc/unix/socket.c里面找到需要修改的代码:<br />
首先找到这个 (在1297行附近):</p>

<p>        #if defined(USE_CMSG) || defined(SO_BSDCOMPAT)<br />
                int on = 1;</p>

<p>改成:<br />
        #if defined(USE_CMSG)<br />
                int on = 1;</p>

<p><br />
************************************************************<br />
 #ifdef SO_BSDCOMPAT<br />
        if (setsockopt(sock->fd, SOL_SOCKET, SO_BSDCOMPAT,<br />
                       (void *)&on, sizeof on) < 0) {<br />
                isc__strerror(errno, strbuf, sizeof(strbuf));<br />
                UNEXPECTED_ERROR(__FILE__, __LINE__,<br />
                                 "setsockopt(%d, SO_BSDCOMPAT) %s: %s",<br />
                                 sock->fd,<br />
                                 isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,<br />
                                                ISC_MSG_FAILED, "failed"),<br />
                                 strbuf);</p>

<p><br />
                /* Press on... /*<br />
        }<br />
 #endif</p>]]></description>
<link>http://blog.5ilinux.com/archives/2006/12/process_named_i.html</link>
<guid>http://blog.5ilinux.com/archives/2006/12/process_named_i.html</guid>
<category>linux</category>
<pubDate>Wed, 27 Dec 2006 22:59:30 +0800</pubDate>
</item>
<item>
<title>Perl 语言编程 第三版 在线版本</title>
<description><![CDATA[<p>不知道这个在线版的Perl 语言编程 第三版是不是人们常说的大骆驼版本，大骆驼可是绝版好多年了，一本最好的perl语言学习的教材。反正我是没买到：）</p>

<p>买不到就先看在线版的吧，希望是同一本</p>

<p><a href="http://www.pgsqldb.org/twiki/bin/view/Perl/PerlProgramming3">Perl 语言编程</a></p>

<p>作者:Larry Wall, Tom Christiansen, and Jon Orwant 译者:何伟平</p>]]></description>
<link>http://blog.5ilinux.com/archives/2006/08/perl.html</link>
<guid>http://blog.5ilinux.com/archives/2006/08/perl.html</guid>
<category>bookmark</category>
<pubDate>Wed, 23 Aug 2006 10:21:55 +0800</pubDate>
</item>
<item>
<title>OpenVPN 2.0 HOWTO-局域网互访（翻译）</title>
<description><![CDATA[<p>原文:<a href="http://openvpn.net/howto.html">http://openvpn.net/howto.html</a><br />
翻译水平有限,许多地方都可能翻译的不当,请大家指教<br />
部分标题保留英文，没有翻译</p>

<p><strong>Expanding the scope of the VPN to include additional machines on either the client or server subnet.</strong></p>

<p><strong>Including multiple machines on the server side when using a routed VPN (dev tun)</strong></p>

<p>一旦VPN以一种客户端和服务端点对点的方式运作，那么就应该扩大范围，客户端不止能访问服务器，而且应该能访问服务器所在的网络的其他机器。</p>

<p>针对这个目的，我们举个例子，假设服务器的内网端使用的是10.66.0.0/24的网段，在OpenVPN服务器配置文件配置的server参数即VPN虚拟IP地址池用的是10.8.0.0/24网段。</p>

<p>首先，VPN客户端通过VPN能访问到<strong>10.66.0.0/24 </strong>子网，只只要在服务器端的配置文件配置以下参数就能简单做到：</p>

<blockquote>push "route 10.66.0.0 255.255.255.0"</blockquote>

<p>下一步，我们要把服务器端局域内网的网关设置为从VPN客户端<strong>10.8.0.0/24</strong>网段到OpenVPN服务器的路由（假如OpenVPN服务器和局域网网关不是同一台机器，这个设置就很有必要）。</p>

<p>下一步，我们要为从VPN客户端<strong>10.8.0.0/24</strong>网段到OpenVPN服务器所在的局域网的网关设置一个路由（假如OpenVPN服务器和局域网网关不是同一台机器，这个设置就很有必要）。</p>

<p><br />
确认你应在在OpenVPN服务器上打开<a href="http://openvpn.net/faq.html#ip-forward">IP</a> 和 <a href="http://openvpn.net/faq.html#firewall">TUN/TAP</a> 的转发功能。</p>

<p><strong>Including multiple machines on the server side when using a bridged VPN (dev tap)</strong></p>

<p>使用<a href="http://openvpn.net/bridge.html">以太网桥</a> 的好处就是你可以方便，免费的获得它，而无需其他额外的配置。</p>

<p><strong>Including multiple machines on the client side when using a routed VPN (dev tun)</strong></p>

<p>一般典型的远程访问情况是，客户端都是以单机使用VPN。但是如果客户端是本地局域网的网关（如总公司）你希望每台在这个局域网的机器都能通过路由使用VPN。</p>

<p>举个例子，我们假设这个客户端的局域网使用的是<strong>192.168.4.0/24</strong>的子网，并且那个VPN客户端有一个通用名为<strong>client2</strong>的证书，我们的目的就是设置一个VPN通道，让客户端局域网内的所有机器能跟OpenVPN服务器局域网端的所有机器相互联系。<br />
安装之前，有一些必须遵守的基本前提：</p>

<p>1:客户端局域网的子网(在我们这个例子中是192.168.4.0/24)不能通过在同一网段的服务器或者其他客户端站点的途径加入到VPN。任何一个子网想加入VPN的通道路由必须是唯一的。<br />
2:客户端必须拥有一个唯一的通用名称在其证书中（我们这个例子叫“client2”），而且<strong>duplicate-cn</strong> 这个参数不能在OpenVPN服务器的配置文件里被启用。 </p>

<p>首先，我们必须确信客户端的<a href="http://openvpn.net/faq.html#ip-forward">IP</a> 和 <a href="http://openvpn.net/faq.html#firewall">TUN/TAP</a>转发功能是打开的。</p>

<p>然后，我们将处理服务器端的配置文件进行一个必要的修改配置，假如服务器配置文件没有提到客户端配置文件的目录，那么添加如下一行。</p>

<blockquote>client-config-dir ccd</blockquote>

<p>上述指令表示，在一个运行的OpenVPN服务器上的默认目录下预先建立一个叫<strong>ccd</strong>的目录。 在Linux下默认目录是<strong>/etc/openvpn</strong> 而在Windows下，则是<strong>\Program Files\OpenVPN\config</strong>当一个新的客户端连接OpenVPN服务器的时候，服务器进程会针对客户端证书中的匹配通用名称来检查这个目录，如果找到与之匹配的文件，就会对这个客户端进行额外配置的处理。</p>

<p>下一步，我们要建立一个名叫 <strong>client2</strong> 的文件在<strong>ccd</strong> 目录下，在这个文件里有如下的控制语句：<br />
 <br />
<blockquote>iroute 192.168.4.0 255.255.255.0</blockquote></p>

<p>这样，OpenVPN服务器就把192.168.4.0/24 网段的路由添加给<strong>client2</strong></p>

<p>下一步，在服务器端的主配置文件上添加如下语句(不是<strong>ccd/client2</strong> 这个文件):</p>

<blockquote>route 192.168.4.0 255.255.255.0</blockquote>

<p>你可能会问？为什么要有 <strong>route</strong> 和 <strong>iroute</strong> 这多余重复的设置？ 理由是在iroute 控制从OpenVPN服务器到远程客户端的路由的时候，route控制着从内核到OpenVPN服务器（通过TUN接口）。两者都很重要。</p>

<p>下一步，问问你自己是否允许client2的网段（192.168.4.0/24）和OpenVPN服务器的其他客户之间有网络流量交换，如果是的话，那就在服务器的配置文件中添加如下语句：</p>

<blockquote>client-to-client</blockquote>
<blockquote>push "route 192.168.4.0 255.255.255.0"</blockquote>

<p>这将让OpenVPN服务器为client2客户网段跟其他连接的客户端进行广播通知。</p>

<p>最后一步，这一步经常会忘记，那就是为服务器局域网的网关添加一个直接从192.168.4.0/24到OpenVPN的路由（你可能不需要这一步，假如本身OpenVPN服务器就是这个服务器端局域网的网关）。假如你忘了这一步的设置，当尝试从192.168.4.8机器ping一个在服务器局域网内的机器（非OpenVPN自己ping自己），会输出一个不能到达机器的提示。 但是我们不能不知道如果路由一个ping的回复，因为我们根本不知道怎么到达192.168.4.0/24。 通常的经验做法是，在整个局域网路线通过VPN通道的时候（VPN服务器不是这个局域网的网关机器）之前，我们得保证所有VPN客户端网段到服务器端局域网网关的路由路径。</p>

<p>同样，如果客户端机器运行OpenVPN，而且也不是它本身局域网的网关，那么也得为那台提供其他机器可以通过VPN访问客户端所在局域网途径的机器设置一个从客户端机器到局域网网关的路由。</p>

<p><strong>Including multiple machines on the client side when using a bridged VPN (dev tap)</strong></p>

<p>这个需要更加复杂的设置（实际上可能并不复杂，但要去解释阐述会很复杂）：</p>

<p>1:你必须把客户端的TAP虚拟网络接口和客户端本地网卡进行桥接。 <br />
2:你必须手动为客户端的TAP虚拟网络接口设置IP/掩码。 <br />
3:你必须设置客户端的机器使用网桥所在网段的IP地址和掩码，可能会 <a href="http://openvpn.net/INSTALL-win32.html#dhcp">查询OpenVPN服务器这边的DHCP服务</a>。 <br />
</p>]]></description>
<link>http://blog.5ilinux.com/archives/2006/08/openvpn_20_howt_5.html</link>
<guid>http://blog.5ilinux.com/archives/2006/08/openvpn_20_howt_5.html</guid>
<category>VPN</category>
<pubDate>Tue, 22 Aug 2006 21:48:46 +0800</pubDate>
</item>
<item>
<title>openvpn的妙用：wap包月配合openvpn享受掌中宽带</title>
<description><![CDATA[<p>今天访问<a href="http://www.51nb.com">51nb</a>网,无意中发现这里的网络技术区也有很多朋友在讨论openvpn技术，不过他们用openvpn大部分是用来配合廉价的wap包月来享受昂贵的掌中宽带。挺有创意。下面是其中的示意图</p>

<p><img alt="wirelesswappic1.gif" src="http://blog.5ilinux.com/archives/images/wirelesswappic1.gif" width="500" height="287" /></p>

<p><br />
具体文章看这里：<a href="http://www.51nb.com/forum/thread-405485-1-5.html">WAP包月配合VPN上网原理简介</a></p>]]></description>
<link>http://blog.5ilinux.com/archives/2006/08/openvpnopenvpn.html</link>
<guid>http://blog.5ilinux.com/archives/2006/08/openvpnopenvpn.html</guid>
<category>VPN</category>
<pubDate>Tue, 22 Aug 2006 10:25:41 +0800</pubDate>
</item>
<item>
<title>OpenVPN的视频</title>
<description><![CDATA[<p>网上闲逛，找到香港兄弟做的关于openvpn的视频，正好最近我也在研究openvpn，所以下来参考一下。</p>

<p>嘿嘿，是粤语的，幸亏以前经常看粤语片，还能马马虎虎听懂</p>

<p>有兴趣的朋友也可以去以下网站下载</p>

<p><a href="http://openclassroom.samba.hk/050707A.rmvb">openvpn的应用视频一</a></p>

<p><a href="http://openclassroom.samba.hk/050707B.rmvb">openvpn的应用视频二</a></p>

<p><a href="http://www.samba.hk/SambaHongKongNews/openvpn.pdf">相关pdf文档</a></p>]]></description>
<link>http://blog.5ilinux.com/archives/2006/08/openvpn.html</link>
<guid>http://blog.5ilinux.com/archives/2006/08/openvpn.html</guid>
<category>VPN</category>
<pubDate>Sun, 20 Aug 2006 08:45:12 +0800</pubDate>
</item>
<item>
<title>OpenVPN 2.0 HOWTO-进程管理和管理接口(翻译)</title>
<description><![CDATA[<p>原文:<a href="http://openvpn.net/howto.html">http://openvpn.net/howto.html</a><br />
翻译水平有限,许多地方都可能翻译的不当,请大家指教</p>

<p><br />
Configuring OpenVPN to run automatically on system startup</p>

<p>The lack of standards in this area means that most OSes have a different way of configuring daemons/services for autostart on boot. The best way to have this functionality configured by default is to install OpenVPN as a package, such as via RPM on Linux or using the Windows installer.</p>

<p>Linux<br />
If you install OpenVPN via an RPM package on Linux, the installer will set up an initscript. When executed, the initscript will scan for .conf configuration files in /etc/openvpn, and if found, will start up a separate OpenVPN daemon for each file.</p>

<p>Windows<br />
The Windows installer will set up a Service Wrapper, but leave it turned off by default. To activate it, go to Control Panel / Administrative Tools / Services, select the OpenVPN service, right-click on properties, and set the Startup Type to Automatic. This will configure the service for automatic start on the next reboot.</p>

<p>When started, the OpenVPN Service Wrapper will scan the \Program Files\OpenVPN\config folder for .ovpn configuration files, starting a separate OpenVPN process on each file.</p>

<p><br />
--------------------------------------------------------------------------------</p>

<p>Controlling a running OpenVPN process</p>

<p>Running on Linux/BSD/Unix</p>

<p>OpenVPN accepts several signals:</p>

<p>SIGUSR1 -- Conditional restart, designed to restart without root privileges <br />
SIGHUP -- Hard restart <br />
SIGUSR2 -- Output connection statistics to log file or syslog <br />
SIGTERM, SIGINT -- Exit </p>

<p>Use the writepid directive to write the OpenVPN daemon's PID to a file, so that you know where to send the signal (if you are starting openvpn with an initscript, the script may already be passing a --writepid directive on the openvpn command line).</p>

<p>Running on Windows as a GUI<br />
See the OpenVPN GUI page.</p>

<p>Running in a Windows command prompt window</p>

<p>On Windows, you can start OpenVPN by right clicking on an OpenVPN configuration file (.ovpn file) and selecting "Start OpenVPN on this config file".</p>

<p>Once running in this fashion, several keyboard commands are available:</p>

<p>F1 -- Conditional restart (doesn't close/reopen TAP adapter) <br />
F2 -- Show connection statistics <br />
F3 -- Hard restart <br />
F4 -- Exit </p>

<p>Running as a Windows Service<br />
When OpenVPN is started as a service on Windows, the only way to control it is:</p>

<p>Via the service control manager (Control Panel / Administrative Tools / Services) which gives start/stop control. <br />
Via the management interface (see below). </p>

<p>Modifying a live server configuration</p>

<p>While most configuration changes require you to restart the server, there are two directives in particular which refer to files which can be dynamically updated on-the-fly, and which will take immediate effect on the server without needing to restart the server process.</p>

<p>client-config-dir -- This directive sets a client configuration directory, which the OpenVPN server will scan on every incoming connection, searching for a client-specific configuration file (see the the manual page for more information). Files in this directory can be updated on-the-fly, without restarting the server. Note that changes in this directory will only take effect for new connections, not existing connections. If you would like a client-specific configuration file change to take immediate effect on a currently connected client (or one which has disconnected, but where the server has not timed-out its instance object), kill the client instance object by using the management interface (described below). This will cause the client to reconnect and use the new client-config-dir file.</p>

<p>crl-verify -- This directive names a Certificate Revocation List file, described below in the Revoking Certificates section. The CRL file can be modified on the fly, and changes will take effect immediately for new connections, or existing connections which are renegotiating their SSL/TLS channel (occurs once per hour by default). If you would like to kill a currently connected client whose certificate has just been added to the CRL, use the management interface (described below).</p>

<p>Status File</p>

<p>The default server.conf file has a line</p>

<p>status openvpn-status.log</p>

<p>which will output a list of current client connections to the file openvpn-status.log once per minute.</p>

<p>Using the management interface</p>

<p>The OpenVPN management interface allows a great deal of control over a running OpenVPN process. You can use the management interface directly, by telneting to the management interface port, or indirectly by using an OpenVPN GUI which itself connects to the management interface.</p>

<p>To enable the management interface on either an OpenVPN server or client, add this to the configuration file:</p>

<p>management localhost 7505</p>

<p>This tells OpenVPN to listen on TCP port 7505 for management interface clients (port 7505 is an arbitrary choice -- you can use any free port).</p>

<p>Once OpenVPN is running, you can connect to the management interface using a telnet client. For example:</p>

<p>ai:~ # telnet localhost 7505<br />
Trying 127.0.0.1...<br />
Connected to localhost.<br />
Escape character is '^]'.<br />
>INFO:OpenVPN Management Interface Version 1 -- type 'help' for more info<br />
help<br />
Management Interface for OpenVPN 2.0_rc14 i686-suse-linux [SSL] [LZO] [EPOLL] built on Feb 15 2005<br />
Commands:<br />
echo [on|off] [N|all]  : Like log, but only show messages in echo buffer.<br />
exit|quit              : Close management session.<br />
help                   : Print this message.<br />
hold [on|off|release]  : Set/show hold flag to on/off state, or<br />
                         release current hold and start tunnel.<br />
kill cn                : Kill the client instance(s) having common name cn.<br />
kill IP:port           : Kill the client instance connecting from IP:port.<br />
log [on|off] [N|all]   : Turn on/off realtime log display<br />
                         + show last N lines or 'all' for entire history.<br />
mute [n]               : Set log mute level to n, or show level if n is absent.<br />
net                    : (Windows only) Show network info and routing table.<br />
password type p        : Enter password p for a queried OpenVPN password.<br />
signal s               : Send signal s to daemon,<br />
                         s = SIGHUP|SIGTERM|SIGUSR1|SIGUSR2.<br />
state [on|off] [N|all] : Like log, but show state history.<br />
status [n]             : Show current daemon status info using format #n.<br />
test n                 : Produce n lines of output for testing/debugging.<br />
username type u        : Enter username u for a queried OpenVPN username.<br />
verb [n]               : Set log verbosity level to n, or show if n is absent.<br />
version                : Show current version number.<br />
END<br />
exit<br />
Connection closed by foreign host.<br />
ai:~ #For more information, see the OpenVPN Management Interface Documentation.<br />
 </p>

<p></p>

<p><strong>配置OpenVPN在系统启动的时自动启动</strong></p>

<p>因为没有这方面的标准，所以每个系统在启动的时候都有不同的启动进程/服务的方式，最好的办法就是安装专门为OpenVPN制作的各种安装包，比如在linux下的RPM包或者在windows下的安装包.</p>

<p><strong>Linux</strong><br />
如果你在linux下使用RPM包安装OPenVPN，那么安装后会自动产生一个启动脚本，当脚本执行的时候，会自动在/etc/openvpn目录下寻找后缀为.conf的配置文件，如果找到配置文件，会自动启动相应配置文件的OpenVPN进程.</p>

<p><strong>Windows</strong><br />
Windows下安装后，会产生一个服务，默认这个服务是关闭的，为了启动激活它，可以在控制面板/管理工具/服务, 选择OpenVPN服务。右键单击属性，设置为启动的时候自动运行。设置完以后下次系统重启，就会同时自动启动OpenVPN服务。</p>

<p>当启动OpenVPN服务的时候，会搜索\Program Files\OpenVPN\config目录下后缀为.ovpn的配置文件，并启动对应的OpenVPN进程。</p>

<p><br />
<strong>控制运行中的OpenVPN进程</strong></p>

<p><strong>运行在Linux/BSD/Unix</strong></p>

<p>OpenVPN接受下面几个信号:</p>

<p>SIGUSR1 – 有条件的重启，非root用户重启OpenVPN进程 <br />
SIGHUP  – 重启 <br />
SIGUSR2 – 输出连接状态到log文件或者系统log<br />
SIGTERM, SIGINT – 退出 </p>

<p>在配置文件中使用writepid参数指定OpenVPN的pid文件， 好让你发送信号给这个pid文件（如果你用启动脚本启动OpenVPN，已经在OpenVPN的命令行里其通过了writepid参数)。</p>

<p><strong>在windows下运行图形界面</strong></p>

<p>具体请看 <a href="http://openvpn.net/gui.html">OpenVPN GUI page</a>.</p>

<p><strong>运行在windows下的命令提示窗口</strong></p>

<p>在Windows下，你可以通过右键单击一个OpenVPN的配置文件（.opvn文件）然后选择"Start OpenVPN on this config file"启动OpenVPN.</p>

<p>这种方式一运行，这几个键盘命令能接受：</p>

<p>F1 – 有条件的重启(不关闭/重启TAP适配器) <br />
F2 – 显示连接状态 <br />
F3 – 重启 <br />
F4 – 退出 </p>

<p><strong>做为Windows的服务启动</strong></p>

<p>当OpenVPN做为windows的服务启动时，只有下列方法可以控制它：</p>

<p>通过服务控制管理器 (控制面板/管理工具/服务)来控制启动和停止。 <br />
通过管理界面 (看下面). </p>

<p><strong>修改正在运行的服务器的配置文件</strong></p>

<p>大多数情况修改配置文件，都要重启服务才能生效，这里有2个比较特殊的参数，可以进行动态更新操作，并且立即生效而不用重启OpenVPN服务进程。</p>

<p><strong>client-config-dir</strong> – 这个参数设置客户端配置文件的目录，OpenVPN服务器会检查相关进来的连接请求，然后在目录寻找相对应客户端的配置文件 (看<a href="http://openvpn.net/man.html">指南页面</a> 获取更多信息)。不用重启服务，在这个目录里的文件就能动态更新 。注意新的修改只对新的连接才生效，不对已经存在的连接不起作用。如果里希望指定的客户端配置文件立即生效与当前的连接 (或者连接已经断，但服务器的实例目标也还没过期), 可以通过管理接口杀掉客户端的实例物体(下面描述). 那么就可以用<strong>client-config-dir</strong>新的配置文件，重新连接客户端.</p>

<p><strong>crl-verify</strong> – 这个参数的意思是证书废除名单文件，详细的描述在下面<a href="http://openvpn.net/howto.html#revoke">Revoking Certificates</a> 这一节. CRL文件可以时实修改，并且立即生效，或者对那些已经连接的客户端重新协商SSL/TSL通道（默认每隔1小时）. 如果你想干掉那些正在连接，但其对应证书被追加到CTL的用户，可以通过管理接口进行操作 (下面详细介绍).</p>

<p><strong>状态文件</strong></p>

<p>默认服务端配置文件<a href="http://openvpn.net/howto.html#server">server.conf</a>有下列一行</p>

<blockquote>status openvpn-status.log</blockquote>

<p>那个参数的作用是将每分钟输出一个现有用户连接列表到openvpn-status.log文件。</p>

<p><strong>使用管理接口</strong></p>

<p><a href="http://openvpn.net/management.html">OpenVPN管理接口</a> 是一个很好的控制运行中的OpenVPN进程的方法。你可以使用管理接口通过telnet命令直接连接到管理接口的端口，或者直接使用 <a href="http://openvpn.net/gui.html">OpenVPN GUI </a>连接管理接口</p>

<p>如果要在OpenVPN服务端或者客户端启用管理接口， 你得在配置文件中添加以下这行：</p>

<blockquote>management localhost 7505</blockquote>

<p>这就告诉OpenVPN监听通过客户端通过管理接口访问TCP的7505端口 (7505端口是一个任意选择的端口，你可以选择任何一个没被使用的端口)。</p>

<p>一旦OpenVPN启动，我们可以用telnet客户端程序连接上管理接口，比如下面的例子：<br />
 <br />
ai:~ # telnet localhost 7505<br />
Trying 127.0.0.1...<br />
Connected to localhost.<br />
Escape character is '^]'.<br />
>INFO:OpenVPN Management Interface Version 1 -- type 'help' for more info<br />
help<br />
Management Interface for OpenVPN 2.0_rc14 i686-suse-linux [SSL] [LZO] [EPOLL] built on Feb 15 2005<br />
Commands:<br />
echo [on|off] [N|all]  : Like log, but only show messages in echo buffer.<br />
exit|quit              : Close management session.<br />
help                   : Print this message.<br />
hold [on|off|release]  : Set/show hold flag to on/off state, or<br />
                         release current hold and start tunnel.<br />
kill cn                : 杀掉通用名为cn的客户端。<br />
kill IP:port           : 杀掉来自指定ip和端口的客户端。<br />
log [on|off] [N|all]   : 打开/关闭时实的日志显示<br />
                         + 显示最后N条或者'所有' 历史日志.<br />
mute [n]               : Set log mute level to n, or show level if n is absent.<br />
net                    : (只在windows下有效) 显示网络信息和路由表。<br />
password type p        : Enter password p for a queried OpenVPN password.<br />
signal s               : 发送信号给进程,<br />
                         s = SIGHUP|SIGTERM|SIGUSR1|SIGUSR2.<br />
state [on|off] [N|all] : 跟log一样,但是静态显示。<br />
status [n]             : 显示现在进程的状态信息。<br />
test n                 : Produce n lines of output for testing/debugging.<br />
username type u        : Enter username u for a queried OpenVPN username.<br />
verb [n]               : Set log verbosity level to n, or show if n is absent.<br />
version                : 显示当前版本号.<br />
END<br />
exit<br />
Connection closed by foreign host.<br />
ai:~ #</p>

<p>更多信息，察看OpenVPN管理接口文档<br />
</p>]]></description>
<link>http://blog.5ilinux.com/archives/2006/08/openvpn_20_howt_4.html</link>
<guid>http://blog.5ilinux.com/archives/2006/08/openvpn_20_howt_4.html</guid>
<category>VPN</category>
<pubDate>Sat, 19 Aug 2006 23:02:38 +0800</pubDate>
</item>
<item>
<title>OpenVPN 2.0 HOWTO-初始化测试篇(翻译)</title>
<description><![CDATA[<p>原文:<a href="http://openvpn.net/howto.html">http://openvpn.net/howto.html</a><br />
翻译水平有限,许多地方都可能翻译的不当,请大家指教</p>

<p>Starting up the VPN and testing for initial connectivity</p>

<p>Starting the server</p>

<p>First, make sure the OpenVPN server will be accessible from the internet. That means:</p>

<p>opening up UDP port 1194 on the firewall (or whatever TCP/UDP port you've configured), or <br />
setting up a port forward rule to forward UDP port 1194 from the firewall/gateway to the machine running the OpenVPN server. <br />
Next, make sure that the TUN/TAP interface is not firewalled.</p>

<p>To simplify troubleshooting, it's best to initially start the OpenVPN server from the command line (or right-click on the .ovpn file on Windows), rather than start it as a daemon or service:</p>

<p>openvpn [server config file] </p>

<p>A normal server startup should look like this (output will vary across platforms):<br />
 </p>

<p>Sun Feb  6 20:46:38 2005 OpenVPN 2.0_rc12 i686-suse-linux [SSL] [LZO] [EPOLL] built on Feb  5 2005<br />
Sun Feb  6 20:46:38 2005 Diffie-Hellman initialized with 1024 bit key<br />
Sun Feb  6 20:46:38 2005 TLS-Auth MTU parms [ L:1542 D:138 EF:38 EB:0 ET:0 EL:0 ]<br />
Sun Feb  6 20:46:38 2005 TUN/TAP device tun1 opened<br />
Sun Feb  6 20:46:38 2005 /sbin/ifconfig tun1 10.8.0.1 pointopoint 10.8.0.2 mtu 1500<br />
Sun Feb  6 20:46:38 2005 /sbin/route add -net 10.8.0.0 netmask 255.255.255.0 gw 10.8.0.2<br />
Sun Feb  6 20:46:38 2005 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:23 ET:0 EL:0 AF:3/1 ]<br />
Sun Feb  6 20:46:38 2005 UDPv4 link local (bound): [undef]:1194<br />
Sun Feb  6 20:46:38 2005 UDPv4 link remote: [undef]<br />
Sun Feb  6 20:46:38 2005 MULTI: multi_init called, r=256 v=256<br />
Sun Feb  6 20:46:38 2005 IFCONFIG POOL: base=10.8.0.4 size=62<br />
Sun Feb  6 20:46:38 2005 IFCONFIG POOL LIST<br />
Sun Feb  6 20:46:38 2005 Initialization Sequence Completed</p>

<p>Starting the client<br />
As in the server configuration, it's best to initially start the OpenVPN server from the command line (or on Windows, by right-clicking on the client.ovpn file), rather than start it as a daemon or service:</p>

<p>openvpn [client config file] </p>

<p>A normal client startup on Windows will look similar to the server output above, and should end with the Initialization Sequence Completed message.</p>

<p>Now, try a ping across the VPN from the client. If you are using routing (i.e. dev tun in the server config file), try:</p>

<p>ping 10.8.0.1</p>

<p>If you are using bridging (i.e. dev tap in the server config file), try to ping the IP address of a machine on the server's ethernet subnet.</p>

<p>If the ping succeeds, congratulations! You now have a functioning VPN.</p>

<p>Troubleshooting</p>

<p>If the ping failed or the OpenVPN client initialization failed to complete, here is a checklist of common symptoms and their solutions:</p>

<p>You get the error message: TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity). This error indicates that the client was unable to establish a network connection with the server.</p>

<p>Solutions:</p>

<p>Make sure the client is using the correct hostname/IP address and port number which will allow it to reach the OpenVPN server. <br />
If the OpenVPN server machine is a single-NIC box inside a protected LAN, make sure you are using a correct port forward rule on the server's gateway firewall. For example, suppose your OpenVPN box is at 192.168.4.4 inside the firewall, listening for client connections on UDP port 1194. The NAT gateway servicing the 192.168.4.x subnet should have a port forward rule that says forward UDP port 1194 from my public IP address to 192.168.4.4. <br />
Open up the server's firewall to allow incoming connections to UDP port 1194 (or whatever TCP/UDP port you have configured in the server config file). </p>

<p>You get the error message: Initialization Sequence Completed with errors -- This error can occur on Windows if (a) You don't have the DHCP client service running, or (b) You are using certain third-party personal firewalls on XP SP2.</p>

<p>Solution: Start the DHCP client server and make sure that you are using a personal firewall which is known to work correctly on XP SP2.</p>

<p>You get the Initialization Sequence Completed message but the ping test fails -- This usually indicates that a firewall on either server or client is blocking VPN network traffic by filtering on the TUN/TAP interface.</p>

<p>Solution: Disable the client firewall (if one exists) from filtering the TUN/TAP interface on the client. For example on Windows XP SP2, you can do this by going to Windows Security Center -> Windows Firewall -> Advanced and unchecking the box which corresponds to the TAP-Win32 adapter (disabling the client firewall from filtering the TUN/TAP adapter is generally reasonable from a security perspective, as you are essentially telling the firewall not to block authenticated VPN traffic). Also make sure that the TUN/TAP interface on the server is not being filtered by a firewall (having said that, note that selective firewalling of the TUN/TAP interface on the server side can confer certain security benefits. See the access policies section below).</p>

<p>The connection stalls on startup when using a proto udp configuration, the server log file shows this line:</p>

<p>TLS: Initial packet from x.x.x.x:x, sid=xxxxxxxx xxxxxxxxhowever the client log does not show an equivalent line.</p>

<p>Solution: You have a one-way connection from client to server. The server to client direction is blocked by a firewall, usually on the client side. The firewall can either be (a) a personal software firewall running on the client, or (b) the NAT router gateway for the client. Modify the firewall to allow returning UDP packets from the server to reach the client.</p>

<p>See the FAQ for additional troubleshooting information.</p>

<p><br />
启动VPN服务并初始化测试</p>

<p>启动服务器</p>

<p>首先.得确认OpenVPN能通过internet被访问,意思是:</p>

<p>1.在防火墙上已经打开UDP端口(或者无论是UDP还是TCP都已经被配置打开), <br />
2.或者防火墙上已经设置了一个专门的端口forward指向OpenVPN服务器的UDP1194端口. </p>

<p>下一步, 确信你的TUN/TAP没被防火墙禁止.</p>

<p>为了简单调试，启动OpenVPN的最好的办法是用命令方式（或者右肩单击server.ovpn文件启动），这样就作为一个服务启动了:</p>

<blockquote>openvpn [server config file] </blockquote>

<p>正常服务启动，我们会看到如下信息:</p>

<p>Sun Feb  6 20:46:38 2005 OpenVPN 2.0_rc12 i686-suse-linux [SSL] [LZO] [EPOLL] built on Feb  5 2005<br />
Sun Feb  6 20:46:38 2005 Diffie-Hellman initialized with 1024 bit key<br />
Sun Feb  6 20:46:38 2005 TLS-Auth MTU parms [ L:1542 D:138 EF:38 EB:0 ET:0 EL:0 ]<br />
Sun Feb  6 20:46:38 2005 TUN/TAP device tun1 opened<br />
Sun Feb  6 20:46:38 2005 /sbin/ifconfig tun1 10.8.0.1 pointopoint 10.8.0.2 mtu 1500<br />
Sun Feb  6 20:46:38 2005 /sbin/route add -net 10.8.0.0 netmask 255.255.255.0 gw 10.8.0.2<br />
Sun Feb  6 20:46:38 2005 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:23 ET:0 EL:0 AF:3/1 ]<br />
Sun Feb  6 20:46:38 2005 UDPv4 link local (bound): [undef]:1194<br />
Sun Feb  6 20:46:38 2005 UDPv4 link remote: [undef]<br />
Sun Feb  6 20:46:38 2005 MULTI: multi_init called, r=256 v=256<br />
Sun Feb  6 20:46:38 2005 IFCONFIG POOL: base=10.8.0.4 size=62<br />
Sun Feb  6 20:46:38 2005 IFCONFIG POOL LIST<br />
Sun Feb  6 20:46:38 2005 Initialization Sequence Completed</p>

<p>启动客户端</p>

<p>跟服务器端得配置一样，启动客户端最好的方式是命令方式（或者在windows下右键单击client.ovpn文件启动）:</p>

<blockquote>openvpn [client config file] </blockquote>

<p>客户端正常启动，应该能看到跟服务器类似的信息，最后以显示“Initialization Sequence Completed”结束.</p>

<p>现在，我们可以通过VPN尝试ping命令，假如你使用路由模式（也就是说在服务器的配置文件中使用“dev tun”），运行下列命令:</p>

<blockquote>ping 10.8.0.1</blockquote>

<p>如果你使用以太网桥模式（也就是说在服务器配置文件中配置使用“dev tap”）, 你可以尝试ping服务器所在局域网的ip地址.</p>

<p>如果ping显示正常，恭喜你，你已经拥有一个正常功能的VPN.</p>

<p>排错</p>

<p>如果遇到OpenVPN初始化失败，或者ping失败，下面有一些共同的问题症状和解决办法:</p>

<p>1.你得到如下错误信息: TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity). 这个错误指出客户端不能跟服务器建立网络链接.</p>

<p>解决办法：</p>

<p>a.请确认客户端访问的服务器的机器名/IP和端口是正确的. <br />
b.如果你的OpenVPN服务器是单网卡，并处在受保护的局域网中，请确认你你的网关防火墙使用了正确的端口转发规则。比如：你的OpenVPN机器的地址是192.168.4.4，但处在防火墙保护下，时刻监听着UDP协议1194的连接请求，那么负责维护192.168.4.x子网的网关就会有一个端口转发策略，即所有访问UDP协议1194端口的请求都被转发到192.168.4.4 。<br />
c.打开服务器的防火墙允许UDP协议1194端口连接进来，（或者不管是TCP还是UDP协议在服务器的配置文件中配置了）。</p>

<p>2.你得到如下错误信息: Initialization Sequence Completed with errors – 这个错误可能发生在windows下（a）你没有启用DHCP客户端服务（b）你的XP SP2使用了某个第三方的个人防火墙。</p>

<p>解决办法: 启动DHCP客户端服务或者你确认你的XP SP2正确使用了个人防火墙.</p>

<p>3.你虽然获得了Initialization Sequence Completed 的信息，但ping测试还是失败了，那就通常是在服务器或者客户端的防火墙阻止过滤了在TUN/TAP设备结构上的网络流量。</p>

<p>解决办法: 关闭客户端的防火墙，如果防火墙过滤了TUN/TAP设备端口的流量。比如在Windows XP SP2系统，你可以到Windows 安全中心 -> Windows 防火墙 -> 高级 然后不要选择TAP-Win32 adapter设备 (即禁止TUN/TAP设备使用防火墙过滤 ，实质上就是告诉防火墙不要阻止VPN认证信息)。 同样在服务器端也要确认TUN/TAP设备不实用防火墙过滤 (也就是说在TUN/TAP接口上选择过滤是有一定的安全保障的. 具体请看下面一节的访问策略).</p>

<p>4.当以udp协议的配置文件启动的时候连接停止，服务器的日志文件显示如下一行信息： </p>

<blockquote>TLS: Initial packet from x.x.x.x:x, sid=xxxxxxxx xxxxxxxx</blockquote>

<p>不管怎么样，这信息只在服务器端显示，在客户端是不会显示相同的信息。</p>

<p>解决办法: 你只拥有单向连接从客户端到服务器，从服务器到客户端的连接被防火墙挡住， 通常在客户端这边，防火墙（a）可能是个运行在客户端的个人防火墙软件（b）或者服务客户端的NAT路由 网关被设置为从服务器端访问客户端的UDP协议包被阻挡返回。</p>

<p>查看FAQ能得到更多故障解决的信息.<br />
</p>]]></description>
<link>http://blog.5ilinux.com/archives/2006/08/openvpn_20_howt_3.html</link>
<guid>http://blog.5ilinux.com/archives/2006/08/openvpn_20_howt_3.html</guid>
<category>VPN</category>
<pubDate>Fri, 18 Aug 2006 08:50:41 +0800</pubDate>
</item>
<item>
<title>[转载]从FLV中截图以及相关PHP代码</title>
<description><![CDATA[<p>从FLV中截图以及相关PHP代码 <br />
 <br />
使用-ss参数 作用（time_off set the start time offset），可以从指定时间点开始转换任务。如:<br />
转换文件格式的同时抓缩微图：<br />
ffmpeg -i "test.avi" -y -f image2 -ss 8 -t 0.001 -s 350x240 'test.jpg'<br />
对已有flv抓图：<br />
ffmpeg -i "test.flv" -y -f image2 -ss 8 -t 0.001 -s 350x240 'test.jpg'<br />
-ss后跟的时间单位为秒 </p>

<p>$streamPath = "./test.flv";<br />
$newName = "myConvertedPic.jpg";<br />
$imgW = 320;<br />
$imgH = 240;<br />
$imgQuality = 80;<br />
$resultPath = "http://www.meinserver.de/snapit/".$newName.".jpg";<br />
exec ("flv2jpg.exe", $streamPath, $newName, $imgW, $imgH, $imgQuality); </p>]]></description>
<link>http://blog.5ilinux.com/archives/2006/08/flvphp.html</link>
<guid>http://blog.5ilinux.com/archives/2006/08/flvphp.html</guid>
<category>ffmpeg</category>
<pubDate>Thu, 17 Aug 2006 09:54:27 +0800</pubDate>
</item>


</channel>
</rss>