Port forward to vpn client and from the client forward further to local IPPort forward to VPN Client?OpenVPN...
Meaning of "half-crown enclosure"
Does science define life as "beginning at conception"?
How many wires should be in a new thermostat cable?
If a character has cast the Fly spell on themselves, can they "hand off" to the Levitate spell without interruption?
Is there a word for pant sleeves?
csname in newenviroment
A nasty indefinite integral
Find this Unique UVC Palindrome ( ignoring signs and decimal) from Given Fractional Relationship
Proto-Indo-European (PIE) words with IPA
Is a world with one country feeding everyone possible?
Are clauses with "который" restrictive or non-restrictive by default?
amsmath: How can I use the equation numbering and label manually and anywhere?
How does the Earth's center produce heat?
Real Analysis: Proof of the equivalent definitions of the derivative.
VHDL: Why is it hard to desgin a floating point unit in hardware?
Why "strap-on" boosters, and how do other people say it?
Are there any tips to help hummingbirds find a new feeder?
Ratings matrix plot
What does `LOGFILE=${1:-/var/log/syslog}` do?
Passport queue length in UK in relation to arrival method
nginx conf: http2 module not working in Chrome in ubuntu 18.04
Is it safe to redirect stdout and stderr to the same file without file descriptor copies?
Is being an extrovert a necessary condition to be a manager?
Are there historical examples of audiences drawn to a work that was "so bad it's good"?
Port forward to vpn client and from the client forward further to local IP
Port forward to VPN Client?OpenVPN and routing problem on OpenWRTExternal port forwarding stop working when VPN is activatedOpenVPN public IP on tun0 interface instead of vpn networkOpenvpn Port Forwarding for a game servercan't forward port through openVPN using iptables on debianPort forwarding to VPN clientPort forwarding using OpenVPN clientPort forwarding openvpn server to clientPort forwarding over OpenVpn
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
I have a raspberry pi with raspbian os which is connected to an openvpn server. Openvpn server has public IP and runs Ubuntu.
I am able to reach a web application which runs on raspberry pi via public ip address of the vpn server if I enable port forwarding on the vpn server this way (XXX.XXX.XXX.XXX is a public ip):
iptables -t nat -A PREROUTING -d XXX.XXX.XXX.XXX -p tcp --dport 8765 -j DNAT --to-dest 10.8.0.6:8765
But I would like to reach also an IP camera which is on the same LAN as the raspberry is. Unfortunately I can't run openvpn client on the ip camera, so the IP camera has only local IP 192.168.1.110 and it listens on port 80. Is it possible to forward a port on the public IP to raspberry pi openvpn client and then forward further to the ip camera on the local lan?
openvpn port-forwarding
bumped to the homepage by Community♦ 53 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I have a raspberry pi with raspbian os which is connected to an openvpn server. Openvpn server has public IP and runs Ubuntu.
I am able to reach a web application which runs on raspberry pi via public ip address of the vpn server if I enable port forwarding on the vpn server this way (XXX.XXX.XXX.XXX is a public ip):
iptables -t nat -A PREROUTING -d XXX.XXX.XXX.XXX -p tcp --dport 8765 -j DNAT --to-dest 10.8.0.6:8765
But I would like to reach also an IP camera which is on the same LAN as the raspberry is. Unfortunately I can't run openvpn client on the ip camera, so the IP camera has only local IP 192.168.1.110 and it listens on port 80. Is it possible to forward a port on the public IP to raspberry pi openvpn client and then forward further to the ip camera on the local lan?
openvpn port-forwarding
bumped to the homepage by Community♦ 53 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
so let me understand this better, 1) you're saying that you're running openvpn client on raspberry pi to connect to the ubuntu server, correct? 2) You're also saying that the raspberry pi and the camera are on the same remote network, correct? 3) so the setup of openvpn is really road warrior rather than peer to peer, correct? it would help if you also provided the routes pushed by the vpn server, the local ips of the raspberry pi machine and the local ip of the camera. They don't need to be the actual ips, you write anything you want as long as it reflects the topology.
– Alex Austin
Oct 10 '17 at 22:25
@AlexAustin 1) Yes, raspberry pi runs raspbian linux and use openvpn to connect to the ubuntu server 2) Yes, ip camera and the raspberry are on the same LAN and use the same subnet 3) Raspberry pi and the ip camera are using internet connection which does not have public IP and this is the reason raspberry is connecting to the VPN server which has public IP. Then I can make portforward on the VPN server and I reach raspberry pi via VPN server's public IP.
– user241281
Oct 11 '17 at 7:03
@AlexAustin And this is the route which on raspberry pi:$ ip route show 0.0.0.0/1 via 10.8.0.1 dev tun0 default via 192.168.2.1 dev wlan0 src 192.168.2.151 metric 302 10.8.0.0/24 dev tun0 proto kernel scope link src 10.8.0.6 XXX.XXX.XXX.XXX via 192.168.2.1 dev wlan0 128.0.0.0/1 via 10.8.0.1 dev tun0 192.168.2.0/24 dev wlan0 proto kernel scope link src 192.168.2.151 metric 302
– user241281
Oct 11 '17 at 7:04
add a comment |
I have a raspberry pi with raspbian os which is connected to an openvpn server. Openvpn server has public IP and runs Ubuntu.
I am able to reach a web application which runs on raspberry pi via public ip address of the vpn server if I enable port forwarding on the vpn server this way (XXX.XXX.XXX.XXX is a public ip):
iptables -t nat -A PREROUTING -d XXX.XXX.XXX.XXX -p tcp --dport 8765 -j DNAT --to-dest 10.8.0.6:8765
But I would like to reach also an IP camera which is on the same LAN as the raspberry is. Unfortunately I can't run openvpn client on the ip camera, so the IP camera has only local IP 192.168.1.110 and it listens on port 80. Is it possible to forward a port on the public IP to raspberry pi openvpn client and then forward further to the ip camera on the local lan?
openvpn port-forwarding
I have a raspberry pi with raspbian os which is connected to an openvpn server. Openvpn server has public IP and runs Ubuntu.
I am able to reach a web application which runs on raspberry pi via public ip address of the vpn server if I enable port forwarding on the vpn server this way (XXX.XXX.XXX.XXX is a public ip):
iptables -t nat -A PREROUTING -d XXX.XXX.XXX.XXX -p tcp --dport 8765 -j DNAT --to-dest 10.8.0.6:8765
But I would like to reach also an IP camera which is on the same LAN as the raspberry is. Unfortunately I can't run openvpn client on the ip camera, so the IP camera has only local IP 192.168.1.110 and it listens on port 80. Is it possible to forward a port on the public IP to raspberry pi openvpn client and then forward further to the ip camera on the local lan?
openvpn port-forwarding
openvpn port-forwarding
edited Oct 11 '17 at 6:58
user241281
asked Oct 10 '17 at 18:42
user241281user241281
63
63
bumped to the homepage by Community♦ 53 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 53 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
so let me understand this better, 1) you're saying that you're running openvpn client on raspberry pi to connect to the ubuntu server, correct? 2) You're also saying that the raspberry pi and the camera are on the same remote network, correct? 3) so the setup of openvpn is really road warrior rather than peer to peer, correct? it would help if you also provided the routes pushed by the vpn server, the local ips of the raspberry pi machine and the local ip of the camera. They don't need to be the actual ips, you write anything you want as long as it reflects the topology.
– Alex Austin
Oct 10 '17 at 22:25
@AlexAustin 1) Yes, raspberry pi runs raspbian linux and use openvpn to connect to the ubuntu server 2) Yes, ip camera and the raspberry are on the same LAN and use the same subnet 3) Raspberry pi and the ip camera are using internet connection which does not have public IP and this is the reason raspberry is connecting to the VPN server which has public IP. Then I can make portforward on the VPN server and I reach raspberry pi via VPN server's public IP.
– user241281
Oct 11 '17 at 7:03
@AlexAustin And this is the route which on raspberry pi:$ ip route show 0.0.0.0/1 via 10.8.0.1 dev tun0 default via 192.168.2.1 dev wlan0 src 192.168.2.151 metric 302 10.8.0.0/24 dev tun0 proto kernel scope link src 10.8.0.6 XXX.XXX.XXX.XXX via 192.168.2.1 dev wlan0 128.0.0.0/1 via 10.8.0.1 dev tun0 192.168.2.0/24 dev wlan0 proto kernel scope link src 192.168.2.151 metric 302
– user241281
Oct 11 '17 at 7:04
add a comment |
so let me understand this better, 1) you're saying that you're running openvpn client on raspberry pi to connect to the ubuntu server, correct? 2) You're also saying that the raspberry pi and the camera are on the same remote network, correct? 3) so the setup of openvpn is really road warrior rather than peer to peer, correct? it would help if you also provided the routes pushed by the vpn server, the local ips of the raspberry pi machine and the local ip of the camera. They don't need to be the actual ips, you write anything you want as long as it reflects the topology.
– Alex Austin
Oct 10 '17 at 22:25
@AlexAustin 1) Yes, raspberry pi runs raspbian linux and use openvpn to connect to the ubuntu server 2) Yes, ip camera and the raspberry are on the same LAN and use the same subnet 3) Raspberry pi and the ip camera are using internet connection which does not have public IP and this is the reason raspberry is connecting to the VPN server which has public IP. Then I can make portforward on the VPN server and I reach raspberry pi via VPN server's public IP.
– user241281
Oct 11 '17 at 7:03
@AlexAustin And this is the route which on raspberry pi:$ ip route show 0.0.0.0/1 via 10.8.0.1 dev tun0 default via 192.168.2.1 dev wlan0 src 192.168.2.151 metric 302 10.8.0.0/24 dev tun0 proto kernel scope link src 10.8.0.6 XXX.XXX.XXX.XXX via 192.168.2.1 dev wlan0 128.0.0.0/1 via 10.8.0.1 dev tun0 192.168.2.0/24 dev wlan0 proto kernel scope link src 192.168.2.151 metric 302
– user241281
Oct 11 '17 at 7:04
so let me understand this better, 1) you're saying that you're running openvpn client on raspberry pi to connect to the ubuntu server, correct? 2) You're also saying that the raspberry pi and the camera are on the same remote network, correct? 3) so the setup of openvpn is really road warrior rather than peer to peer, correct? it would help if you also provided the routes pushed by the vpn server, the local ips of the raspberry pi machine and the local ip of the camera. They don't need to be the actual ips, you write anything you want as long as it reflects the topology.
– Alex Austin
Oct 10 '17 at 22:25
so let me understand this better, 1) you're saying that you're running openvpn client on raspberry pi to connect to the ubuntu server, correct? 2) You're also saying that the raspberry pi and the camera are on the same remote network, correct? 3) so the setup of openvpn is really road warrior rather than peer to peer, correct? it would help if you also provided the routes pushed by the vpn server, the local ips of the raspberry pi machine and the local ip of the camera. They don't need to be the actual ips, you write anything you want as long as it reflects the topology.
– Alex Austin
Oct 10 '17 at 22:25
@AlexAustin 1) Yes, raspberry pi runs raspbian linux and use openvpn to connect to the ubuntu server 2) Yes, ip camera and the raspberry are on the same LAN and use the same subnet 3) Raspberry pi and the ip camera are using internet connection which does not have public IP and this is the reason raspberry is connecting to the VPN server which has public IP. Then I can make portforward on the VPN server and I reach raspberry pi via VPN server's public IP.
– user241281
Oct 11 '17 at 7:03
@AlexAustin 1) Yes, raspberry pi runs raspbian linux and use openvpn to connect to the ubuntu server 2) Yes, ip camera and the raspberry are on the same LAN and use the same subnet 3) Raspberry pi and the ip camera are using internet connection which does not have public IP and this is the reason raspberry is connecting to the VPN server which has public IP. Then I can make portforward on the VPN server and I reach raspberry pi via VPN server's public IP.
– user241281
Oct 11 '17 at 7:03
@AlexAustin And this is the route which on raspberry pi:
$ ip route show 0.0.0.0/1 via 10.8.0.1 dev tun0 default via 192.168.2.1 dev wlan0 src 192.168.2.151 metric 302 10.8.0.0/24 dev tun0 proto kernel scope link src 10.8.0.6 XXX.XXX.XXX.XXX via 192.168.2.1 dev wlan0 128.0.0.0/1 via 10.8.0.1 dev tun0 192.168.2.0/24 dev wlan0 proto kernel scope link src 192.168.2.151 metric 302
– user241281
Oct 11 '17 at 7:04
@AlexAustin And this is the route which on raspberry pi:
$ ip route show 0.0.0.0/1 via 10.8.0.1 dev tun0 default via 192.168.2.1 dev wlan0 src 192.168.2.151 metric 302 10.8.0.0/24 dev tun0 proto kernel scope link src 10.8.0.6 XXX.XXX.XXX.XXX via 192.168.2.1 dev wlan0 128.0.0.0/1 via 10.8.0.1 dev tun0 192.168.2.0/24 dev wlan0 proto kernel scope link src 192.168.2.151 metric 302
– user241281
Oct 11 '17 at 7:04
add a comment |
1 Answer
1
active
oldest
votes
Try to do the following on raspberry:
# echo 1 > /proc/sys/net/ipv4/ip_forward
# iptables -t nat -I PREROUTING -p tcp --dport 8088 -j DNAT --to <cameraip>:<camera port>
# iptables -t nat -I POSTROUTING -s <cameraip>/255.255.255.0 -j MASQUERADE
Then access the camera the same way you access the app on the pi, but use port 8088 instead of 8765. Good luck.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f397287%2fport-forward-to-vpn-client-and-from-the-client-forward-further-to-local-ip%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Try to do the following on raspberry:
# echo 1 > /proc/sys/net/ipv4/ip_forward
# iptables -t nat -I PREROUTING -p tcp --dport 8088 -j DNAT --to <cameraip>:<camera port>
# iptables -t nat -I POSTROUTING -s <cameraip>/255.255.255.0 -j MASQUERADE
Then access the camera the same way you access the app on the pi, but use port 8088 instead of 8765. Good luck.
add a comment |
Try to do the following on raspberry:
# echo 1 > /proc/sys/net/ipv4/ip_forward
# iptables -t nat -I PREROUTING -p tcp --dport 8088 -j DNAT --to <cameraip>:<camera port>
# iptables -t nat -I POSTROUTING -s <cameraip>/255.255.255.0 -j MASQUERADE
Then access the camera the same way you access the app on the pi, but use port 8088 instead of 8765. Good luck.
add a comment |
Try to do the following on raspberry:
# echo 1 > /proc/sys/net/ipv4/ip_forward
# iptables -t nat -I PREROUTING -p tcp --dport 8088 -j DNAT --to <cameraip>:<camera port>
# iptables -t nat -I POSTROUTING -s <cameraip>/255.255.255.0 -j MASQUERADE
Then access the camera the same way you access the app on the pi, but use port 8088 instead of 8765. Good luck.
Try to do the following on raspberry:
# echo 1 > /proc/sys/net/ipv4/ip_forward
# iptables -t nat -I PREROUTING -p tcp --dport 8088 -j DNAT --to <cameraip>:<camera port>
# iptables -t nat -I POSTROUTING -s <cameraip>/255.255.255.0 -j MASQUERADE
Then access the camera the same way you access the app on the pi, but use port 8088 instead of 8765. Good luck.
answered Oct 19 '17 at 14:28
Alex AustinAlex Austin
1756
1756
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f397287%2fport-forward-to-vpn-client-and-from-the-client-forward-further-to-local-ip%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
so let me understand this better, 1) you're saying that you're running openvpn client on raspberry pi to connect to the ubuntu server, correct? 2) You're also saying that the raspberry pi and the camera are on the same remote network, correct? 3) so the setup of openvpn is really road warrior rather than peer to peer, correct? it would help if you also provided the routes pushed by the vpn server, the local ips of the raspberry pi machine and the local ip of the camera. They don't need to be the actual ips, you write anything you want as long as it reflects the topology.
– Alex Austin
Oct 10 '17 at 22:25
@AlexAustin 1) Yes, raspberry pi runs raspbian linux and use openvpn to connect to the ubuntu server 2) Yes, ip camera and the raspberry are on the same LAN and use the same subnet 3) Raspberry pi and the ip camera are using internet connection which does not have public IP and this is the reason raspberry is connecting to the VPN server which has public IP. Then I can make portforward on the VPN server and I reach raspberry pi via VPN server's public IP.
– user241281
Oct 11 '17 at 7:03
@AlexAustin And this is the route which on raspberry pi:
$ ip route show 0.0.0.0/1 via 10.8.0.1 dev tun0 default via 192.168.2.1 dev wlan0 src 192.168.2.151 metric 302 10.8.0.0/24 dev tun0 proto kernel scope link src 10.8.0.6 XXX.XXX.XXX.XXX via 192.168.2.1 dev wlan0 128.0.0.0/1 via 10.8.0.1 dev tun0 192.168.2.0/24 dev wlan0 proto kernel scope link src 192.168.2.151 metric 302
– user241281
Oct 11 '17 at 7:04