E
E
Edward2015-10-22 19:20:57
VPN
Edward, 2015-10-22 19:20:57

How to forward a port in ubuntu 14.04?

Hello.
I've been searching Google for almost a month now. But I can't find it.
The problem is this. The server has a vpn pptp and a ppp0 client with the address yyyy
and is the eth0 network card that looks at the Internet xxxx It is
necessary to make sure that when you enter xxxx:222 it gets to yyyy:8081
A certain site should open.
But I can't do it. When I log in to vpn as a ppp1 client and open the site, it does everything.
I tried this but it does not work.
-A PREROUTING -d xxxx/32 -p tcp -m tcp --dport 8081 -j DNAT --to-destination yyyy:8081
-A POSTROUTING -s yyy0/24 -o eth0 -j MASQUERADE
-A POSTROUTING -d yyyy/ 32 -p tcp -m tcp --dport 8081 -j SNAT --to-source xxxx

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vlad Zhivotnev, 2015-10-22
@inkvizitor68sl

rinetd will help - https://debian.pro/523

A
alegzz, 2015-10-25
@alegzz

-A PREROUTING -d xxxx/32 -p tcp -m tcp --dport 222 -j DNAT --to-destination yyyy:8081
and allow forwarding to iptables if default policy doesn't allow

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question