openwrt下openvpn如何設定chnroute?

本帖最後由 122003 於 2012-5-22 12:13 編輯

連外問題解決
到研究緊chnroute點搞
http://code.google.com/p/chnroutes/wiki/Usage

同時在openvpn配置文件的頭部添加一句 max-routes num, 其中num是一個不小於文件routes.txt的行數的數字, 實際上因為還有一些服務器端push過來的路由信息, 所以保險起見可以用 routes.txt的行數加上50, 比如目前得到的routes.txt的行數是940, 你可以把數字設置為1000: max-routes 1000

前幾步都無問題
問題喺第4步,應該用咩格式寫入config檔?

option 'max-routes 3600'
list 'push' 'route 1.0.1.0 255.255.255.0 net_gateway 5'

咁樣???

==============================
opnwrt下面裝openvpn
主要參考官網教學
http://wiki.openwrt.org/doc/howto/vpn.openvpn
http://www.joeho.org/wordpress/?p=3849

連就連到,亦ping到gateway 10.0.0.1,client互ping都通
但係出唔到街
睇過route print,去gw的Metric係1
真係R爆頭,有冇人知要點搞

server設定如下
config 'openvpn' 'lan'
        option 'enable' '1'
        option 'proto' 'tcp'
        option 'dev' 'tap0'
        option 'ca' '/etc/openvpn/ca.crt'
        option 'cert' '/etc/openvpn/server.crt'
        option 'key' '/etc/openvpn/server.key'
        option 'dh' '/etc/openvpn/dh1024.pem'
        option 'ifconfig_pool_persist' '/mnt/log/ipp.txt'
        option 'comp_lzo' '1'
        option 'persist_key' '1'
        option 'persist_tun' '1'
        option 'log' '/tmp/openvpn.log'
        option 'status' '/mnt/log/openvpn-status.log'
        option 'verb' '3'
        option 'dev_type' 'tap'
        option 'keepalive' '10 180'
        option 'port' '1194'
        option 'client_to_client' '1'
        option 'server_bridge' '10.0.0.1 255.255.255.224 10.0.0.16 10.0.0.20'
        list 'push' 'redirect-gateway def1'
        list 'push' 'dhcp-option DNS 10.0.0.1'
        #list 'push' 'dhcp-option DNS 8.8.8.8'
        list 'push' 'route-gateway 10.0.0.1'

本帖最後由 tomleehk 於 2012-5-22 09:27 編輯

Possibly DNS problem of your VPN server. At client, try http://74.125.71.103 and see if the client can turn up with google. If it can turn up, then it is DNS problem of your VPN server.

Try below script at VPN server to use DNS 8.8.8.8 (google's public DNS server) instead of 10.0.0.1 to resolve:

list 'push' 'redirect-gateway def1'
#list 'push' 'dhcp-option DNS 10.0.0.1'
list 'push' 'dhcp-option DNS 8.8.8.8'
list 'push' 'route-gateway 10.0.0.1'

TOP

本帖最後由 122003 於 2012-5-22 12:14 編輯

回復 2# tomleehk
連外問題早幾日解決左,多謝關心
依家研究緊chnroutes點搞
  1. config 'openvpn' 'lan'
  2.         option 'enable' '1'
  3.         option 'proto' 'udp'
  4.         option 'dev' 'tap0'
  5.         option 'ca' '/etc/openvpn/ca.crt'
  6.         option 'cert' '/etc/openvpn/server.crt'
  7.         option 'key' '/etc/openvpn/server.key'
  8.         option 'dh' '/etc/openvpn/dh1024.pem'
  9.         option 'ifconfig_pool_persist' '/mnt/log/ipp.txt'
  10.         option 'comp_lzo' '1'
  11.         option 'persist_key' '1'
  12.         option 'persist_tun' '1'
  13.         option 'log' '/tmp/openvpn.log'
  14.         option 'status' '/mnt/log/openvpn-status.log'
  15.         option 'verb' '3'
  16.         option 'dev_type' 'tap'
  17.         option 'keepalive' '10 180'
  18.         option 'port' '1194'
  19.         option 'server_bridge' '10.0.0.1 255.255.255.224 10.0.0.16 10.0.0.20'
  20.         list 'push' 'redirect-gateway def1'
  21.         list 'push' 'dhcp-option DNS 10.0.0.1'
  22.         option 'client_to_client' '1'
複製代碼

TOP