iptbales / nat

Rund um die Sicherheit des Systems und die Applikationen
Post Reply
dadark
Posts: 13
Joined: 2003-06-04 07:18
 

iptbales / nat

Post by dadark »

Also.. Ich will Port 2021 auf eine andere IP und einen anderen Port weiterleiten.
Ich hab dazu mal dieses hier gebastelt:
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 2021 -j DNAT --to-destination 217.160.x.x:80
Ist auf nem 1und1 Server auf dem Debian woody mit dem Kernel 2.4.18 rennt.
Helft miir ;)
Ich verzweifel gleich :(

-- Ein genervter dadark
wirsing
Posts: 604
Joined: 2002-11-20 21:32
Location: Vaihingen und Karlsruhe
 

Re: iptbales / nat

Post by wirsing »

dadark wrote:Helft miir ;)
Ich verzweifel gleich :(
Warum? Ist doch korrekt!
dadark
Posts: 13
Joined: 2003-06-04 07:18
 

Re: iptbales / nat

Post by dadark »

Genau das isses ja.
Und es geht einfach nicht ;(
Hab ich ja ganz vergessen oben zu schreiben *g
Sorry
dodolin
Posts: 3840
Joined: 2003-01-21 01:59
Location: Sinsheim/Karlsruhe
Contact:
 

Re: iptbales / nat

Post by dodolin »

Wenn es auf dem selben Rechner ist, solltest du lieber -j REDIRECT --to-port xx nehmen. :) Hier tut das jedenfalls.
rootmaster
Posts: 483
Joined: 2002-04-28 13:30
Location: Hannover
 

Re: iptbales / nat

Post by rootmaster »

such mal nach "port forwarding", in dem thread habe ich schon mal eine lösung gepostet ;)

"back to the roots"
bobby
Posts: 146
Joined: 2003-08-03 13:42
 

Re: iptbales / nat

Post by bobby »

Hi!

Ich bin mir nicht ganz sicher, aber ich hatte das Problem auch schon mal und ich meine es mit

Code: Select all

echo 1 > /proc/sys/net/ipv4/ip_forward
gelöst zu haben. Ansonsten funktioniert die Regel bei mir genau so wie du sie oben zitiert hast.

Gruß

Bobby
dodolin
Posts: 3840
Joined: 2003-01-21 01:59
Location: Sinsheim/Karlsruhe
Contact:
 

Re: iptbales / nat

Post by dodolin »

Wenn es auf dem selben Rechner lokal ist, braucht man kein ip_forward.
bobby
Posts: 146
Joined: 2003-08-03 13:42
 

Re: iptbales / nat

Post by bobby »

Hi!

Er möchte aber auf ne andere IP Forwarden.
Ich will Port 2021 auf eine andere IP und einen anderen Port weiterleiten.
Gruß

Bobby
dadark
Posts: 13
Joined: 2003-06-04 07:18
 

Re: iptbales / nat

Post by dadark »

Ah, danke schön :)
So funktionierts :)
Post Reply