Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 10-04-2002, 12:04 PM   #1
Registered: Oct 2002
Location: PEI
Distribution: Slackware
Posts: 56

Rep: Reputation: 15
Problem with IPTABLES

New to the forum, just wanted to say hey! Look forward to the wealth of information here .

I am running the latest slackware. I have two network cards setup in my linux computer. The first network card is picking up an IP via DHCP from my DSL the second acts as a gateway.

I am getting internet access on my linux computer and my client. The problem is that i'll be using the internet on my client and everything is fine.. but if I leave it idle for over a minute or so then when I come back and try to do something it never goes right away.. if I try a couple more times eventually it will start working again.

I'm thinking that there must be something set as a timeout.. but I have no idea. I am new to this whole thing

I have the following in my rc.local file to make it all work:

ifconfig eth1 netmask broadcast

iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delte-chain
iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
iptables --append FORWARD --in-interface eth1 -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward

Can anyone please help me out? It starts to get annoying when you can't leave your client machine for 1 minute and come back with a working internet connection
Old 11-04-2002, 05:43 AM   #2
Registered: Sep 2002
Location: IN, USA
Distribution: Debian, Endian FW
Posts: 368

Rep: Reputation: 30
My home router-machine uses dial up, but the same basic idea applies. So here is the script I run, maybe it will help?

/sbin/modprobe ipt_MASQUERADE
/usr/sbin/iptables -F; /usr/sbin/iptables -t nat -F; /usr/sbin/iptables -t mangle -F
/usr/sbin/iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
/usr/sbin/iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
/usr/sbin/iptables -A INPUT -m state --state NEW -i ! ppp0 -j ACCEPT
/usr/sbin/iptables -P INPUT DROP
/usr/sbin/iptables -A FORWARD -i ppp0 -o ppp0 -j REJECT
Old 11-04-2002, 02:35 PM   #3
Senior Member
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
Try to do a direct connection to an ip number from the client and see if it is different from a named (www.x.x.x) address connection.

Also, echo 1 > /proc/sys/net/ipv4/ip_dynaddr

Old 11-04-2002, 03:10 PM   #4
Senior Member
Registered: Jan 2002
Location: Rome, Italy ; Novi Sad, Srbija; Brisbane, Australia
Distribution: Ubuntu / ITOS2008
Posts: 1,207

Rep: Reputation: 46
Im not sure, put maybe if you make a simple script that will ping some adress, like google, or yahoo, from the client every minute or so, it might keep your conection alive.


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
problem iptables stomach Linux - Software 3 09-22-2005 02:21 PM
problem with iptables Israfel2000 Linux - Security 3 07-18-2004 12:30 AM
problem with iptables bladrag Linux - Networking 2 03-24-2004 03:08 PM
iptables problem bhagat_panwar Linux - Software 0 08-27-2003 06:45 AM
iptables problem? poulaum Linux - Networking 12 02-27-2003 03:57 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:19 AM.

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