OpenVPN проброс порта за клиента
Добавлено: 2018-09-13 0:44:43
пробросить порт 80 за OpenVPN клиента на видеорегистратор.
C VPS 46.29.165.29 ping 192.168.1.11 проходит, а вот редирект нет. Пните в нужную сторону.
Это не помогает
или это тоже не работатет
и это пробовал тоже не работатет
root@v47483:~# tcpdump -n port 80
OpenVPN Server Ubunt 16
OpenVPN Client OpenWRT
Если кто поможет удаленно сделать, можно обсудить финансовую составляющую.
Код: Выделить всё
запрос http://46.29.165.29 --> { 46.29.165.29 OpenVPN Server 10.0.0.1 } <--> { 10.0.0.6 192.168.1.0/24 } <-->videorecorder 192.168.1.11
Это не помогает
Код: Выделить всё
iptables -t nat -A PREROUTING -p tcp -d 46.29.165.29 --dport 80 -j DNAT --to-destination 192.168.1.11:80
iptables -t nat -A POSTROUTING -p tcp -d 192.168.1.11 --dport 80 -j SNAT --to-source 46.29.165.29
Код: Выделить всё
iptables -t nat -A PREROUTING -i esn18 -p tcp --dport 80 -j DNAT --to 192.168.1.11:80
iptables -t nat -A POSTROUTING -o esn18 -j MASQUERADE
iptables -A FORWARD -i esn18 -o esn18 -d 192.168.1.11 -j ACCEPT
Код: Выделить всё
#iptables -t nat -A PREROUTING -i ens18 -p tcp -d 46.29.165.29 --dport 80 -j DNAT --to 192.168.1.11:80
#iptables -A FORWARD -i ens18 -o tun0 -d 192.168.1.11 -p tcp --dport 80 -j ACCEPT
root@v47483:~# tcpdump -n port 80
Код: Выделить всё
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on tun0, link-type RAW (Raw IP), capture size 262144 bytes
00:28:11.978596 IP 84.42.28.194.14228 > 192.168.1.11.80: Flags [S], seq 576969783, win 8192, options [mss 1440,nop,wscale 8,nop,nop,sackOK], length 0
00:28:14.984790 IP 84.42.28.194.14228 > 192.168.1.11.80: Flags [S], seq 576969783, win 8192, options [mss 1440,nop,wscale 8,nop,nop,sackOK], length 0
00:28:20.983488 IP 84.42.28.194.14228 > 192.168.1.11.80: Flags [S], seq 576969783, win 8192, options [mss 1440,nop,nop,sackOK], length 0
Код: Выделить всё
root@v47483:~# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 46.29.165.1 0.0.0.0 UG 0 0 0 ens18
10.0.0.0 10.0.0.1 255.255.255.0 UG 0 0 0 tun0
10.0.0.2 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
46.29.165.0 0.0.0.0 255.255.255.0 U 0 0 0 ens18
192.168.1.0 10.0.0.1 255.255.255.0 UG 0 0 0 tun0
Код: Выделить всё
root@OpenWRT:~# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.8.1 0.0.0.0 UG 40 0 0 eth1
10.0.0.1 10.0.0.5 255.255.255.255 UGH 0 0 0 tun0
10.0.0.5 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 br-lan
192.168.8.0 0.0.0.0 255.255.255.0 U 40 0 0 eth1
192.168.8.1 0.0.0.0 255.255.255.255 UH 40 0 0 eth1