免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3743 | 回复: 9
打印 上一主题 下一主题

[OpenBSD] op47不能用adsl上网,一切默认安装,请帮忙。 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-07-26 23:27 |只看该作者 |倒序浏览
本帖最后由 chengqingtanyue 于 2010-07-31 01:39 编辑

我全用root 来操作。

以下是我的配置:


#ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33200
        priority: 0
        groups: lo
        inet 127.0.0.1 netmask 0xff000000
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
fxp0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
        lladdr 00:02:b3:1b:47:24
        priority: 0
        media: Ethernet autoselect (100baseTX full-duplex)
        status: active
enc0: flags=0<> mtu 1536
        priority: 0
pflog0: flags=141<UP,RUNNING,PROMISC> mtu 33200
        priority: 0
        groups: pflog




#----/etc/resolv.conf---

lookup file bind
nameserver 211.98.4.1

#----/etc/resolv.conf--




#-----------/etc/ppp/ppp.conf----
default:
set log Phase Chat IPCP CCP tun command
#set device /dev/cua01
set redial 15 0
set reconnect 15 10000
     
pppoe:
set device "!/usr/sbin/pppoe -i fxp0"
disable acfcomp protocomp
deny acfcomp
set mtu max 1492
set crtscts off
set speed sync
enable lqr
#---
set lqrperiod 5
set cd 5
#----
set dial
set login
set timeout 0
set authname "56665"
set authkey o9i8u
add! default HISADDR
# enable dns
enable mssfixup
#--------/etc/ppp/ppp.conf----



不知道 set device /dev/cua01 中的驱动器是否需要还是怎么配置?

上网命令
#ppp -ddial ppoe


还缺什么,请网友们提示一下,我刚用ob ,很多不懂。

论坛徽章:
0
2 [报告]
发表于 2010-07-27 08:59 |只看该作者
本帖最后由 chenyangbo 于 2010-07-27 09:03 编辑

ppp.conf 里的
default:
pppoe:
下面的行加 空格 or tab


####################################

  1. default:
  2.   set log Phase Chat LCP IPCP CCP tun command
  3.   set redial 15 0
  4.   set reconnect 15 10000

  5. pppoe:
  6.   set device "!/usr/sbin/pppoe -i ne1"
  7.   disable acfcomp protocomp
  8.   deny acfcomp
  9.   set mtu max 1492
  10.   set mru max 1492
  11.   set speed sync
  12.   enable lqr
  13.   set lqrperiod 5
  14.   set cd 5
  15.   set dial
  16.   set login
  17.   set timeout 0
  18.   set authname ********
  19.   set authkey ********
  20.   add! default HISADDR
  21.   enable dns
  22.   enable mssfixup
复制代码

论坛徽章:
1
寅虎
日期:2013-09-29 23:15:15
3 [报告]
发表于 2010-07-27 16:31 |只看该作者
直接这样就行
$ cat /etc/hostname.pppoe0
inet 0.0.0.0 255.255.255.255 NONE \
        pppoedev vr0 authproto pap \
        authname 'ADSL帐号' authkey '密码' up
dest 0.0.0.1
!/sbin/route add default 0.0.0.1


注: vr0是网卡

论坛徽章:
0
4 [报告]
发表于 2010-07-27 23:33 |只看该作者
多谢两位网友热心指点,我得ppp.conf  set前面只用了一个空格。
还有版主,多谢你的方法。

论坛徽章:
0
5 [报告]
发表于 2010-07-28 01:05 |只看该作者
openbsd 4.7 的配置文件与以前不同啊。。。
有些以前的选项是没有的。

自己弄成这样,还是不能上网。
  1. #
  2. default:
  3. set log Phase Chat LCP IPCP CCP tun command
  4. set device /dev/cua01
  5. # set speed 115200
  6. set dial "ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 5 \"\" AT OK-AT-OK ATE1Q0 OK \\dATDT\\T TIMEOUT 40 CONNECT"

  7. pppoe:
  8.         set device "!/usr/sbin/pppoe -i fxp0"
  9.         disable acfcomp protocomp
  10.         deny acfcomp
  11.         set mtu max 1492
  12.         set mru max 1492
  13. #        set crtscts off #------------
  14.         set speed sync
  15.         enable lqr
  16. #        set lqrperiod 10
  17. #        set cd 5
  18. #        set dial
  19.         set login
  20.         set timeout 0  #----ok
  21.         set authname "07742687665"
  22.         set authkey 11111111
  23.         enable dns
  24.         add default HISADDR   #----ok
  25. #        enable mssfixup     #--none this set


