LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-22-2005, 02:35 PM   #1
stomach
Member
 
Registered: Sep 2005
Distribution: Debian
Posts: 202

Rep: Reputation: 30
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

Last edited by stomach; 09-22-2005 at 02:39 PM.
 
Old 09-22-2005, 02:46 PM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
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
 
Old 09-22-2005, 02:50 PM   #3
stomach
Member
 
Registered: Sep 2005
Distribution: Debian
Posts: 202

Original Poster
Rep: Reputation: 30
One more time I can count on its aid.

Very thankz Matir!

Last edited by stomach; 09-22-2005 at 02:58 PM.
 
Old 09-22-2005, 03:21 PM   #4
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
No problem. Always glad to be able to help.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables problem , please help John Micheal Linux - Security 4 05-22-2004 04:01 AM
Iptables problem,help me please. ryanux Linux - Security 1 05-21-2004 10:59 PM
iptables problem fleshwound Linux - Networking 6 12-27-2003 06:30 PM
iptables - where is my problem cristi1979 Linux - Networking 9 07-14-2003 03:46 PM
iptables problem? poulaum Linux - Networking 12 02-27-2003 04:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration