iptables + openVPN 相關應用 - Linux

Table of Contents

※ 引述《hizuki (ayaka)》之銘言:
: ※ 引述《gn00618777 (非常念舊)》之銘言:
: : 板友好,想請教ㄧ個問題
---------------
| |
| vpn server |
| |
|-------------|
↑ ↑
| |
| |
(device 上有兩個interface | |
一個是tun0:10.8.0.X另一個是eth1 | |
eth1:192.168.30.1) --------- ------------
device computer
--------- -------------
↓↓↓↓
b1b2b3b4
b1~b4:192.168.30.X
: : device 和 coumputer 連上 server 後在同個網域,可以互相 ping 到,也可以 ping
: : 到 servver, b1~b4 可以 ping 到 counputer ,但 computer 無法 ping 到
: : 192.168.30.X
: : 這 iptables 可以做到嗎 謝謝。
: 無需nat,也和iptables沒什麼關係。妳要看看openvpn的ccd選項,如果不會可以再問我
: 。這個通過路由比nat快多了。

先謝謝提供關鍵字,但我還差一點。

server.conf:

client-config-dir ccd
route 192.168.30.0 255.255.255.0 //增加 server 往192.168.30.X 的路由
push "192.168.30.0 255.255.255.0"// 增加到 client 往 192.168.30.X 的路由


ccd/client:

iroute 192.168.30.0 255.255.255.0 //告訴server 我 client 有內網192.168.30.X


然後

device <-----------------> computer OK
device 底下的設備 ------> computer OK
device 底下的設備 ------> server OK

device 底下的設備 <----------------- server 也ok了!!!

最後只差 computer -------> device 底下的設備還無法

這個 computer 的作業系統為 Windows,我先在 cmd 內加上路由

"route ADD 192.168.30.0 MASK 255.255.255.0 10.8.0.2"

但最後 computer 連上 server 還不能 ping 192.168.30.X >"<





--

All Comments

Kristin avatarKristin2014-12-06
我用 linux 的 computer 可以 ping 到了,原因是
Caroline avatarCaroline2014-12-07
computer ---> d1~d4 的路由要設對