LinuxQuestions.org
Help answer threads with 0 replies.
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-15-2005, 10:29 AM   #1
stomach
Member
 
Registered: Sep 2005
Distribution: Debian
Posts: 202

Rep: Reputation: 30
problem iptables


I have a net, with following ips: 192.168.254.1 up to 192.168.254.12
Code:
#!/bin/bash 
IF_EXTERNA="eth0"; 
IF_INTERNA="eth1"; 

REDE_INTERNA="192.168.254.0/24" 

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

echo 1 > /proc/sys/net/ipv4/ip_forward 
echo 1 > /proc/sys/net/ipv4/ip_dynaddr 

iptables -P FORWARD DROP 
iptables -P INPUT DROP 
iptables -P OUTPUT ACCEPT 

iptables -t mangle -A OUTPUT -o $IF_EXTERNA -p tcp -m multiport --dports 22,8080 -j TOS --set-tos 0x10 

iptables -A INPUT -i lo -j ACCEPT 
iptables -A INPUT -i $IF_INTERNA -j ACCEPT 
iptables -A FORWARD -i $IF_INTERNA -j ACCEPT 

iptables -A INPUT -i $IF_EXTERNA -p tcp --dport 777 -j ACCEPT 

iptables -t nat -A PREROUTING -i $IF_INTERNA -p tcp --dport 80 -j REDIRECT --to-port 3128 
iptables -t nat -A PREROUTING -i $IF_EXTERNA -p tcp --dport 8080 -j REDIRECT --to-port 80 
iptables -t nat -A POSTROUTING -s $REDE_INTERNA -j MASQUERADE
It does not function, door 8080 does not redirect.
 
Old 09-15-2005, 11:48 AM   #2
stomach
Member
 
Registered: Sep 2005
Distribution: Debian
Posts: 202

Original Poster
Rep: Reputation: 30
help please
 
Old 05-07-2007, 04:47 AM   #3
maxut
Senior Member
 
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188

Rep: Reputation: 50
Quote:
Originally Posted by stomach
help please
hmm
can u please try to add following rules
iptables -I INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -I FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -P OUTPUT ACCEPT

good luck
 
  


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 05:30 AM.

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