LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-29-2004, 06:06 PM   #1
qwertyman19
LQ Newbie
 
Registered: Oct 2004
Location: LA
Distribution: Red Hat 9
Posts: 6

Rep: Reputation: 0
IP Masquerading w/ iptables unreliable on Red Hat 9 server


I am setting up a server for file sharing and masquerading using Red Hat 9. File sharing with SAMBA always works well. Masquerading starts up ok and works well for some period of time, but then it stops functioning. The server drops all types of masqueraded connections: HTTP, ftp, ping and email. After a few minutes, masquerading starts working normally again.

I have followed the "Linux IP Masquerade HOWTO" and have used the suggested iptables script in the HOWTO. I have also used the more simplified iptables method suggested by Mathieu on his post at: threadid=178329, postid=424274

I have masqueraded with ipchains on my RH 6.2 server for years without a problem, so this problem really has me pulling out my hair.

Any help would be greatly appreciated!
 
Old 10-30-2004, 05:41 AM   #2
maxut
Senior Member
 
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188

Rep: Reputation: 50
i have redhat 8-9, fedora 1-2. i dont have any trouble with them what happens in that period? is there some daemons start or stop at that time? or do u have cron jobs that starts at that time? or someone turns on or off clients ?

if u think the trouble is your iptables script, try followings (it works on my redhat 9 without trouble):
Code:
#flushing chains
iptables -t nat -F PREROUTING
iptables -t nat -F POSTROUTING
iptables -F OUTPUT
iptables -F FORWARD
iptables -F INPUT

#setting default policies
iptables -P FORWARD DROP
iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT
iptables -t nat -P POSTROUTING ACCEPT
iptables -t nat -P PREROUTING ACCEPT

# rules to allow connections
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -i $eth_local -s $local_net -j ACCEPT
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i $eth_local -s $local_net -j ACCEPT
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT

# if u have public dynamic ip use rule 1
# if u have static public ip use rule 2
1- iptables -A POSTROUTING -o $eth_ex -s $local_net -j MAQUERADE
2- iptables -A POSTROUTING -o $eth_ex -s $local_net -j SNAT --to $static_public_ip
good luck.
 
Old 11-01-2004, 10:37 AM   #3
qwertyman19
LQ Newbie
 
Registered: Oct 2004
Location: LA
Distribution: Red Hat 9
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks for the suggestion - I'll try your script.

I don't have any daemons starting/stopping or cron jobs scheduled afaik, so I don't think that is the problem. There are two clients on the network, a W2K machine and a WinXP machine. Masquerading starts to get flaky when the WinXP client is on the network. I've been researching WinXP to see if it could be the culprit. One thing that is unique to the WinXP client is that it sends out WebDAV packets. I've got no idea if WebDAV has anything to do with my problem or not.
 
Old 11-01-2004, 11:23 AM   #4
maxut
Senior Member
 
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188

Rep: Reputation: 50
maybe a virus cause this. did u do virus checking on windows boxes?
 
  


Reply



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
Upgrading Red Hat 9 to Red Hat Enterprise Server 3 AS louisb Linux - Software 7 02-23-2004 10:25 PM
masquerading problem in Red Hat 8.0 gregmcavoy Linux - Networking 39 05-29-2003 02:16 AM
red hat 7.1 iptables error aviad Linux - Networking 1 05-27-2003 08:08 AM
IP Masquerading on Red Hat 7.3 Problems Joe Kerrigan Linux - Networking 4 08-04-2002 09:19 AM
IP masquerading and firewall with Red Hat 7.2 ck571 Linux - Newbie 5 03-21-2002 01:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:54 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