LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 04-04-2011, 12:19 PM   #1
DfReisan
LQ Newbie
 
Registered: Apr 2011
Posts: 2

Rep: Reputation: 0
TCP packets seem to be dropped on Debian Squeeze w/NAT


Hi,
I'm running a Debian Squeeze 6.0.1a box that's connected to my ISP via an L2TP connection that's managed by OpenL2TPD.
The box is configured to perform NAT from local clients (on eth0) to the internet (on ppp0).

However, I'm having an issue with TCP packets that are sent from the box itself to the internet (packets originally coming from the local clients get sent and received over the internet just fine)


I'm using this Python app to test this:
Code:
#!/usr/bin/env python

import socket, time

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(('', 5003))
s.listen(1)

while 1:
		conn, addr = s.accept()
		print 'Connection accepted, ', addr

		time.sleep(3)
		print "Sending data"
		conn.send("1")
		print "Sent 1"
		conn.send("2"*1024)
		print "Sent 2"
		conn.send("3"*2048)
		print "Sent 3"
		
		print "Done sending data"
		conn.close()
If the application is ran on a local machine, the client that connects to it receives the entirety of the data,
Though if it's ran on the Debian box, the client that connects to it only receives the first packet ("1").

How can I solve this?
Thanks in advance.

P.S.
These are my iptables rules:
Code:
# iptables -t nat --list
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination
MASQUERADE  all  --  anywhere             anywhere

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

# iptables --list
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
(I also add a rule to forward the connection from the Debian box to the local machine when I test this with the app there)
 
Old 04-13-2011, 02:27 AM   #2
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Hello and Welcome to LinuxQuestions,

You've marked your thread as solved. Would you mind sharing with us what the answer to your question was or how you fixed it so that others in a similar situation can see if it works for them too? Thanks in advance. Have fun with Linux. Off the Zero Reply List.

Kind regards,

Eric
 
Old 04-14-2011, 05:36 AM   #3
DfReisan
LQ Newbie
 
Registered: Apr 2011
Posts: 2

Original Poster
Rep: Reputation: 0
Alright. I solved it by changing the MTU of the ppp0 interface to a lower value (1400 seemed to work fine)
 
Old 04-14-2011, 05:40 AM   #4
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Hi,

Thanks for sharing, I'm sure it'll be of use. Enjoy Linux.

Kind regards,

Eric
 
  


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
Dropped Packets, but Only for TCP Connections? forbin Linux - Networking 5 10-07-2010 08:29 AM
Dropped packets Doolspin Linux - Software 1 10-22-2006 01:22 PM
Accessing TCP flags in TCP packets on Linux using C !! vishamr2000 Programming 2 10-16-2006 09:46 AM
Dropped/hung TCP sessions on both NIC's, Compaq server with Debian doctorcisco Linux - Networking 1 01-16-2006 08:16 AM
too much dropped packets...Hi.. alaios Linux - Networking 2 02-10-2005 04:49 AM


All times are GMT -5. The time now is 07:08 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration