freeradius 把nas client信息写入db并且从db读取
[
修改sql.conf
找到这一行改成yes就好了,就会去读取nas表中的client的信息了
readclients = yes
[
修改sql.conf
找到这一行改成yes就好了,就会去读取nas表中的client的信息了
readclients = yes
[
我可以8点10分出发8点46到公司,骑车嘿哟嘿哟,
然后衣服湿透头发打湿,(黄蓉的歌?哦不对,原版是直到我头发花白牙齿掉光)
感谢这个夏天给我出汗的机会,可我不想全家人都这样。大家一起湿漉漉的多不好
[
二、使用时注意:
1、切勿放置在不平稳的平面上。
2、切勿阻塞吸气口或排气口、避免炉内超温。
3、切勿在儿童可触及电磁炉、或儿童能自行使用的地方使用电磁炉。
4、切勿对空锅加热或加热过度。
5、切勿将诸如刀、叉、勺子、锅盖与铝箔等金属物品放置在顶板上,因为它们会受热。
6、切勿在盛放锅具的状态下搬运电磁炉。
7、切勿在四周空间不足的地方使用电磁炉、应使电磁炉的前部与左右两侧保持干净。
8、切勿使用金属丝和异物进入吸气或排气口的缝隙内。
9、切勿使物品跌落在顶板上。如表面出现裂纹,应立即关掉电源,拔出插头并送往修理。
为什么不能空锅加热呢,也就是说,你不能扔一个平底锅子到电磁炉上面干烧,哪怕只有1-2秒,里面必须加上水或者油等能产生电磁效应的媒介
因为,那样相当于让金属内部产生电磁效应,效果不亚于高炉炼钢,
电磁炉功率一般最大功率2000w,这样的功率会在2秒之内让锅底温度迅速升高至数百度,如继续工作,会直接导致炉面损坏,锅由于底面高温,而壁面温度较低而产生扭曲
附:电磁炉原理(记得左右手效应么?)
电磁炉工作原理
电磁炉作为厨具市场的一种新型灶具。它打破了传统的明火烹调方式采用磁场感应电流(又称为涡流)的加热原理,电磁炉是通过电子线路板组成部分产生交变磁场、当用含铁质锅具底部放置炉面时,锅具即切割交变磁力线而在锅具底部金属部分产生交变的电流(即涡流),涡流使锅具铁分子高速无规则运动,分子互相碰撞、摩擦而产生热能(故:电磁炉煮食的热源来自于锅具底部而不是电磁炉本身发热传导给锅具,所以热效率要比所有炊具的效率均高出近1倍)使器具本身自行高速发热,用来加热和烹饪食物,从而达到煮食的目的。具有升温快、热效率高、无明火、无烟尘、无有害气体、对周围环境不产生热辐射、体积小巧、安全性好和外观美观等优点,能完成家庭的绝大多数烹饪任务。因此,在电磁炉较普及的一些国家里,人们誉之为”烹饪之神”和”绿色炉具”。
[
从3号回来一直到地震前几天,一直在努力的做事情,赚钱,每一笔都花上好大力气才得到的,
虽然不多,几十块几十块,到后来也凑了几百,唉,我就是蓄水池那个进水管,
无奈出水管太粗,某人请理解下
ps,看到某些事情之后还是说出来的好,就好像在大地挖了个坑把想说的对着坑吼一通,然后巴拉巴拉埋了它,说出来就舒服了。
[
openvpn下依然存在mtu的问题,默认是1500,
根据经验,mtu应当低于1472
tun-mtu 1472tun-mtu-extra 32mssfix 1400配置需要在server和client都有
Hi there,
I recently set up a OpenVPN connection between two windows servers - a web frontend located in a DMZ, accessing an SQL database over the VPN network. As far as I can tell (the project is far from complete), that works just fine (100mbps ethernet connection between the two boxen). I also used OpenVPN to setup a "maintenance network", so I could log in from home and administer the web server box via RDP, without having to open port 3389 to the world.
I experienced the some difficulty with the "maintenance network" VPN connection:
After I set things up both local and remote, OpenVPN connected, and I was able to ping mentioned web server from my home box, thru the VPN. However, only pings with -l arguments smaller than 1459. I.e., a <ping 10.0.0.1 -l 1458> worked (remote host replied), but a <ping 10.0.0.1 -l 1459> would just give timeout. So I read the manual and tried fixmss 1300.. no go, still would not work. I might add that Im using a tcp connection, and dev tap for this.
Anyways, the solution was: I had to set the MTU on the virtual tap network interface to 1300, and magically, it werkz! (I suspect I could raise that to 1458 for better performance, but have not yet tried, as for now im perfectly happy *that* it works, no matter how fast it works
. I also suspect I could use tun-mtu option to do this from the config file, right? I'll find out shortly...
Other issues I had with OpenVPN:
- Restarting the OpenVPN service sometimes (not definately sure under what circumstances) gives an error message "cannot create a file that is already there", with the OpenVPN service failing to re-start. The fix for this is to simply start the service again. I wonder tho what might cause this? Does it have something to do with my two VPN tunnels using the same key file (Im gonna change that later)? Might be of interest for developers...
- OpenVPN would not work with an IP defined on the TAP adapter - neither on the client nor on the server. A bit weird is, even tho it would not connect, the TAP adapter (I have it to "application controled") came alive on the client, so I was a bit confused as to why the client would connect, but the server doesnt see it. After I retought, I conclude thats "behaviour by design" - maybe add something to the documentation for newbies (like me :p), so they are not mislead by the TAP icon (connected/not connected), but check logs instead...
Tought I'd let you know, so u can fix, cuz ur little VPN program rocks!)
连不上一些网站的处理方法 MTU 修改
|
网络接口
|
MTU |
| EtherNet (一般的网络接口,这也是默认值) | 1500 |
| PPPoE(ADSL用的) | 1492 |
| Dial-up(modem) | 576 |
| C:\WINDOWS> ping -f -l 1500 192.168.1.2 Pinging 192.168.1.2 with 1500 bytes of data: Packet needs to be fragmented but DF set. Packet needs to be fragmented but DF set. Packet needs to be fragmented but DF set. Packet needs to be fragmented but DF set. Ping statistics for 192.168.1.2: Packets: Sent = 4, Received = 0, Lost = 4 (100% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms |
| C:\WINDOWS>ping -f -l 1464 192.168.1.2 Pinging 192.168.1.2 with 1464 bytes of data: Reply from 192.168.1.2: bytes=1464 time=10ms TTL=128 Reply from 192.168.1.2: bytes=1464 time<10ms TTL=128 Reply from 192.168.1.2: bytes=1464 time<10ms TTL=128 Reply from 192.168.1.2: bytes=1464 time<10ms TTL=128 Ping statistics for 192.168.1.2: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 10ms, Average = 2ms |
| [root@test root]# ping -c 3 -M do -s 1472 192.168.1.2 PING 192.168.1.2 (192.168.1.2) from 192.168.1.13 : 1472(1500) bytes of data. 1480 bytes from 192.168.1.2: icmp_seq=0 ttl=255 time=2.408 msec 1480 bytes from 192.168.1.2: icmp_seq=1 ttl=255 time=2.392 msec 1480 bytes from 192.168.1.2: icmp_seq=2 ttl=255 time=2.440 msec — 192.168.1.2 ping statistics — 3 packets transmitted, 3 packets received, 0% packet loss round-trip min/avg/max/mdev = 2.392/2.413/2.440/0.044 ms [root@test root]#ping -c 3 -M do -s 1473 192.168.1.2 PING 192.168.1.2 (192.168.1.2) from 192.168.1.13 : 1473(1501) bytes of data. ping: sendto: Message too long ping: sendto: Message too long ping: sendto: Message too long — 192.168.1.2 ping statistics — 3 packets transmitted, 0 packets received, 100% packet loss |

| [root@test root]# ifconfig eth0 mtu 1500 |
-A POSTROUTING -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
–clamp-mss-to-pmtu 意为动态协商 MSS,当然你也可以指定,但要根据ISP的情况。事实上有些时候取决于你访问的网站和你机器之间。
[
从1.1.0开始弄freeradius,今天发现已经更新到2了,编译安装后发现找不到sql相关的东西了,
最后在etc/raddb/sites-enabled/inner-tunnel发现原来都移动到这里了
搜索sql,注释掉前面的#
同时要把有files的地方注释掉它,有三个地方的log需要取消注释
久其原因,是因为freeradius支持了虚拟server的概念
As of 2.0.0, FreeRADIUS supports virtual hosts using the
# “server” section, and configuration directives.
#
# Virtual hosts should be put into the “sites-available”
# directory. Soft links should be created in the “sites-enabled”
# directory to these files. This is done in a normal installation.
#
实在没搞定,因为freeradius2开始加强了加密,目前完全找不到可以参考的配置文档,官方也没有,还是乖乖用1.16吧
[
07年4月的时候被逼的用openvpn调用pam,再调用radius来实现了认证
现在有方便的openvpn直接配合radius的程序了
http://www.nongnu.org/radiusplugin/index.html
使用这个需要 libgcrypt的头文件,需要 libgcrypt-devel
所以需要yum install libgcrypt-devel
否则,直接出现RadiusClass/RadiusAttribute.h:24:20: gcrypt.h: No such file or directory
[root@s5s18 radiusplugin_v2.0b]# make
OBJ: RadiusClass/RadiusAttribute.o
OBJ: RadiusClass/RadiusPacket.o
OBJ: RadiusClass/RadiusConfig.o
OBJ: RadiusClass/RadiusServer.o
OBJ: RadiusClass/RadiusVendorSpecificAttribute.o
OBJ: AccountingProcess.o
OBJ: Exception.o
OBJ: PluginContext.o
OBJ: UserAuth.o
OBJ: AcctScheduler.o
OBJ: IpcSocket.o
OBJ: radiusplugin.o
OBJ: User.o
OBJ: AuthenticationProcess.o
OBJ: main.o
OBJ: UserAcct.o
OBJ: UserPlugin.o
OBJ: Config.o
BIN: radiusplugin.so
生成了so文件之后拷贝到openvpn的配置目录
cp radiusplugin.so /etc/openvpn/.
编辑插件的配置文件
vi /etc/openvpn/radiusplugin.cnf
NAS-Identifier=OpenVpn
Service-Type=2
Framed-Protocol=1
NAS-Port-Type=5
NAS-IP-Address=192.168.13.1
OpenVPNConfig=/etc/openvpn/server.conf
#overwriteccfiles=true
#subnet=255.255.255.0
#p2p=10.10.0.1
server
{
acctport=1813
authport=1812
name=192.168.12.1
retry=1
wait=1
sharedsecret=passwd
}
下面这个是官方的说明
— Beginning —
# The NAS identifier which is sent to the RADIUS server
NAS-Identifier=OpenVpn# The service type which is sent to the RADIUS server
Service-Type=5
# The framed protocol which is sent to the RADIUS server
Framed-Protocol=1
# The NAS port type which is sent to the RADIUS server
NAS-Port-Type=5
# The NAS IP address which is sent to the RADIUS server
NAS-IP-Address=127.0.0.1
# Path to the OpenVPN configfile. The plugin searches there for
# client-config-dir PATH (searches for the path)
# status FILE (searches for the file, version must be 1)
# client-cert-not-required (if the option is used or not)
# username-as-common-name (if the option is used or not)
OpenVPNConfig=/etc/openvpn/radiusvpn.conf
# Support for topology option in OpenVPN 2.1
# If you don’t specify anything, option “net30″ (default in OpenVPN) is used.
# You can only use one of the options at the same time.
# If you use topology option “subnet”, fill in the right netmask, e.g. from
# OpenVPN option “–server NETWORK NETMASK”
#subnet=255.255.255.0
# If you use topology option “p2p”, fill in the right network, e.g. from OpenVPN
# option “–server NETWORK NETMASK”
#p2p=10.10.0.1
####################### Ich benutze die Default Option
# Allows the plugin to overwrite the client config in client config file directory,
# default is true
overwriteccfiles=true
# Path to a script for vendor specific attributes.
# Leave it out if you don’t use an own script.
# vsascript=/root/workspace/radiusplugin_v2.0.5_beta/vsascript.pl
# Path to the pipe for communication with the vsascript.
# Leave it out if you don’t use an own script.
# vsanamedpipe=/tmp/vsapipe
# A radius server definition, there could be more than one.
# The priority of the server depends on the order in this file. The first one
# has the highest priority.
server
{
# The UDP port for radius accounting.
acctport=1813
# The UDP port for radius authentication.
authport=1812
# The name or ip address of the radius server.
name=127.0.0.1
# How many times should the plugin send the if there is no response?
retry=1
# How long should the plugin wait for a response?
wait=1
# The shared secret.
sharedsecret=Hier das Secret aus der client.conf des Radius-Servers
}
— End of file —
[
http标准协议中有专门的字段记录referer
一来可以追溯上一个入站地址是什么
二来对于资源文件,可以跟踪到包含显示他的网页地址是什么。
因此所有防盗链方法都是基于这个Referer字段
防盗链设置样本:使用正则表达式
SetEnvIf Referer "^http://(.)+\.ilinux\.cn/" local_ref=1
SetEnvIf Referer "^http://(.)+\.isql\.cn/" local_ref=1
#SetEnvIf Referer "^http://(.)+\.other\.org\.cn/" local_ref=1
SetEnvIf Request_URI "/logo(.)+" local_ref=0
<FilesMatch "\.(mp3|wmv|png|gif|jpg|jpeg|avi|bmp|ram|rmvb|rm|rar|zip|mp3)">
Order Allow,Deny
Allow from env=local_ref
</FilesMatch>
解释:
1. 蓝色部分,表示设置允许访问的referer地址,第一行的意思为所有http协议访问,以.ilinux.cn结尾的域名地址,第二行类似,只是换成了.isql.cn,表问我前面的鬼符是什么,不懂得可以去翻正则表达式的研究文献,不想深究的可以照猫画虎设置自己的网站。
2. 绿色部分,表示不在上述引用域名范围内,但可以被放行的特例,本例中表示网站/目录,所有以logo开头的文件(用作允许其它网站的友情连接引用本站logo)。
3. 橙色部分是设置反盗链的关键部分,上面每一个设置都联系到了local_ref这个环境变量,只有这个变量为1,则允许被引用,否则显示一个X。
4. 紫色部分设置了哪些扩展名的文件加入反盗链的规则。第二种方法:
使用rewirte方式:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://bbs.ilinux.cn/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://bbs.ilinux.cn$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.ilinux.cn/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.ilinux.cn$ [NC]
RewriteCond %{HTTP_REFERER} !^http://ilinux.cn/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://ilinux.cn$ [NC]
RewriteRule .*\.(gif|jpg|jpeg|avi|bmp|ram|rmvb|rm|rar|zip)$ http://www.ilinux.cn [R,NC]
上面的,需要Rewrite模板.所有指定的文件,如果Referer不是上面的值,将被重定向到首页.
SetEnvIfNoCase Referer “^
http://google\.com/” local_ref=1如果你的网址是
www.myst.cn就改为[
19日晚21点开始,移动、联通、小灵通再次出现堵塞,
成都人民的电话再次无法打通,全国的人民都很着急,
但是有啥用?通讯厂商的冗余只能考虑几倍平时通话量,现在是所有用户一起在拨,
宕机吧,
[
籍贯:四川
生日:7月9日
星座:巨蟹座]
血型:A
爱好:旅游、听歌、看书、美食
人生格言:谋事在人,成事在天
曾主持过的节目:《新闻杂志》、《新闻现场》
从2000年进入电视传媒行业,一路走来,我很忙碌,也很幸福。虽然每天都在应对着不同新
闻的发生,重复再重复的日子,习惯并喜欢,愉快的心情让我的每一天都过得很充实!
有人说,四川的女孩活泼、热情;也有人说,四川的女孩细腻、温柔。A型血的我呢,却是
两者兼有!熟识的朋友们都说我是她们的开心果,虽然有时会有些大大咧咧、唠唠叨叨,但
这样的我,才是她们所喜欢的。
每当新的一天开始,拉开窗帘,灿烂的阳光就铺满了我的双眼,每天的生活对于我来说,都
是阳光般的美好。9个月的小宝贝,更是给我的生活带来了无尽的乐趣,让初为人母的我享
受了天伦之乐。
生活如此美好,在享受每一天的美好生活时,我愿意把这份心情通过我的微笑传递给所有我
认识和不认识的朋友们,愿你们永远幸福、快乐!
由于她人气不高,找不到近期的主持照片,
百度贴吧:http://tieba.baidu.com/f?kw=%BD%AF%C0%F1
生活照
