- 论坛徽章:
- 0
|
我要装什么ADSL拨号器吗(我的ADSL不带路由功能)
用adsl+rp-pppoe-3.5.tar.gz+双网卡,不错的,我用过,比win爽多了,而且速度比用win2000共享快!!!
==========================
1、 网卡配置。
我这里用的网卡是RTL8029和3com905。在系统中,RTL8029标记为eth0,3com905标记为eth1。RTL8029和3com905的IP地址分别是192.168.0.1、192.168.1.1(其他的地址也可),掩码均为255.255.255.0。
eth0用于连接ADSL,eth1用于连接内网,局域网网段为192.168.0.0。
注意:此处两块网卡均不能设网关。
2、 PPPoE软件的升级与安装
1)下载最新的rp-pppoe-3.5.tar.gz;
2)安装并解压缩rp-pppoe-3.5.tar.gz。以root身份执行:
tar xzvf rp-pppoe-3.5.tar.gz
3、PPPoE客户端配置
在rp-pppoe-3.5.tar.gz安装完毕后,接下来就可进行PPPoE客户端配置了。过程如下。
#/usr/sbin/adsl-setup
>;>;>; ......................(表示一些提示信息,下同!!!)
>;>;>; Enter your PPPoE user name: ——此处输入拨号帐号的用户名
>;>;>; ................
>;>;>; ................
>;>;>; Enter the Ethernet interface connected to the ADSL modem For Solaris, this is likely to be something like /dev/hme0.
>;>;>; For Linux, it will be ethn, where 'n' is a number. (default eth0): ——输入eth0
>;>;>; ................
>;>;>; ................
>;>;>; Enter the demand value (default no): ——输入no
>;>;>; ................
>;>;>; ................
>;>;>; Enter the DNS information here: ——主DNS服务器的IP,如杭州的是:202.101.172.35
>;>;>; ................
>;>;>; ................
>;>;>; Enter the secondary DNS server address here:--主DNS服务器的IP,如杭州的是:202.101.172.35
>;>;>; ................
>;>;>; ................
>;>;>; Please enter your PPPoE password: --输网ADSL户口令
>;>;>; Please re-enter your PPPoE password:--再次输入ADSL的口令
>;>;>; ................
>;>;>; ................
>;>;>; Choose a type of firewall (0-2): --输0,表示不要防火墙
>;>;>; ................
>;>;>; ................
>;>;>; Accept these settings and adjust configuration files (y/n)? --输y,保存上面的数据。
4、 启动拨号连接
/usr/sbin/adsl-start
成功连接后,屏幕显示"..Connected."。
5、测试ADSL是否接通
1) #ifconfig -a
将出现如下的信息:
ppp0 Link encap oint-to-Point Protocol
inet addr:61.174.142.239 P-t-P:61.174.138.1 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
RX packets:1941 errors:0 dropped:0 overruns:0 frame:0
TX packets:2157 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:748013 (730.4 Kb) TX bytes:268700 (262.4 Kb)
2)#nslookup www.sina.com
将出现如下的信息:
Address: 61.172.201.226
Name: taurus.sina.com.cn
Address: 61.172.201.227
Name: taurus.sina.com.cn
..............
..............
Address: 61.172.201.228
Name: taurus.sina.com.cn
Address: 61.172.201.229
3)如果都有以上的信息表明连通ADSL,此时这台linux已可以上网浏览了。当然你也可用:
#ping www.sina.com.cn
看能不能PING通。
5、 IP伪装
1) 安装iptables
安装包在8.0的光盘上有,你可以用RPM直接安装。具体在此不多说~~~~~
2) 用iptables伪装
为了使局域网中的其他机器能通过Linux服务器共享上网,至少须执行下面的命令:
#/usr/sbin/adsl-start
#echo 1 >; /proc/sys/net/ipv4/if_forward
#echo 1 >; /proc/sys/net/ipv4/icmp_echo_ignore_all
#iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o ppp0 -j MASQUERADE
完成后,在192.168.0.0网段(网关为192.168.0.1)的PC机就可透过Linux上网了!
6、 开机自启动
将以上的东东写到rc.local文件中就可以。。。。
7、 至此,一切OK,一个简单的拨号建成了。重启机器后,发现linux的internet共享连接已经一切就绪了,好妙!!!
为了建立更安全的拨号连接,请再设置各种安全机制吧,好事多磨嘛。 |
|