搬到公寓一个学期了自己用的网络是讨人厌的赛尔三期,刚刚到的时候也花了一些时间来搞定锐捷在linux下的认证,今晚心血来潮,把具体的过程写下来吧,免得日后忘了,呵呵
xgrsu的安装思路和方法源于鼓浪上wangxudong的一个howto帖子,也是从网上整理到的,当时照着做,发现死活不行,后来才发现,原来这个xrgsu必须在ethx启动起来的情况下才能用,好吧,废话少说。
我发现其实不需要编译libpcap-0.7.2的 当emerge libpcap后(我的是libpcap-0.9.4) 直接在/usr/lib下有指向libpcap.so.0.9的libpcap.so了,但是要在/usr/lib/下建立libpcap.so.0.6.2到libpcap.so.0.9的链接。
emerge libpcap && cd /usr/lib/ && ln -s libpcap.so.0.9 libpcap.so.0.6.2
- config_eth0=( "219.229.*.*")
- route_eth0=( ""219.229.*.1 )
其中的*是你自己相应的数字。
- a.please input your user name:
软件请求输入认证用户名
- b.
please input your password:软件请求输入认证密码
- c.Use DHCP,1-Use,0-UnUse(Default: 0):
如果操作系统使用了DHCP获得动态地址,请选择1,否则请选择0
我就选0了 - d.Use default auth parameter,0-Use 1-UnUse(Default: 0):1
是否使用默认的参数进行认证,选择0将使用默认的参数进行认证,并且不在询问后面的参数
我比较懒也选0了,所以是到不了接下来这几步的。
- e.please input Eap-start Timeout(Default: 30s):30
请输入Eap-start报文的超时时间,单位为秒 - f.please input Eap-response Timeout(Default: 30s):30
请输入Eap-Response报文的超时时间,单位为秒。
- g.please input Eap-packet resend Time(Default: 3):3
请输入报文的重传次数
- h.Use Red-Giant private MAC? 1-Use,0-UnUse(Default: 1):1
是否使用星网锐捷的私有组播地址进行认证,选择0将不使用,这时软件使用802.1x标准组播地址进行认证。
用expect实现半自动认证
现在你已经安装好xrgsu并在/etc/conf.d/net里设置好了ip和gw后,每次启动xrgsu进行认证都要重复地输用户名和密码,实在是烦!所以上网看看大家都是怎么解决这个问题的,发现可以用expect来解决这个问题。
首先要先装上expect,在gentoo里非常简单:
emerge -av expect同时会装上tcl和tk,可惜我们在这时后用不上它们。
然后写一个expect脚本:
--------------------------------------------------------------------------#!/usr/bin/expect
# Filename: saier
# This script is for the automatical authorization fo xrgsu
# Initial eth0 in shell
system "/etc/init.d/net.eth0 start"
# run xrgsu and interact it with expect
spaw xrgsu -d
# expect begin to interact with xrgsu
expect "Please input your user name:"
send "your account\r"
expect "Please input your password:"
send "your password\r"
expect "Use default auth parameter,0-Use 1-UnUse(Default: 0):"
send "\r"
# now all we need to input have been done, return the control to use
interact
# EOF
---------------------------------------------------------------------------
然后将其权限设为可执行:
# chmod 744 saier
再把这个脚本拷到/usr/local/bin/下面:
# cp saier /usr/local/bin/
然后在终端里运行它就可以完成启动界面和进行认证的工作了:
# saier
可是谁能在bsd下搞定呢?
你可以试试XMU-Ruijie,它是用python写,bsd应该可以的。