找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 4614|回复: 3

两个路由器之间Openvirtual**无法连上

[复制链接]
发表于 2012-10-20 18:08 | 显示全部楼层 |阅读模式
本帖最后由 davi1989 于 2012-10-20 21:45 编辑

服务器端为tomato系统 非双wan版
配置文件如下
  1. # Automatically generated configuration
  2. daemon
  3. server-bridge
  4. proto udp
  5. port 6570
  6. dev tap21
  7. cipher BF-CBC
  8. comp-lzo adaptive
  9. keepalive 15 60
  10. verb 3
  11. client-config-dir ccd
  12. client-to-client
  13. tls-auth static.key 0
  14. ca ca.crt
  15. dh dh.pem
  16. cert server.crt
  17. key server.key
  18. status-version 2
  19. status status

  20. # Custom Configuration
  21. script-security 2
  22. push "redirect-gateway"
  23. duplicate-cn
  24. keepalive 10 120
复制代码
客户端是HG255D刷Openwrt
配置文件如下
  1. ##############################################
  2. # Sample client-side Openvirtual** 2.0 config file #
  3. # for connecting to multi-client server.     #
  4. #                                            #
  5. # This configuration can be used by multiple #
  6. # clients, however each client should have   #
  7. # its own cert and key files.                #
  8. #                                            #
  9. # On Windows, you might want to rename this  #
  10. # file so it has a .ovirtual** extension           #
  11. ##############################################

  12. # Specify that we are a client and that we
  13. # will be pulling certain config file directives
  14. # from the server.
  15. client

  16. # Use the same setting as you are using on
  17. # the server.
  18. # On most systems, the virtual** will not function
  19. # unless you partially or fully disable
  20. # the firewall for the TUN/TAP interface.
  21. dev tap
  22. ;dev tun

  23. # Windows needs the TAP-Win32 adapter name
  24. # from the Network Connections panel
  25. # if you have more than one.  On XP SP2,
  26. # you may need to disable the firewall
  27. # for the TAP adapter.
  28. ;dev-node MyTap

  29. # Are we connecting to a TCP or
  30. # UDP server?  Use the same setting as
  31. # on the server.
  32. ;proto udp
  33. proto udp

  34. # The hostname/IP and port of the server.
  35. # You can have multiple remote entries
  36. # to load balance between the servers.
  37. remote   

  38. # Choose a random host from the remote
  39. # list for load-balancing.  Otherwise
  40. # try hosts in the order specified.
  41. ;remote-random

  42. # Keep trying indefinitely to resolve the
  43. # host name of the Openvirtual** server.  Very useful
  44. # on machines which are not permanently connected
  45. # to the internet such as laptops.
  46. resolv-retry infinite

  47. # Most clients don't need to bind to
  48. # a specific local port number.
  49. nobind

  50. # Downgrade privileges after initialization (non-Windows only)
  51. ;user nobody
  52. ;group nobody

  53. # Try to preserve some state across restarts.
  54. ;persist-key
  55. ;persist-tun

  56. # If you are connecting through an
  57. # HTTP proxy to reach the actual Openvirtual**
  58. # server, put the proxy server/IP and
  59. # port number here.  See the man page
  60. # if your proxy server requires
  61. # authentication.
  62. ;http-proxy-retry # retry on connection failures
  63. ;http-proxy 192.168.36.254 8080 authfile.txt

  64. # Wireless networks often produce a lot
  65. # of duplicate packets.  Set this flag
  66. # to silence duplicate packet warnings.
  67. mute-replay-warnings

  68. # SSL/TLS parms.
  69. # See the server config file for more
  70. # description.  It's best to use
  71. # a separate .crt/.key file pair
  72. # for each client.  A single ca
  73. # file can be used for all clients.
  74. ca ca.crt
  75. cert client.crt
  76. key client.key

  77. # Verify server certificate by checking
  78. # that the certicate has the nsCertType
  79. # field set to "server".  This is an
  80. # important precaution to protect against
  81. # a potential attack discussed here:
  82. #  http://openvirtual**.net/howto.html#mitm
  83. #
  84. # To use this feature, you will need to generate
  85. # your server certificates with the nsCertType
  86. # field set to "server".  The build-key-server
  87. # script in the easy-rsa folder will do this.
  88. ns-cert-type server

  89. # If a tls-auth key is used on the server
  90. # then every client must also have the key.
  91. tls-auth ta.key 1

  92. ;remote-cert-tls server


  93. # Select a cryptographic cipher.
  94. # If the cipher option is used on the server
  95. # then you must also specify it here.
  96. ;cipher x

  97. # Enable compression on the virtual** link.
  98. # Don't enable this unless it is also
  99. # enabled in the server config file.
  100. comp-lzo

  101. # Set log file verbosity.
  102. verb 3

  103. # Silence repeating messages
  104. ;mute 20