复制代码
不知道怎么出现了个    inet 6 ??

  1. lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33200
  2.         priority: 0
  3.         groups: lo
  4.         inet 127.0.0.1 netmask 0xff000000
  5.         inet6 ::1 prefixlen 128
  6.         inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
  7. fxp0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
  8.         lladdr 00:02:b4:1b:47:24
  9.         priority: 0
  10.         media: Ethernet autoselect (100baseTX full-duplex)
  11.         status: active
  12. enc0: flags=0<> mtu 1536
  13.         priority: 0
  14. pppoe0: flags=8851<UP,POINTOPOINT,RUNNING,SIMPLEX,MULTICAST> mtu 1492
  15.         priority: 0
  16.         dev: fxp0 state: PADI sent
  17.         sid: 0x0 PADI retries: 0 PADR retries: 0
  18.         sppp: phase establish authproto pap
  19.         groups: pppoe
  20.         inet 0.0.0.0 --> 0.0.0.0 netmask 0xffffffff     #-------------怎么有个inet 6 ??--------
  21.         inet6 fe80::202:b3ff:fe1b:4724%pppoe0 ->  prefixlen 64 scopeid 0x4
  22. pflog0: flags=141<UP,RUNNING,PROMISC> mtu 33200
  23.         priority: 0
  24.         groups: pflog
复制代码

