自从用了新校园网,就有了LINUX不能上网的烦恼。于是经过一点点努力。终于初步搞出一个在LINUX环境下上网的方法:
1.安装认证端
在终端获得管理员权限(su -)或者直接用root登陆,输入 ./pre.ps。。。。完成安装过程。
2.配置用户信息
安装结束后,在终端输入linux1x -c进行配置。(具体配置情况在下面给出)
3.认证
配置完毕后,在终端输入linux1x -d(-d是程序以守护方式运行,通过认证后转到后台运行),按提示依次输入用户名和密码。正常情况下可以上网了。你可以打开浏览器上网看看。
下面是具体的信息:
happy@trubuntu:~/client$ su - ##取得root权限
Password:
root@trubuntu:~/client# ./pre.ps ##运行安装脚本
configuration directory exist
Refresh IP script is READY.
Authencation file is READY.
pre operation finished successfully
root@trubuntu:~/client# linux1x -c ##配置上网参数
configure 802.1X network connection arguments
Current configuration is:
The way to initialize 802.1X authentication.......:multicast
Send all packets by multicast.....................:N
Refresh IP address after connecting...............:Y
Save message and package to log...................:N
Continue to configure your network connection arguments?(Y/N)
y
There are two ways to initialize 802.1X authentication:
1. Trap by broadcast.
2. Trap by multicast.
Please choose the way to initialize the 802.1X authentication :
1
Send all packets by multicast? (Y/N):
y
Refresh your IP address after connecting? (Y/N):
y
Save message and package to log?(Y/N):
y
The default save directory is '/var/log/h3c-linux1x/', do you want to change it?(Y/N):
n
Configuration has finished, do you want to save it?(Y/N)
y
Save configuration sucessfully! ##配置成功
root@trubuntu:~/client# linux1x -d
Please enter your user name (less than 128 characters):xxxxxx ##输入你的帐户名
Please enter your password (less than 64 characters): ##输入帐户密码
start 802.1X authentication
device check
server check
Internet Systems Consortium DHCP Client V3.0.2
Copyright 2004 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/products/DHCP
sit0: unknown hardware address type 776
sit0: unknown hardware address type 776
Listening on LPF/eth0/00:yy:4c:zz:cb:xx
Sending on LPF/eth0/00:yy:4c:zz:cb:xx
Sending on Socket/fallback
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPACK from 172.17.138.1
bound to 172.17.138.xx -- renewal in 38286 seconds.
pass authentication
proxy check off
multi-network-card off
http check off
...............
联网成功。
注:这个方法已经在redhat redflag的主要发行版本中测试通过。大家可以放心使用。
但是,用上述方法上网的话,会存在经常掉线的问题。每次掉线,都需要手动重新拨号。为了省心省力。我自己编写了一个SHELL脚本,去实现每次5秒运行认证命令(也就是每隔5秒进行一次拨号),如此,每当掉线,系统就会帮我重新连接上。
综上所述,也就算是一种勉强解决新校园网在linux环境下上网的解决方法吧。当然,要是你希望它长时间不断线的话,可以自己去写一个LINUX认证端,相信对各位高手来说不是一件难事,作为一个菜鸟,我期待着这一个认证端的面市。
对于我所说的SHELL脚本,有两个方案:
第一种是
#!/bin/sh
a=1
while [ '$a' == '$a' ]
do
linux1x -d
sleep(5)
done
(在终端输入bash text(假设文件名是text))
第二种我还没写好,主要算法是这样的:让它每隔一段时间ping一次主机,如果不连通就kill掉那个进程,重新执行认证命令(linux1x -d),如果连通,哈哈,就不管它了。
如果各位对上所有其他建议或看法或疑惑等等的话,可以尽情发表交流。因为我很少上蓝在,可以发邮件给我。
我的EMAIL:h30203@126.com
文件好像上传不到,郁闷。给大家一个地址吧。
http://www.linuxdiyf.com/soft.php?id=4858迅雷等软件粘贴此地址吧。在IE好像跳转不了。我也可以发邮件给大家。
爱蓝在,嘻嘻!