iptables problem

Rund um die Sicherheit des Systems und die Applikationen
Post Reply
t.kuhmann
Posts: 82
Joined: 2003-01-14 22:13
Contact:
 

iptables problem

Post by t.kuhmann »

hi ich habe folgendes problem mit den iptables
ich habe hier nen server (gateway) stehen, der mir den weg ins internet ermöglichen soll das ist auch so weit in ordnung
in dem iptable script will ich den port 80 auf einen anderen rechner weiterleiten
nun mein problem wenn ich das akktivier, werde ich nicht auf den anderen rechern weitergeleitet
kann mit von euch erner behilflich sein..
zu der hardware
webserver 192.168.1.1
gateway 192.168.1.254
ppp0
eth0 ist die interne netwerkkarte 192.168.1.0/24
ich denke mal das das problem hier liegt
# map some ports
iptables -A PREROUTING -t nat -i $internet -s $ALL -p TCP --dport 80 -j DNAT --to-destination 192.168.1.1:80


das ganze script hier http://techlevel.ath.cx/linux/iptables

danke euch
oxygen
Posts: 2138
Joined: 2002-12-15 00:10
Location: Bergheim
 

Re: iptables problem

Post by oxygen »

Du weißt aber, das du selbst die Weiterleitung gar nicht überprüfen kannst, sondern dass es nur von aussen geht? Das Script sieht in Ordnung aus.
t.kuhmann
Posts: 82
Joined: 2003-01-14 22:13
Contact:
 

Re: iptables problem

Post by t.kuhmann »

ja aber wenn ich das script starte dann komm ich ja auch nich mehr is netz (internet)

wie meinst das is kann das nicht überpüfen?
wenn ich dann meine dyndns addy eingebe dann sollte ich das doch testen können
und die leute die es von ausen verucht haben kamen auch nciht drauf
t.kuhmann
Posts: 82
Joined: 2003-01-14 22:13
Contact:
 

Re: iptables problem

Post by t.kuhmann »

ich habe das noch einmal versucht, wenn ich die zeile auskommentire
iptables -A PREROUTING -t nat -i $internet -s $ALL -p TCP --dport 80 -j DNAT --to-destination 192.168.1.1:80
dann komm ich ins ins internet
is sie akktiv dann kommm ich nirgens hin ...
hat keiner eine iddee an was das liegen kann jeder vorschlag ist willkommen

thx
wirsing
Posts: 604
Joined: 2002-11-20 21:32
Location: Vaihingen und Karlsruhe
 

Re: iptables problem

Post by wirsing »

Probier doch mal

Code: Select all

iptables -A PREROUTING -t nat -i $internet -s $ALL -d $internetaddr -p TCP --dport 80 -j DNAT --to-destination 192.168.1.1:80
Wenn die Internetadresse dynamisch ist, dann in etwa:

Code: Select all

internetaddr=$(/sbin/ifconfig $internet | grep inet | cut -d' ' -f12 | cut -d':' -f2)[code]
ggf. Feintuning in den -f Parametern.
t.kuhmann
Posts: 82
Joined: 2003-01-14 22:13
Contact:
 

Re: iptables problem

Post by t.kuhmann »

so ich habe das noch einmal versusht und mittler tcpdump versucht auf ppp0 (port www)mir das anzuschaun mit dem ergebnis das nichts an kommt aber an was kann das liegen? die regel sollten doch da sein!
dodolin
Posts: 3840
Joined: 2003-01-21 01:59
Location: Sinsheim/Karlsruhe
Contact:
 

Re: iptables problem

Post by dodolin »

versucht auf ppp0 (port www)mir das anzuschaun mit dem ergebnis das nichts an kommt aber an was kann das liegen?
Wie schonmal erwähnt: Sowas muss man von extern testen.
t.kuhmann
Posts: 82
Joined: 2003-01-14 22:13
Contact:
 

Re: iptables problem

Post by t.kuhmann »

danke dann werde ich das noch einmal versuchen ...
habe aber keine grosse hoffung...

thx
blackdrum23
Posts: 85
Joined: 2003-09-30 21:24
Location: Aying
Contact:
 

2. ETH Interface

Post by blackdrum23 »

Mach mal einen TCP auf dein interface was weiterleitet.
Vielleicht geht ja nur was in die eine richtung.

Man beachte auch die Adresse die etwas zurückschickt auf deinem WAN Interface.
Matthias Diehl
Posts: 315
Joined: 2002-09-24 13:26
 

Re: iptables problem

Post by Matthias Diehl »

Also bei mir funzt das ohne das "destination" so:

Code: Select all

iptables -t nat -A PREROUTING -i ppp0 -p tcp --dport 80 -j DNAT --to 192.168.0.20:80
Post Reply