Re: Hilfe mit IPTables

Thomas Köhler <[email protected]>
Newsgroups gmane.user-groups.linux.dresden
Message-ID <Y/J8CKUbs/r+/[email protected]>
Hi,

On Sun, Feb 19, 2023 at 06:48:08PM +0100, Luca Bertoncello <[email protected]> wrote:
> Am 19.02.2023 um 13:10 schrieb Heiko Schlittermann:
> > Alternativ, wenn Dir Bind auf 0.0.0.0, kombiniert mit Firewall zu
> > gefährlich erscheint, dann kannst Du immer noch mit socat einen Listener
> > auf die IP tun, die Du brauchst, und das dann zu 127.0.0.1 schicken.
> 
> Ich werde überlegen...
> Ich habe wirklich gehofft, dass ich einfach einen dummen Fehler machen
> und dass es über IPTables geht...

Du kannst den Port auch mittels xinetd weiterleiten.
https://www.centosblog.com/port-forwarding-using-xinetd-on-centos/
In deinem Fall is remote_server halt 127.0.0.1 und bind halt die
IP vom VPN.

Aber... bist du sicher, dass du
  sysctl -w net.ipv4.ip_forward=1
und
  sysctl -w net.ipv4.conf.all.route_localnet=1
schon probiert hast? Nicht dass dein iptables-Problem gar keines ist.
https://superuser.com/questions/661772/iptables-redirect-to-localhost
sieht zumindest so aus, als sollte das prinzipiell funktionieren.
Und ich konnte hier meinen auf 127.0.0.1:25 lauschenden postfix
mittels
iptables -t nat -A PREROUTING -p tcp --dport 2525 -j DNAT --to-destination 127.0.0.1:25
zunächst nicht über die externe IP und port 2525 erreichen, nach
sysctl -w net.ipv4.conf.all.route_localnet=1
allerdings schon.
Gesucht mittels "iptables port forwarding localhost". Allerdings
auf https://www.startpage.com, nicht google.

> Danke
> Luca Bertoncello
> ([email protected])

Ciao,
Thomas

-- 
 Thomas Köhler       Email:       [email protected]
     <><             WWW:              http://gott-gehabt.de
                     IRC: tkoehler       Freenode: thkoehler
                     PGP public key available from Homepage!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.