Linux & IPTables: Einfache Portweiterleitung

This post was published 12 years 1 month 25 days ago, so the post may be outdated.

Mit Linux und IPTables ist es sehr einfach, einen Port von Server A zu einen bestimmten Port zu Server B weiterzuleiten.
Es sind nur 3 Befehle:
iptables -A INPUT -i eth0 -p tcp --dport PORTA -j ACCEPT
iptables -t nat -A PREROUTING -t nat -p tcp -d SERVERA --dport PORTA -j DNAT --to SERVERB:PORTB
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Die fettgedruckten Wörter müssen ersetzt werden.
eth0 ist dabei die Standard-Netzwerkkarte. Diese ist meistens bei jeden System gleich.
Herausfinden kann man diese mit dem Befehl:
ifconfig

Patrik Kernstock

May I introduce my self? I am Patrik Kernstock, 25 years old, perfectionist, born in Austria and living in Ireland, Cork. Me explained in short: Tech- and security enthusiast, series & movies junky. Interesting in Linux, Container-stuff and many software solutions by Microsoft, Veeam and VMware.

0 0 votes
Article Rating
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x