12月 182014
 

公司外网60.1xx.xx.xx,内网172.16.xx.xx,下接路由器,局域网192.168.10.xx,IPPBX地址192.168.10.250。局域网中一台R200跑debian,地址192.168.10.2。

debian中:

svn co https://svn.ntop.org/svn/ntop/trunk/n2n cd n2n make install edge -a 10.0.10.1 -c test -k test -l 1xx.xx.xx.xx:2xxx -r iptables -t nat -A POSTROUTING -s 10.0.10.0/24 -o eth0 -j MASQUERADE iptables -A FORWARD -s 10.0.10.0/24 -j ACCEPT

修改/etc/sysctl.conf里的ipv4 forward字段值

net.ipv4.ip_forward=1

windows中:

下载http://www.vpnhosting.cz/n2nguien.exe

n2ngui1

n2ngui2

ping通10.0.10.1即可进行下一步

route add 192.168.10.0 mask 255.255.255.0 192.168.10.1

测试192.168.10.250是否可以ping通

tomato设置待补https://www.wikai.info/2014_12_4775.html

1月 242014
 
[~] # uname -a Linux QNAP 3.4.6 #1 Thu Dec 19 02:59:16 CST 2013 armv5tel unknown [~] # smb2status smbd (samba daemon) Version 3.6.18 smbd (samba daemon) is running. max protocol SMB 1.0 enabled. [~] # grep protocol /etc/smb.conf max protocol = NT1 [~] # smb2enable Shutting down SMB services: smbd nmbd. Shutting down winbindd services: winbindd. max protocol SMB 2.0 ... enabled. locks path was set to /share/HDA_DATA/.locks Starting winbindd services:Starting SMB services:. smbd (samba daemon) Version 3.6.18 smbd (samba daemon) is running. max protocol SMB 2.0 enabled.

有人反映启用SMB2.0后速度下降很厉害,可以用’smb21enable’启用SMB2.1。不过启用SMB2.1后,cpu占用会比SMB1和SMB2.0高,至于速度,有人说在这个级别的硬件上面会跟SMB1相同。

12月 162013
 

废话不多说了,下载源码: https://github.com/madeye/shadowsocks-libev

直接编译会出错:

/tmp/cciqCfzf.s: Assembler messages: /tmp/cciqCfzf.s:2903: Error: opcode not supported on this processor: mips1 (mips1) `sync'

修改 \shadowsocks-libev-master\libev 下的 ev.c :(其实跟RT-N66U+tomato编译安装gevent及pyOpenSSL 中gevent的修改是一样的)

找到 #define ECB_MEMORY_FENCE __asm__ __volatile__ ("sync" : : : "memory") 改为 #define ECB_MEMORY_FENCE __asm__ __volatile__ (".set mips2; sync; .set mips0" ::: "memory") 有两处,都改吧。

Continue reading »

12月 162013
 

首先从官网查询到M2Crypto最新版本为0.21.1,其基本需求为:

0.21.1: Python 2.3 or newer m2urllib2 requires Python 2.4 or newer OpenSSL 0.9.7 or newer Some optional new features will require OpenSSL 0.9.8 or newer SWIG 1.3.28 or newer required for building SWIG 1.3.30 or newer may be required with Python 2.5 or newer and Python 2.4 with Py_ssize_t patches

安装SWIG,ipkg install swig即可搞定。

Continue reading »

12月 222012
 

先来看一下官方对gevent的介绍

gevent is a Python networking library that uses greenlet to provide a synchronous API on top of libevent event loop. Features include: Fast event loop based on libevent (epoll on Linux, kqueue on FreeBSD). Lightweight execution units based on greenlet. API that re-uses concepts from the Python standard library (e.g. Event, Queue). Cooperative socket and ssl modules. Ability to use standard library and 3rd party modules written for standard blocking sockets (gevent.monkey). DNS queries performed through libevent-dns. Fast WSGI server based on libevent-http.

虽然新版本的GoAgent不再要求Gevent环境,但Gevent可以提高运行效率,那为什么不装呢?Google后发现这篇文章,本文参考这篇文章后编译成功,在此谢谢此文作者。

Continue reading »