LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   problem iptables (https://www.linuxquestions.org/questions/linux-software-2/problem-iptables-365995/)

stomach 09-22-2005 01:35 PM

problem iptables
 
I liberated everything to test.

The Problem that the redirect of the door does not function!

It only functions if the policing INPUT is ACCEPT.
Somebody can help me?



#!/bin/bash
modprobe iptable_nat
modprobe ip_conntrack
modprobe ip_nat_ftp

iptables -F
iptables -Z
iptables -X
iptables -t nat -F

iptables -P INPUT DROP
iptables -P FORWARD DROP


iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
echo 1 > /proc/sys/net/ipv4/ip_dynaddr

iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 8080 -j REDIRECT --to-port 80


iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -i eth1 -j ACCEPT
iptables -A INPUT -i eth0 -p tcp --dport 8080 --syn -j ACCEPT

iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i eth1 -j ACCEPT

Matir 09-22-2005 01:46 PM

Hint: The nat prerouting rules get run before the filter INPUT rules do. In other words: iptables -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT

stomach 09-22-2005 01:50 PM

One more time I can count on its aid.

Very thankz Matir! :) :)

Matir 09-22-2005 02:21 PM

No problem. Always glad to be able to help. :)


All times are GMT -5. The time now is 10:16 PM.