PCDVD數位科技討論區

PCDVD數位科技討論區 (https://www.pcdvd.com.tw/index.php)
-   七嘴八舌異言堂 (https://www.pcdvd.com.tw/forumdisplay.php?f=12)
-   -   [網路問題]OPENVPN該如何設定PORT轉送 (https://www.pcdvd.com.tw/showthread.php?t=850755)

網路問題 2009-05-03 01:36 AM

[網路問題]OPENVPN該如何設定PORT轉送
 
網路架構示意圖如下



目前123.xxx.xxx.xxx的電腦都可以連140.xxx.xxx.xxa的電腦

140.xxx.xxx.xx之間的電腦可以互連

但是140.xxx.xxx.xxb跟140.xxx.xxx.xxc的電腦不允許外部ip連接

openvpn已經在140.xxx.xxx.xxa上面架設完成

123.xxx.xxx.xxx的電腦也可以順利從140.xxx.xxx.xxa的電腦上拿到192.168.3.x的ip

也可以在123跟140兩個網段間互相ping的到192.168.3.x的ip

可是目前可能是router路徑問題

123.xxx.xxx.xxx的電腦要連接140.xxx.xxx.xxb跟140.xxx.xxx.xxc的電腦

還是走真實ip的通道

而不是走140.xxx.xxx.xxa開vpn後的192.168.3.x的通道

請問該如何解決

謝謝

誠實豆沙包 2009-05-03 01:50 AM

route add 140.xxx.xxx.0 mask xxx.xxx.xxx.xxx 140.xxx.xxx.a

route add 192.168.3.0 mask xxx.xxx.xxx.xxx 140.xxx.xxx.a

網路問題 2009-05-03 02:32 AM

補充一下

雙方都在xp下

以下使用xp的route print指令

得到router列表如下

Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 123.xxx.xxx.254 123.xxx.xxx.81 20
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
140.113.218.0 255.255.255.0 192.168.3.5 192.168.3.6 1
123.xxx.xxx.0 255.255.255.0 123.xxx.xxx.81 123.xxx.xxx.81 20
123.xxx.xxx.81 255.255.255.255 127.0.0.1 127.0.0.1 20
123.xxx.255.255 255.255.255.255 123.xxx.xxx.81 123.xxx.xxx.81 20
192.168.3.0 255.255.255.0 192.168.3.5 192.168.3.6 1
192.168.3.4 255.255.255.252 192.168.3.6 192.168.3.6 30
192.168.3.6 255.255.255.255 127.0.0.1 127.0.0.1 30
192.168.3.255 255.255.255.255 192.168.3.6 192.168.3.6 30
224.0.0.0 240.0.0.0 123.xxx.xxx.81 123.xxx.xxx.81 20
224.0.0.0 240.0.0.0 192.168.3.6 192.168.3.6 30
255.255.255.255 255.255.255.255 123.xxx.xxx.81 123.xxx.xxx.81 1
255.255.255.255 255.255.255.255 192.168.3.6 192.168.3.6 1
Default Gateway: 123.xxx.xxx.254
===========================================================================
Persistent Routes:
None


根據網友提示輸入

以下指令

route add 140.xxx.xxx.0 mask 255.255.255.0 140.xxx.xxx.a

route add 192.168.3.0 mask 255.255.255.0 140.xxx.xxx.a

或以下指令

route add 140.xxx.xxx.0 mask 255.255.255.0 140.xxx.xxx.a metric if

route add 192.168.3.0 mask 255.255.255.0 140.xxx.xxx.a metric if

皆得到錯誤訊息如下

The route addition failed: Either the interface index is wrong or the gateway does not lie on the same network as the interface. Check the IP Address Table for the machine.

謝謝

誠實豆沙包 2009-05-03 02:43 AM

route add 192.168.3.0 mask 255.0.0.0 [140.xxx.xxx.a這台的"192.168.3.x"]

route change 也可

網路問題 2009-05-03 08:37 PM

E:\route add 192.168.3.0 mask 255.0.0.0 192.168.3.1
The route addition failed: The specified mask parameter is invalid. (Destination
& Mask) != Destination.


E:\route change 192.168.3.0 mask 255.0.0.0 192.168.3.1

The route change failed: The specified mask parameter is invalid. (Destination & Mask) != Destination.

執行後出現上述狀況

route列表沒有更改

此外openvpn也有點小問題

openvpn的網路卡拿到的ip是沒有gateway的

只有拿到 ip 192.168.3.3 mask 255.255.255.0 沒有gateway

謝謝

someone_love 2009-05-06 04:25 PM

建議你可以試試看Port forwarding

lompt 2009-05-07 01:33 AM

如果是DHCP
在DHCP時就可以指定路由派發了吧


所有的時間均為GMT +8。 現在的時間是06:21 PM.

vBulletin Version 3.0.1
powered_by_vbulletin 2025。