复制代码
在终端里运行后的结果如下
  1. root@HG255D:/etc/openvirtual**# openvirtual** Client.conf
  2. Sat Oct 20 17:49:29 2012 Openvirtual** 2.1.4 mipsel-openwrt-linux [SSL] [LZO2] [EPOLL] built on Oct 19 2012
  3. Sat Oct 20 17:49:29 2012 NOTE: Openvirtual** 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
  4. Sat Oct 20 17:49:29 2012 WARNING: file 'client.key' is group or others accessible
  5. Sat Oct 20 17:49:29 2012 WARNING: file 'ta.key' is group or others accessible
  6. Sat Oct 20 17:49:29 2012 Control Channel Authentication: using 'ta.key' as a Openvirtual** static key file
  7. Sat Oct 20 17:49:29 2012 Outgoing Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
  8. Sat Oct 20 17:49:29 2012 Incoming Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
  9. Sat Oct 20 17:49:29 2012 LZO compression initialized
  10. Sat Oct 20 17:49:29 2012 Control Channel MTU parms [ L:1574 D:166 EF:66 EB:0 ET:0 EL:0 ]
  11. Sat Oct 20 17:49:29 2012 Socket Buffers: R=[112640->131072] S=[112640->131072]
  12. Sat Oct 20 17:49:39 2012 Data Channel MTU parms [ L:1574 D:1450 EF:42 EB:135 ET:32 EL:0 AF:3/1 ]
  13. Sat Oct 20 17:49:39 2012 UDPv4 link local: [undef]
  14. Sat Oct 20 17:49:39 2012 UDPv4 link remote: 60.166.181.48:6570
  15. Sat Oct 20 17:49:39 2012 TLS: Initial packet from 60.166.181.48:6570, sid=a5be874a 18c5d10b
  16. Sat Oct 20 17:49:39 2012 VERIFY OK: depth=1, /C=CN/ST=Guangdong/L=Guangzhou/O=salem/OU=salem/CN=salem/emailAddress=salemsu@21cn.com
  17. Sat Oct 20 17:49:39 2012 VERIFY OK: nsCertType=SERVER
  18. Sat Oct 20 17:49:39 2012 VERIFY OK: depth=0, /C=CN/ST=Guangdong/O=salem/OU=salem/CN=salem/emailAddress=salemsu@21cn.com
  19. Sat Oct 20 17:49:40 2012 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
  20. Sat Oct 20 17:49:40 2012 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
  21. Sat Oct 20 17:49:40 2012 Data Channel Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
  22. Sat Oct 20 17:49:40 2012 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
  23. Sat Oct 20 17:49:40 2012 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 1024 bit RSA
  24. Sat Oct 20 17:49:40 2012 [salem] Peer Connection Initiated with 60.166.181.48:6570
  25. Sat Oct 20 17:49:43 2012 SENT CONTROL [salem]: 'PUSH_REQUEST' (status=1)
  26. Sat Oct 20 17:49:43 2012 PUSH: Received control message: 'PUSH_REPLY,redirect-gateway,route-gateway dhcp,ping 10,ping-restart 120'
  27. Sat Oct 20 17:49:43 2012 OPTIONS IMPORT: timers and/or timeouts modified
  28. Sat Oct 20 17:49:43 2012 OPTIONS IMPORT: route options modified
  29. Sat Oct 20 17:49:43 2012 OPTIONS IMPORT: route-related options modified
  30. Sat Oct 20 17:49:43 2012 TUN/TAP device tap0 opened
  31. Sat Oct 20 17:49:43 2012 TUN/TAP TX queue length set to 100
  32. Sat Oct 20 17:49:43 2012 NOTE: unable to redirect default gateway -- virtual** gateway parameter (--route-gateway or --ifconfig) is missing
  33. Sat Oct 20 17:49:43 2012 Initialization Sequence Completed
复制代码
运行后无效果,ip地址不变
openwrt对我这种新手来说真是太复杂了.
电脑上装的Openvirtual** GUI使用这个配置文件就能成功.求高手指点
服务器端是WR-500U刷tomato,设置如下

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
我的恩山、我的无线 The best wifi forum is right here.
发表于 2012-10-20 21:37 | 显示全部楼层
先在路由上 ping www.baidu.com ,如果能访问 就是防火墙
防火墙开下
iptables -I INPUT -i tap -j ACCEPT
iptables -I FORWARD -o tap -j ACCEPT
iptables -t nat -I POSTROUTING  -o tap -j MASQUERADE
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2012-10-20 21:53 | 显示全部楼层
nsxuan 发表于 2012-10-20 21:37
先在路由上 ping www.baidu.com ,如果能访问 就是防火墙
防火墙开下
iptables -I INPUT -i tap -j ACCEP ...

感谢帮助!在putty中输入了三个命令 再次运行,openvirtual**输出日志还是那样,我把tomato服务器端的配置文件帖到了一楼.就是推送网关失败,真麻烦
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2012-10-20 22:57 | 显示全部楼层
nsxuan 发表于 2012-10-20 21:37
先在路由上 ping www.baidu.com ,如果能访问 就是防火墙
防火墙开下
iptables -I INPUT -i tap -j ACCEP ...

感谢你 之前服务器端是tap,我重新配置成了tun.成功连接,根据你的命令稍微修改后成功翻墙
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

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

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-26 04:20

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

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