论坛徽章:
0
6 [报告]
发表于 2010-07-28 01:08 |只看该作者
这是 openbsd 4.7 i386 的 /etc/ppp/ppp.conf.sample ,我自己看了几次,还是不太懂。请老大们帮忙。。

  1. #################################################################
  2. #
  3. #          PPP  Sample Configuration File
  4. #
  5. #          Originally written by Toshiharu OHNO
  6. #
  7. # $OpenBSD: ppp.conf.sample,v 1.24 2006/07/30 18:02:01 david Exp $
  8. #
  9. #################################################################

  10. # This file is separated into sections.  Each section is named with
  11. # a label starting in column 0 and followed directly by a ``:''.  The
  12. # section continues until the next section.  Blank lines and lines
  13. # beginning with ``#'' are ignored.
  14. #
  15. # Lines beginning with "!include" will ``include'' another file.  You
  16. # may want to ``!include ~/.ppp.conf'' for backwards compatibility.
  17. #

  18. # Default setup. Always executed when PPP is invoked.
  19. #  This section is *not* loaded by the ``load'' or ``dial'' commands.
  20. #
  21. #  This is the best place to specify your modem device, its DTR rate,
  22. #  and any logging specification.  Logging specs should be done first
  23. #  so that subsequent commands are logged.
  24. #
  25. default:
  26. set log Phase Chat LCP IPCP CCP tun command
  27. set device /dev/cua01
  28. set speed 115200
  29. set dial "ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 5 \"\" AT OK-AT-OK ATE1Q0 OK \\dATDT\\T TIMEOUT 40 CONNECT"

  30. # Client side PPP
  31. #
  32. #  Although the PPP protocol is a peer to peer protocol, we normally
  33. #  consider the side that makes the connection as the client and the
  34. #  side that receives the connection as the server.  Authentication
  35. #  is required by the server either using a unix-style login procedure
  36. #  or by demanding PAP or CHAP authentication from the client.
  37. #

  38. # An on demand example where we have dynamic IP addresses:
  39. #  If the peer assigns us an arbitrary IP (most ISPs do this) and we
  40. #  can't predict what their IP will be either, take a wild guess at
  41. #  some IPs that you can't currently route to.
  42. #
  43. #  The /0 bit in "set ifaddr" says that we insist on 0 bits of the
  44. #  specified IP actually being correct, therefore, the other side can assign
  45. #  any IP numbers.
  46. #
  47. #  The fourth arg to "set ifaddr" makes us send "0.0.0.0" as our requested
  48. #  IP number, forcing the peer to make the decision.
  49. #
  50. #  This entry also works with static IP numbers or when not in -auto mode.
  51. #  The ``add'' line adds a `sticky' default route that will be updated if
  52. #  and when any of the IP numbers are changed in IPCP negotiations.
  53. #  The "set ifaddr" is required in -auto mode.
  54. #
  55. #  Finally, the ``enable dns'' bit tells ppp to ask the peer for the
  56. #  nameserver addresses that should be used.  This isn't always supported
  57. #  by the other side, but if it is, /etc/resolv.conf will automatically be
  58. #  updated.
  59. #
  60. pmdemand:
  61. set phone 1234567
  62. set login "ABORT NO\\sCARRIER TIMEOUT 5 ogin:--ogin: ppp word: ppp"
  63. set timeout 120
  64. set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0
  65. add default HISADDR
  66. enable dns

  67. # When we want to use PAP or CHAP instead of using a unix-style login
  68. # procedure, we do the following.  Note, the peer suggests whether we
  69. # should send PAP or CHAP.  By default, we send whatever we're asked for.
  70. #
  71. PAPorCHAPpmdemand:
  72. set phone 1234567
  73. set login
  74. set authname MyName
  75. set authkey MyKey
  76. set timeout 120
  77. set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0
  78. add default HISADDR
  79. enable dns

  80. # On demand dialup example with static IP addresses:
  81. #  Here, the local side uses 192.244.185.226 and the remote side
  82. #  uses 192.244.176.44.
  83. #
  84. #  # ppp -auto ondemand
  85. #
  86. #  With static IP numbers, our setup is similar to dynamic:
  87. #  Remember, ppp.linkup is searched for a "192.244.176.44" label, then
  88. #  a "ondemand" label, and finally the "MYADDR" label.
  89. #
  90. ondemand:
  91. set phone 1234567
  92. set login "ABORT NO\\sCARRIER TIMEOUT 5 ogin:--ogin: ppp word: ppp"
  93. set timeout 120
  94. set ifaddr 192.244.185.226 192.244.176.44
  95. add default HISADDR
  96. enable dns

  97. # To connect via a GPRS or UMTS device (e.g. a mobile phone or a PC Card),
  98. # it's often necessary to set the access-point name (in this case 'internet')
  99. # which requires quotes in the dial string. This section shows the escaping
  100. # required. Devices that have not already authenticated the SIM card (like a
  101. # PC Card) need to issue the "AT+CPIN=xxxx" (xxxx being the PIN for the SIM
  102. # card) first.
  103. # For certain devices it is necessary to adjust the baud rate (speed setting)
  104. # and/or change the dial string to "*99***1#".
  105. # UMTS devices often allow control of the connect mode (UMTS only, GPRS only
  106. # or default to which is available); this can be controlled with the number
  107. # passed to the AT+CGDCONT command and is device dependant.
  108. # Some ISPs do special things in their IPCP session in order to negotiate
  109. # the IP addresses; in this case it may be necessary to play with the ifaddr
  110. # setting.
  111. # See also: com(4), ubsa(4), ucom(4) and umodem(4)
  112. #
  113. mobile:
  114. set device /dev/cuaU0
  115. set dial "ABORT ERROR ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 5 \
  116.            \"\" ATZ OK-ATZ-OK AT+CGDCONT=1,\\\"IP\\\",\\\"internet\\\" OK \\dATD\\T TIMEOUT 40 CONNECT"
  117. set phone "*99#"
  118. set speed 115200
  119. set login
  120. set timeout 0
  121. set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0
  122. add default HISADDR
  123. enable dns

  124. #                          Example segments
  125. #
  126. # The following lines may be included as part of your configuration
  127. # section and aren't themselves complete.  They're provided as examples
  128. # of how to achieve different things.

  129. examples:
  130. # Multi-phone example.  Numbers separated by a : are used sequentially.
  131. # Numbers separated by a | are used if the previous dial or login script
  132. # failed.  Usually, you will prefer to use only one of | or :, but both
  133. # are allowed.
  134. #
  135.     set phone 12345678|12345679:12345670|12345671
  136. #
  137. # Ppp can accept control instructions from the ``pppctl'' program.
  138. # First, you must set up your control socket.  It's safest to use
  139. # a UNIX domain socket, and watch the permissions:
  140. #
  141.     set server /var/tmp/internet MySecretPassword 0177
  142. #
  143. # Although a TCP port may be used if you want to allow control
  144. # connections from other machines:
  145. #
  146.     set server 6670 MySecretpassword
  147. #
  148. # If you don't like ppp's builtin chat, use an external one:
  149. #
  150.     set login "\"!chat \\\\-f /etc/ppp/ppp.dev.chat\""
  151. #
  152. # If we have a ``strange'' modem that must be re-initialized when we
  153. # hangup:
  154. #
  155.     set hangup "\"\" AT OK-AT-OK ATZ OK"
  156. #
  157. # To adjust logging withouth blasting the setting in default:
  158. #
  159.     set log -command +tcp/ip
  160. #
  161. # To see log messages on the screen in interactive mode:
  162. #
  163.     set log local LCP IPCP CCP
  164. #
  165. # If you're seeing a lot of magic number problems and failed connections,
  166. # try this (see the man page):
  167. #
  168.     set openmode active 5
  169. #
  170. # For noisy lines, we may want to reconnect (up to 20 times) after loss
  171. # of carrier, with 3 second delays between each attempt:
  172. #
  173.     set reconnect 3 20
  174. #
  175. # When playing server for M$ clients, tell them who our NetBIOS name
  176. # servers are:
  177. #
  178.     set nbns 10.0.0.1 10.0.0.2
  179. #
  180. # Inform the client if they ask for our DNS IP numbers:
  181. #
  182.     enable dns
  183. #
  184. # If you don't want to tell them what's in your /etc/resolv.conf file
  185. # with `enable dns', override the values:
  186. #
  187.     set dns 10.0.0.1 10.0.0.2
  188. #
  189. # If we're using the -alias switch, redirect ftp and http to an internal
  190. # machine:
  191. #
  192.     alias port 10.0.0.2:ftp ftp
  193.     alias port 10.0.0.2:http http
  194. #
  195. # or don't trust the outside at all
  196. #
  197.     alias deny_incoming yes
  198. #
  199. # I trust user brian to run ppp, so this goes in the `default' section:
  200. #
  201.     allow user brian
  202. #
  203. # But label `internet' contains passwords that even brian can't have, so
  204. # I empty out the user access list in that section so that only root can
  205. # have access:
  206. #
  207.     allow users
  208. #
  209. # I also may wish to set up my ppp login script so that it asks the client
  210. # for the label they wish to use.  I may only want user ``dodgy'' to access
  211. # their own label in direct mode:
  212. #
  213. dodgy:
  214.     allow user dodgy
  215.     allow mode direct
  216. #
  217. # If we don't want ICMP and DNS packets to keep the connection alive:
  218. #
  219.     set filter alive 0 deny icmp
  220.     set filter alive 1 deny udp src eq 53
  221.     set filter alive 2 deny udp dst eq 53
  222.     set filter alive 3 permit 0 0
  223. #
  224. # And we don't want ICMPs to cause a dialup:
  225. #
  226.     set filter dial 0 deny icmp
  227.     set filter dial 1 permit 0 0
  228. #
  229. # or any TCP SYN or RST packets (badly closed TCP channels):
  230. #
  231.     set filter dial 2 deny 0 0 tcp syn finrst
  232. #
  233. # Once the line's up, allow connections for ident (113), telnet (23),
  234. # ftp (20 & 21), DNS (53), my place of work (192.244.191.0/24),
  235. # ICMP (ping) and traceroute (>33433).
  236. #
  237. # Anything else is blocked by default
  238. #
  239.     set filter in  0 permit tcp dst eq 113
  240.     set filter out 0 permit tcp src eq 113
  241.     set filter in  1 permit tcp src eq 23 estab
  242.     set filter out 1 permit tcp dst eq 23
  243.     set filter in  2 permit tcp src eq 21 estab
  244.     set filter out 2 permit tcp dst eq 21
  245.     set filter in  3 permit tcp src eq 20 dst gt 1023
  246.     set filter out 3 permit tcp dst eq 20
  247.     set filter in  4 permit udp src eq 53
  248.     set filter out 4 permit udp dst eq 53
  249.     set filter in  5 permit 192.244.191.0/24 0/0
  250.     set filter out 5 permit 0/0 192.244.191.0/24
  251.     set filter in  6 permit icmp
  252.     set filter out 6 permit icmp
  253.     set filter in  7 permit udp dst gt 33433
  254.     set filter out 7 permit udp dst gt 33433

  255. #
  256. # ``dodgynet'' is an example intended for an autodial configuration which
  257. # is connecting a local network to a host on an untrusted network.
  258. dodgynet:
  259.     # Log link uptime
  260.     set log Phase
  261.     # For autoconnect only
  262.     allow modes auto
  263.     # Define modem device and speed
  264.     set device /dev/cua01
  265.     set speed 115200
  266.     # Don't support LQR
  267.     deny lqr
  268.     # Remote system phone number, login and password
  269.     set phone 0W1194
  270.     set authname pppLogin
  271.     set authkey MyPassword
  272.     # Chat script to dial remote system
  273.     set dial "ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 5 \"\" ATZ OK-ATZ-OK \
  274.               ATE1Q0M0 OK \\dATDT\\T TIMEOUT 40 CONNECT"
  275.     # Chat script to login to remote Unix system
  276.     set login "TIMEOUT 10 \"\" \"\" gin:--gin: \\U word: \\P"
  277.     # Drop the link after 15 minutes of inactivity
  278.     # Inactivity is defined by the `set filter alive' line below
  279.     set timeout 900
  280.     # Hard-code remote system to appear within local subnet and use proxy arp
  281.     # to make this system the gateway
  282.     set ifaddr 172.17.20.247 172.17.20.248 255.255.240.0
  283.     enable proxy

  284.     # Allow any TCP packet to keep the link alive
  285.     set filter alive 0 permit tcp

  286.     # Only allow dialup to be triggered by http, rlogin, rsh, telnet, ftp or
  287.     # private TCP ports 24 and 4000
  288.     set filter dial  0 7      0 0 tcp dst eq http
  289.     set filter dial  1 7      0 0 tcp dst eq login
  290.     set filter dial  2 7      0 0 tcp dst eq shell
  291.     set filter dial  3 7      0 0 tcp dst eq telnet
  292.     set filter dial  4 7      0 0 tcp dst eq ftp
  293.     set filter dial  5 7      0 0 tcp dst eq 24
  294.     set filter dial  6 deny ! 0 0 tcp dst eq 4000
  295.     # From hosts on a couple of local subnets to the remote peer
  296.     # If the remote host allowed IP forwarding and we wanted to use it, the
  297.     # following rules could be split into two groups to separately validate
  298.     # the source and destination addresses.
  299.     set filter dial  7 permit 172.17.16.0/20  172.17.20.248
  300.     set filter dial  8 permit 172.17.36.0/22  172.17.20.248
  301.     set filter dial  9 permit 172.17.118.0/26 172.17.20.248
  302.     set filter dial 10 permit 10.123.5.0/24   172.17.20.248

  303.     # Once the link's up, limit outgoing access to the specified hosts
  304.     set filter out  0 4      172.17.16.0/20  172.17.20.248
  305.     set filter out  1 4      172.17.36.0/22  172.17.20.248
  306.     set filter out  2 4      172.17.118.0/26 172.17.20.248
  307.     set filter out  3 deny ! 10.123.5.0/24   172.17.20.248
  308.     # Allow established TCP connections
  309.     set filter out  4 permit 0 0 tcp estab
  310.     # And new connections to http, rlogin, rsh, telnet, ftp and ports
  311.     # 24 and 4000
  312.     set filter out  5 permit 0 0 tcp dst eq http
  313.     set filter out  6 permit 0 0 tcp dst eq login
  314.     set filter out  7 permit 0 0 tcp dst eq shell
  315.     set filter out  8 permit 0 0 tcp dst eq telnet
  316.     set filter out  9 permit 0 0 tcp dst eq ftp
  317.     set filter out 10 permit 0 0 tcp dst eq 24
  318.     set filter out 11 permit 0 0 tcp dst eq 4000
  319.    
复制代码

论坛徽章:
0
7 [报告]
发表于 2010-07-28 15:41 |只看该作者
我的配置文件,一直都在用,

default:
set log Phase Chat LCP IPCP CCP tun command
set redial 15 0
set reconnect 15 10000

pppoe:
set device "!/usr/sbin/pppoe -i re0"
disable acfcomp protocomp
deny acfcomp
set mtu max 1492
set mru max 1492
set speed sync
set crtscts off
enable lqr
enable mssfixup
set lqrperiod 5
set cd 5
set dial
set login
set timeout 0
set authname xxxxxxx@163.gd
set authkey xxxxxxx
# enable dns
add default HISADDR6
add default HISADDR

论坛徽章:
0
8 [报告]
发表于 2010-07-28 21:58 |只看该作者
本帖最后由 chengqingtanyue 于 2010-07-31 01:48 编辑

回 23 号:


在openbsd 4.7 /etc/ppp/ppp.conf.sample 没发现有 set cd 5 选项。

我也是copy这个配置,不行。不解啊。。

论坛徽章:
0
9 [报告]
发表于 2010-07-31 01:42 |只看该作者
请问配置的选项是否都能在ppp.conf.sample里找到?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP