我的設定如下:
-------------------------------- ---------------------------------
|Digital Ocean droplet | |TC7200 router |
|Running OpenVPN server | <--> | |
| | |LAN: 192.168.0.1 |
|OpenVPN IP: 10.8.0.1 | |WAN: 78.11.146.13 |
-------------------------------- ---------------------------------
^
|
V
-------------------------------
| RaspberryPi+OpenVPN client |
| LAN: 192.168.0.28 |
| tun0: 10.8.0.6 |
-------------------------------
^
|
V
-------------------------------
| Android phone with IP Webcam|
| LAN: 192.168.0.39 |
-------------------------------
我想要實現的是從openvpn伺服器(10.8.0.1)存取IP WebCam(192.168.0.39)。
伺服器設定檔
port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
dh dh2048.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
client-config-dir ccd
route 192.168.0.0 255.255.255.0
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 67.207.67.2"
push "dhcp-option DNS 67.207.67.3"
client-to-client
keepalive 10 120
cipher AES-256-CBC
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
verb 3
explicit-exit-notify 1
CCD/客戶端
iroute 192.168.0.0 255.255.255.0
push route "192.168.0.0 255.255.255.0"
路線:
Destination Gateway Genmask Flags Metric Ref Use Iface
default 159.89.16.1 0.0.0.0 UG 0 0 0 eth0
10.8.0.0 10.8.0.2 255.255.255.0 UG 0 0 0 tun0
10.8.0.2 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
159.89.16.0 0.0.0.0 255.255.240.0 U 0 0 0 eth0
192.168.0.0 10.8.0.2 255.255.255.0 UG 0 0 0 tun0
透過此配置,我可以使用 ssh 從 openvpn 伺服器連接到 raspbery pi。我能夠從另一個 VPN 用戶端連接(ssh)或 ping 到樹莓派。但我不知道如何設定 openvpn 伺服器來存取樹莓派 LAN 裝置。也許我應該轉發家庭路由器上的一些連接埠?