LinuxSir.cn,穿越时空的Linuxsir!

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

slackware下adsl拨号和动态域名的问题

[复制链接]
发表于 2004-7-31 19:14:34 | 显示全部楼层 |阅读模式
我在slackware 10下用adsl-setup建立的拨号.
可是一定要自己指定dns吗
能不能象windows下一样,自动获取dns地址?
还有我想让adsl在断线后自动重拨
还有就是等adsl连接成功后,执行/usr/local/bin/ez-updata -c /usr/local/bin/qdns.conf

不知道那位兄弟有办法.

我在www.3322.org看使用方法是freebsd下的.
是建立一ppp.uplink
说是拨号成功后,自动执行里面的内容.
不过好象slackware下不行呀
发表于 2004-8-1 11:07:10 | 显示全部楼层
adsl-setup 中,DNS选项用server
 楼主| 发表于 2004-8-1 11:31:52 | 显示全部楼层
这个我用了,但好象nslookup的时候,还是用的是我在/etc/resolv.conf里面设置的地址.
还有就是如何设置断线自动连接和连接后执行一个脚本呢?
 楼主| 发表于 2004-8-1 14:28:59 | 显示全部楼层
下面是rp-pppoe的howto connect
看了看,不过好像没有提到如何在拨号成功后,执行一些命令和断线后重新拨号

  1. # LIC: GPL

  2. $Id: HOW-TO-CONNECT,v 1.3 2002/04/09 17:28:38 dfs Exp $

  3. This package lets you connect a Linux machine to Sympatico HSE or Magma's
  4. high-speed service using a Nortel 1-meg modem.

  5. Follow these steps and you should have your high-speed service up and running.

  6. 0. Install the rp-pppoe-software
  7. --------------------------------

  8. You should have already done this by the time you're reading this.  If not,
  9. go back and read README.

  10. 1. Set up your Ethernet hardware
  11. --------------------------------

  12. First, make sure the Ethernet card you intend to use with the modem is
  13. visible to the Linux kernel.  Just how to do this is beyond the scope
  14. of this document.  However, if the card is the only Ethernet card in
  15. the system, executing:

  16.         ifconfig eth0

  17. should display something like this:

  18.         eth0      Link encap:Ethernet  HWaddr 00:60:67:62:31:D4  

  19. plust some more lines.  Your HWaddr will be different.  As long as you see
  20. the HWaddr line, your card should be working.

  21. DO NOT assign an IP address to the Ethernet card.  DO NOT configure the
  22. card to come up at boot time.

  23. 2. Configure various files
  24. --------------------------

  25. Several files need editing.  The easiest way to do this is to run
  26. the following command as root:

  27.         adsl-setup

  28. Answer the questions and you should be all set.  If you want to know what
  29. goes on behind the scenes, continue reading this document.  If you don't
  30. care and your connection works, stop reading. :-)

  31. 3. Edit pap-secrets
  32. -------------------

  33. Edit the "pap-secrets" file, inserting your proper user-ID and password.
  34. Install the file (or copy the relevant lines) to /etc/ppp/pap-secrets.
  35. Your ISP may use CHAP authentication.  In this case, add the line to
  36. /etc/ppp/chap-secrets.

  37. 4. Edit /etc/ppp/pppoe.conf
  38. -----------------------------

  39. The file /etc/ppp/pppoe.conf contains configuration information for the
  40. ADSL connection.  You need to edit the following items:

  41. - Change ETH=eth1 to the correct Ethernet device for your modem.
  42. - Change USER=bxxxnxnx@sympatico.ca to your proper ADSL user-ID.

  43. Don't edit any of the other settings unless you're an expert.

  44. 5. Set up DNS
  45. -------------

  46. If you are using DNS servers supplied by your ISP, edit the file
  47. /etc/resolv.conf to contain these lines:

  48.         nameserver ip_addr_of_first_dns_server
  49.         nameserver ip_addr_of_second_dns_server

  50. For example:

  51.         nameserver 204.101.251.1
  52.         nameserver 204.101.251.2


  53. 6. Firewall your machine
  54. ------------------------

  55. MAKE SURE YOU FIREWALL YOUR MACHINE.  A sample firewall script is given
  56. in the shell script "firewall"  To install the script:

  57. a) Copy it to /etc/rc.d/init.d/firewall
  58. b) Type: chkconfig firewall on
  59. c) Start the firewall: sh /etc/rc.d/init.d/firewall start

  60. (The above procedure works ONLY on Red Hat-like systems.)

  61. You may want to tweak the script somewhat.

  62. 7. Bring up the connection at boot time
  63. ---------------------------------------

  64. On a Red Hat system, the installation procedure should have installed
  65. a script called /etc/rc.d/init.d/adsl.  To bring up the connection
  66. at boot time, just type this command as root:

  67.         chkconfig --add adsl

  68. On non-Red-Hat systems, add this line to the end
  69. of /etc/rc.d/rc.local:

  70.         /usr/sbin/adsl-start

  71. 8. Configure LAN Hosts
  72. ----------------------

  73. If you have a LAN behind the firewall, you have to lower the TCP
  74. maximum segment size from the normal 1460 to 1452 (or better, 1412.)
  75. You have two options: Either set the MTU of all the interfaces on
  76. other hosts on the LAN to 1452, or use the "-m 1412" option to pppoe.
  77. The "-m" option for pppoe is far simpler and makes it easier to add
  78. hosts to the LAN, but consumes some extra CPU time.

  79. If you want to manually configure the LAN hosts, here's how:

  80. In Linux, use: "ifconfig eth0 mtu 1452".  For best results, put this
  81. in an /etc/rc.d/rc.local script.

  82. For Windows, machines, see [url]http://lan.cns.ksu.edu/OS/WIN95/slip95.htm.[/url]
  83. Set the MaxMTU to 1452.

  84. 9. Commands to control the ADSL link
  85. ------------------------------------

  86. As root, bring up the link by typing:   adsl-start
  87. As root, bring down the link by typing: adsl-stop

  88. That's it!

  89. --
  90. David F. Skoll <dfs@roaringpenguin.com> | Roaring Penguin Software Inc.
  91. [url]http://www.roaringpenguin.com[/url]           | Linux and UNIX Specialists

  92. PROBLEMS!  DAVE, IT DOESN'T WORK!
  93. ---------------------------------

  94. Here are some problems PPPoE users have encountered.

  95. -----------------------------------------------------------------------------
  96. A) Can't see the Ethernet interface

  97. Well, I can't really help you here.  To use these instructions, you must
  98. have Linux working to the point where it recognizes your Ethernet card.
  99. If you type "ifconfig ethx" and you get back a HWAddr value, your Ethernet
  100. card is probably OK.  But I really can't help with hardware configuration
  101. issues.

  102. -----------------------------------------------------------------------------
  103. B) Connection seems to come up, but I can't browse the web or ping anything

  104. You probably don't have DNS set up.  See step 6.

  105. -----------------------------------------------------------------------------
  106. C) Can't compile PPPoE

  107. I have only tested compilation on 2.2-kernel machines.  Make sure you have
  108. "make", the C compiler and all development header files installed.

  109. -----------------------------------------------------------------------------
  110. D) pppd complains about (i) "unknown option pty" or (ii) "pty option precludes
  111.    specifying device name"

  112. (i) Your pppd is too old.  You need at least 2.3.7.
  113. (ii) Your /etc/ppp/options file is not empty.  Empty it!

  114. -----------------------------------------------------------------------------
  115. E) pppoe dies with the log message "Message too long"

  116. You set the MTU of the Ethernet interface connected to the ADSL modem
  117. to less than 1500.  Don't do that.

  118. -----------------------------------------------------------------------------
  119. F) Internal hosts can't see the Internet

  120. Do you have masquerading set up?  I can't help you in great detail, but
  121. see the IPCHAINS-HOWTO and the IP-Masquerade mini-HOWTO.

  122. -----------------------------------------------------------------------------
  123. G) Authentication fails

  124. Make sure you have the right secret in /etc/ppp/pap-secrets.  Your ISP
  125. may be using CHAP; it won't hurt to copy the line to /etc/ppp/chap-secrets.

  126. Also, MAKE SURE that /etc/ppp/options is EMPTY.  The "adsl-connect" script
  127. supplies all required options on the command line; additional options
  128. in /etc/ppp/options may mess things up.

  129. -----------------------------------------------------------------------------
  130. H) VPN software does not work

  131. If you are using VPN software on a Windows or Linux machine with another
  132. Linux machine running PPPoE as the gateway, you MUST NOT use the "-m" option
  133. to pppoe.  This alters IP packets, which will break any VPN which uses IPSec.
  134. In /etc/ppp/pppoe.conf, set CLAMPMSS to "no".  You'll also have to reduce
  135. the MTU on the hosts behind the gateway to 1452.

  136. -----------------------------------------------------------------------------
  137. I) I can browse some web sites just fine, but others stall forever.

  138. There is probably a buggy router or firewall between you and the Web server.
  139. One possible workaround:  In /etc/ppp/pppoe.conf, find the line which reads:

  140.         CLAMPMSS=1412

  141. Try lowering the 1412 until it works (go down in steps of 100 or so.)  Each
  142. time you lower the value, you have to restart your connection like this:

  143.         adsl-stop; adsl-start

  144. This should work around buggy routers which do not support Path MTU discovery.

  145. -----------------------------------------------------------------------------
  146. J) Whenever I connect using ADSL, my internal LAN no longer sees the gateway

  147. You are more than likely running a 2.0.X Linux kernel.  To solve this
  148. problem, give the Ethernet card connected to the DSL modem a fake IP
  149. address.  For example, if eth0 is your internal LAN card and eth1 goes to
  150. the DSL modem, do something like this:

  151.         ifconfig eth1 10.0.0.1 netmask 255.255.255.0

  152. (You may have to choose a different IP address; experiment.)
  153. -----------------------------------------------------------------------------
  154. K) How can I run a script every time I connect and get a new IP address?

  155. Put the script in /etc/ppp/ip-up.  See the pppd(8) man page.
  156. -----------------------------------------------------------------------------
  157. L) Nothing works!

  158. You may need to put your Ethernet card in half-duplex, 10Mb/s mode to
  159. work with the DSL modem.  You may have to run a DOS program to do this,
  160. or pass special parameters to the Linux driver.

  161. Some providers object to attempts to set the MRU or MTU.  Try removing
  162. "mtu 1492 mru 1492" from PPP_STD_OPTIONS in the adsl-connect script.
  163. This problem has been seen with an ISP in Hong Kong.

  164. Your DSL provider may be using non-standard PPPoE frames or require
  165. something special in the Service-Name field.  If you have two computers,
  166. you can try sniffing out these values with the "pppoe-sniff" program.
  167. Type "man pppoe-sniff" for details.  If you don't have two computers,
  168. you'll have to ask your DSL provider if it uses non-standard PPPoE frames
  169. or special Service-Name fields.  Good luck getting an answer...

  170. If pppoe-sniff indicates that nothing is amiss, make sure the Ethernet
  171. card associated with the ADSL modem does NOT have a valid IP address.
  172. (NOTE: For 2.0 kernels, you may have to give it a fake IP address
  173. which is not on your internal subnet.  Something like 192.168.42.42
  174. might work if you are not using 192.168.42.*)

  175. If you are using synchronous PPP on a slow machine, try switching to
  176. asynchronous PPP.

  177. Make sure no entries in the routing table go through the Ethernet card
  178. connected to the ADSL modem.  You might want to add these lines in
  179. adsl-connect:

  180.         ifconfig ethx down
  181.         ifconfig ethx up mtu 1500

  182. which should reset things to sane values.

  183. #######################################################################
  184. #                        WHEN ALL ELSE FAILS:                         #
  185. #######################################################################

  186. If you are completely unable to connect, run the adsl-start script in
  187. debugging mode.  If you are using bash as your shell (if you don't
  188. know what your shell is, it's probably bash), type this:

  189.         DEBUG=1 adsl-start

  190. In tcsh or csh, use:

  191.         setenv DEBUG 1; adsl-start

  192. Then follow the instructions to mail the debugging file to me.  PLEASE
  193. DON'T DO THIS until you have exhausted all other avenues; rp-pppoe is
  194. free software and it costs me time and money to help people with
  195. problems.  While I don't mind doing this, I do mind it if you don't
  196. make an effort to fix the problem yourself first.

  197. WARNING: If you run adsl-start in debugging mode and you manage to
  198. connect, your connection will be extremely slow and huge amounts of
  199. data will quickly fill your /tmp directory.  Do not use debugging mode
  200. unless you really cannot get your connection to work.

  201. Be aware that debugging mode produces hex dumps which potentially reveal
  202. your user name and password.  If the debugging output includes packets
  203. labeled "PPPOE Session", you may wish to remove these packets from the
  204. dump before mailing it to me.

复制代码
 楼主| 发表于 2004-8-1 22:30:56 | 显示全部楼层
网上有说建立一个ip-up.local文件的.
但是好想并不执行里面的内容
发表于 2004-8-2 18:44:34 | 显示全部楼层
如果你还有windows的话,在win下拨号后,执行ipconfig,你会看到DNS的,有两个!很明显,其他的问题我不知道
 楼主| 发表于 2004-8-2 18:48:19 | 显示全部楼层
我知道dns的问题了
如果在给dns地址时空着,就可以自动获取了
发表于 2004-8-2 20:12:31 | 显示全部楼层
最初由 babo 发表
我知道dns的问题了
如果在给dns地址时空着,就可以自动获取了

仔细看提示信息不就没事儿了吗?填写server就是自动获取,因为默认是server,所以直接回车就行
DNS
Please enter the IP address of your ISP's primary DNS server.
If your ISP claims that 'the server will provide DNS addresses',
enter 'server' (all lower-case) here.

If you just press enter, I will assume you know what you are
doing and not modify your DNS setup.
>>> Enter the DNS information here:
发表于 2004-8-3 10:17:52 | 显示全部楼层
1、ADSL-SETUP的时候有关于DNS的选择,可以选择自动获得,也可以手工设置;

2、/etc/ppp/pppoe.conf 中设置 CONNECT_TIMEOUT=0,系统就会断线自动重拨了。中断到重拨间隔5″,好像可以在adsl-connect 中修改。

3、DDNS的问题我是单独运行的,不过我觉得可以在ADSL-SETUP的时候选择启用防火墙,这个防火墙脚本好像会每次都run一下,你可以把防火墙的脚本改成你想要的东东!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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