您的位置:首页 > 文档 > 解决方案 >
 文章分类 

如何在LINUX下用ADSL上网


创建:2005-11-07 00:00:00
作者:Unlinux
来自: http://www.Unlinux.com



  LINUX+ADSL将会逐渐成为我们接入INTERNET的方式。我们以SuSe Linux 6.4为例,进行这种方式的具体实施。

  首先,看看软件方面的准备。SuSe 6.4已含pppoed-0.46-7。如果没有该软件,也可到ftp://ftp.suse.com/pub/projects/T-DSL或 http://www.suse.de/en/support/download /updates/63_update.html下载最新版本。

  设置网卡和网关:# ifconfig eth0 mtu 1492 (不要为eth0设任何IP地址)。并确保你的default gateway 为空。

  Add your login name and password to /etc/ppp/pap-secrets and /etc/ppp/chap-secrets。

  这两个文件应象这样:
"domain@hermes.com" * "mypassword"
编辑/etc/resolve.conf
nameserver 202.96.0.100
nameserver 202.96.0.50

在/etc/modules.conf中加入下面一行:
alias char-major-144 pppox
修改文件 /etc/ppp/options.
# general options
idle 600
# this is a must
user " domain@hermes.com "
sync
local
nocrtscts
noauth
usepeerdns
mru 1490
mtu 1490
# this is recommended
defaultroute
hide-password
nodetach
#
# switch off all compressions
# this is a must
noaccomp
nopcomp
# this is recommended
novj
novjccomp
nobsdcomp
nodeflate
noccp

  注意:Replace with your own login name.

  运行 /usr/sbin/pppoed开始连接。

  注意:只有root 用户可以启动连接。

  If you use a network device other than eth0, you’ll need to start /usr/sbin/pppoed with the option -I ethX, where X is the number of the device。

  检验、测试连接:用tail -f /var/log/messages可跟踪并诊断ADSL的连接状态,用ifconfig可以查看你的ppp0设备被分配的IP地址,如果地址分配成功,就说明已建立连接。用route命令可查看拔入服务器为你指定的网关地址。用ping www.hermes.com.cn应该可以ping通,如果不通,有可能是你的DNS设置问题。

  代理局域网上网。安装一个网卡,设置IP地址为192.168.1.1;

  加入一条IP转发的规则:/sbin/ipchains -A forward -j MASQ -s 192.168.1.0/24 -d 0.0.0.0/0。局域网内client将192.168.1.1设为缺省网关。

  现在,我们就可通过这台LINUX+ADSL代理服务器上网了。






转载自:http://www.unlinux.com/doc/solution/20051107/8955.html

评论】 【加入收藏夹】 【 】 【打印】 【关闭
 *  请尊重我们的劳动,转载请注明出自UnLinux.Com及作者名 * 

※ 相关链接
 ·如何查出黑客所在  (2005-11-07 00:00:00)
 ·如何对PHP程序中的常见漏洞进行攻击(上)  (2005-11-07 00:00:00)
 ·如何对PHP程序中的常见漏洞进行攻击(下)  (2005-11-07 00:00:00)
 ·如何在命令行下远程安装终端服务(windows2000)  (2005-11-07 00:00:00)
 ·如何用老奔腾机和Linux构建防火墙  (2005-11-07 00:00:00)
 ·如何使用SSH的Port Forwarding加密不安全的服务  (2005-11-07 00:00:00)
 ·如何成为一名黑客  (2005-11-07 00:00:00)
 ·如何防止lion蠕虫的感染  (2005-11-07 00:00:00)
 ·如何追踪黑客  (2005-11-07 00:00:00)
 ·如何让Red Hat更安全  (2005-11-07 00:00:00)

Copyright © 2005 UnLinux.Com All Rights Reserved