如何使用家中的openVPN當跳板連到Internet

小弟因工作關係, 常駐在客戶的公司中, ( 資訊業被客戶榨乾的苦命勞工 )
客戶的連外internet全部都封鎖, 只允許IE透過Proxy 看看網頁.
但是因為有緊急狀況時, 小弟需要連線到別的客戶電腦系統去解決問題.

因此小弟在家中架設了一台openVPN ( 架在XP 上 ) ,
目前已經可以從客戶端這邊連線回到家中的openVPN網段,
但不知道要如何設定才能讓在客戶端的這台筆電能不受阻礙的連到internet呢 ?
小弟在這先感謝大大的指導...


客戶端的網段 __________家中的網段___________ openVPN的網段
10.33.0.XXX =====> 192.168.2.XXX ====> 192.168.1.XXX
我只能跟你說

你可以設定 windows xp 內建的 vpn

用pptp 撥號的連回你家中

部過繼的轉 1732 port 就好

還有建議用固定 ip 來用 vpn

因為公司風 youtobe , 我用 vpn 連回家就可以看 utobe 了

margok700i wrote:
你可以設定 windows xp 內建的 vpn

用pptp 撥號的連回你家中

謝謝大大的建議,
不過看Google找到的資料, XP的VPN(PPTP) 只允許一人連線,
小弟的VPN Server需要提供3,4人同時連入,
所以才會選擇有SSL功能的免費軟體openVPN.

另小弟家中對外的ADSL是固定IP沒錯 ( 光世代, PPoE的固定IP )

不知是否有大大可以指導小弟一下,
要如何在openVPN的設定檔中設定Route Table,
才能讓客戶端連入的電腦可以存取internet呢?
你的client的.ovpn裡面有沒有設定route-gateway且enable redirect-gateway

# Use the following to have your client computer send all traffic through your router
# (remote gateway)
remote XXXX.dyndns.org
port 1194
dev tap
secret static.key
proto udp
comp-lzo
route-gateway 192.168.1.1
redirect-gateway


參考DD-WRT裡面關於OpenVPN的設定
http://www.dd-wrt.com/wiki/index.php/OpenVPN

1tac wrote:
route-gateway 192.168.1.1
redirect-gateway

大大您好 , 我已經在Client.ovpn 中加入此兩個參數 ,
但還是無法連結到Internet,
是不是我還有哪個指令需要下嗎?

另謝謝您的DD-WRT的介紹....但小弟英文真的不夠好....有看沒有懂...
還是謝謝你的建議...
參考
http://openvpn.net/index.php/open-source/documentation/howto.html#redirect

試試看在Server端加上這兩行

push "redirect-gateway def1"
push "dhcp-option DNS xxx.xxx.xxx.xxx"

如果還不行, 先把VPN連起來, 再從client端tracert 168.95.1.1, 看看是卡在哪裡

1tac wrote:
push "dhcp-option DNS xxx.xxx.xxx.xxx"

請問大大,
你這裡 xxx.xxx.xxx.xxx 指的是中華電信公開的DNS呢,
還是內部無線AP的IP: 192.168.2.1 ,
還是VPN虛擬網段IP: 192.168.1.1 呢?

1tac wrote:
如果還不行, 先把VPN連起來, 再從client端tracert 168.95.1.1, 看看是卡在哪裡

不好意思. 168.95.1.1 應該是指中華電信的DNS,
請問一下, 如果跳板功能成功的話,
封包跑的順序是 192.168.1.6 ( 客戶端 ) --> 192.168.1.1 ( VPN Getway ) --> 168.95.1.1 嗎?
redial wrote:
不好意思. 168....(恕刪)


我大概知道你的問題了, 你client端原本的IP是192.168.1.xxx, VPN拿到的IP也是192.168.1.xxx, 這樣會造成routing混亂, 所以你必須把VPN的網段錯開

以小弟為例, Router刷DD-WRT做為VPN Server, Router LAN端設192.168.7.1, 設定給VPN Client的IP亦為192.168.7.111~192.168.7.113

今有台在外的PC, IP為192.168.1.xxx, 原本tracer 168.95.1.1的結果如下, 可知封包是透過原本的gateway出去

1 3 ms <1 ms <1 ms 192.168.1.1 (原本的gateway)
2 * 235 ms 278 ms 10.8.52.221
3 223 ms 238 ms 219 ms 211-xxx-xxx-134.dynamic.hinet.net [211.xxx.xxx.134]
4 * 255 ms 208 ms tp-sc-mx01.router.hinet.net [203.75.135.158]
5 * 185 ms 238 ms tp-sc-t64-1.router.hinet.net [220.128.5.202]
6 230 ms * 275 ms tp-crs12.router.hinet.net [220.128.4.18]
7 204 ms 226 ms 238 ms tp-s2-c12r2.router.hinet.net [220.128.2.217]
8 202 ms 229 ms 270 ms 210-59-204-198.HINET-IP.hinet.net [210.59.204.198]
9 257 ms 235 ms 209 ms hntp1.hinet.net [168.95.192.1]


VPN撥起來後, 拿到192.168.7.111的IP, tracer 168.95.1.1的結果如下

1 28 ms 40 ms 46 ms DD-WRT [192.168.7.1]
2 33 ms 50 ms 74 ms 59-xxx-xxx-254.HINET-IP.hinet.net [59.xxx.xxx.254]
3 62 ms 33 ms 33 ms tp-s2-c76r5.router.hinet.net [168.95.80.194]
4 71 ms 34 ms 70 ms tp-crs12.router.hinet.net [220.128.2.230]
5 77 ms 42 ms 45 ms tp-s2-c12r2.router.hinet.net [220.128.4.193]
6 33 ms 36 ms 43 ms 210-59-204-189.HINET-IP.hinet.net [210.59.204.189]
7 33 ms 80 ms 44 ms dns.hinet.net [168.95.1.1]

可知VPN撥起來後, 封包確實透過VPN繞出去了

文章分享
評分
評分
複製連結

今日熱門文章 網友點擊推薦!