LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1592|回复: 3

如何让slackware 10 使用河南网通线路拨号端顺利上网

[复制链接]
发表于 2005-8-29 05:22:57 | 显示全部楼层 |阅读模式
我不想骂网通 我知道骂人 是不能解决问题的.
而且我也学会了去静静的欣赏别人骂人
受网通压迫了很久不能用slackware上公网
一年前以为那该死的java enus拨号端可以解决问题
谁知白白浪费我两天的时间
最近发现新出了linux拨号程序,down下来试试
刚开始不能用,错误输出提示.根据提示做了一些调整,可以正常使用,现分享大家


首先不要更改/etc/rc.inet1.conf中的设置
如果其中设置了,就把信息删除.
保持ethx(我这里是eth1)在开机的时候没有起用DHCP,更不能自己分配地址.
下载河南网通的最近拨号程序  http://218.29.0.252/racer/linux/racer.tar.gz
解压缩到/usr/local/racer
运行命令将公网接口拉起

  1. ifconfig eth1 up
复制代码

然后运行命令 让公网接口自动分配一个10开头的地址

  1. dhcpcd eth1
复制代码

得到IP地址
如下信息输出:

  1. eth1      Link encap:Ethernet  HWaddr 00:06:5B:6A:D2:29
  2.           inet addr:10.161.39.107  Bcast:10.161.39.255  Mask:255.255.255.0
  3.           UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1
  4.           RX packets:480 errors:0 dropped:0 overruns:326 frame:0
  5.           TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
  6.           collisions:0 txqueuelen:1000
  7.           RX bytes:34335 (33.5 Kb)  TX bytes:3720 (3.6 Kb)
  8.           Interrupt:11 Base address:0xe880
复制代码

在/usr/local/racer中运行如下命令

  1. root@slack:/usr/local/racer# sh ecou.sh start
  2. All names of your net interface installed
  3. -----------------------------------------
  4.         eth0    0
  5.         eth1    1
  6. Input one name to hace access with Internet (eth0): eth1
  7. The name of interface is:  eth1
  8. The process is checking your IP address, please hold on ...
  9. sh: line 1: ifdown: command not found
  10. sh: line 1: ifup: command not found
  11. Please Enter your LOGIN: ZZA10009838
  12. Input a password: and your PASSWORD:
  13. Your passwd is correct, please wait for renewing IP address ...
  14. sh: line 1: ifdown: command not found
  15. sh: line 1: ifup: command not found
  16. racer has been started successfully
  17. root@slack:/usr/local/racer# You have got a CORRECT ip address with 10.161.39.107, so could you keep your surfering with INTERNET
复制代码

呵呵,这个时候还不能用,因为还没有更新到公网IP,但是用户名和口令验证包已经发出去了
看看错误提示 ,原来没有ifdown 和ifup的命令,我们继续

  1. ifconfig eth1 down
  2. ifconfig eth1 up
复制代码

然后 杀掉dhcp信息

  1. dhcpcd -k eth1
复制代码

重新获得dhcp信息

  1. dhcpcd eth1
复制代码

这个时候会出现错误提示

  1. root@slack:/usr/local/racer# [2005-08-29 04:36:13] Your IP Address has been changed under no conditions, to be terminated
  2. The process is going to quit ...
  3. sh: line 1: ifdown: command not found
  4. sh: line 1: ifup: command not found
  5. You have halted this process, and for normal network, please run it again, Thanks!!!
复制代码

原来racer进程发现eth1接口ip已经改变,ps一下,发现进程自动退出了.
正好,我们再运行一次吧.

  1. root@slack:/usr/local/racer# sh ecou.sh start
  2. All names of your net interface installed
  3. -----------------------------------------
  4.         eth0    0
  5.         eth1    1
  6. Input one name to hace access with Internet (eth0): eth1
  7. The name of interface is:  eth1
  8. The process is checking your IP address, please hold on ...
  9. sh: line 1: ifdown: command not found
  10. sh: line 1: ifup: command not found
  11. Please Enter your LOGIN: ZZA10009838
  12. Input a password: and your PASSWORD:
  13. Your passwd is correct, please wait for renewing IP address ...
  14. sh: line 1: ifdown: command not found
  15. sh: line 1: ifup: command not found
  16. racer has been started successfully
  17. root@slack:/usr/local/racer# You have got a CORRECT ip address with 219.156.81.143, so could you keep your surfering with INTERNET
复制代码

哈哈,终于获得公网IP了.

保持dhcpcd 进程 和 racer进程不退出的情况下就不会断线,我已经做了好几个晚上的实验

  1. ps -axf

  2. 1726 ?        Ss     0:00 dhcpcd eth1
  3. 1832 pts/1    S      0:00 ./racer eth1
复制代码

再看看无任何其他网络软件运行 racer 干了些什么

  1. netstat -a

  2. udp        0      0 219.156.81.143:32769    202.111.142.3:2167      ESTABLISHED
复制代码

原来如此

把以上过程做一个shell 脚本,哈哈 舒服了


原文地址 http://slackware.zzmobile.com/bl ... d=a_20050829_051312
欢迎讨论 后续 如何通过slackware在网通上做透明代理.
http://slackware.zzmobile.com
 楼主| 发表于 2005-8-29 05:26:58 | 显示全部楼层
补充

down.sh 脚本

#!/bin/sh
sh ecou.sh stop
ifconfig eth1 down
ifconfig eth1 up
sleep 5
/sbin/dhcpcd eth1 -k
ifconfig eth1 down
ifconfig eth1 up
sleep 5
dhcpcd eth1
回复 支持 反对

使用道具 举报

发表于 2005-8-30 00:46:03 | 显示全部楼层
网通专门提供了linux客户端拨号的脚本吗?
感觉第一次运行dhcpd时获得的应该是网通内部的私有网络地址,随后用racer获得的才是真正的公网地址吧。但为什么这么麻烦,不是直接获取到ip就能上网?是不是为了阻止带自动pppoe拨号的MODEM共享上网?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-8-30 10:37:27 | 显示全部楼层
很简单,他不想让大家共享上网,据了解,河南只是一个开始
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表