Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
slow nat (??)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
zerkms
n00b
n00b


Joined: 21 Aug 2008
Posts: 43
Location: Russia, Komsomolsk-na-Amure

PostPosted: Wed Sep 30, 2009 9:25 am    Post subject: slow nat (??) Reply with quote

Hi guys
I have dsl connection with limit about of 130kb/s

When i connect to dsl using gentoo and download anything with wget i get speed near the limit
When i connect to dsl with desktop windows i get the same results.

But when gentoo is provides internet to windows with nat - windows speed bandwidth (per thread) slows down to 30kb/s (+/5kb/s)

this is simplified iptables config for debug trouble
Code:
#!/bin/sh

# First we flush our current rules
for table in nat mangle filter; do
    iptables -t $table --flush
    iptables -t $table --delete-chain
done

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

# Allow access to all from LAN
iptables -A INPUT -i eth1 -j ACCEPT
iptables -A INPUT -i lo -j ACCEPT

# Allow Related and Established from elsewhere

# The rules for NAT
iptables -A FORWARD -i eth1 -s 192.168.0/24 -j ACCEPT
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

# Tell the kernel that ip forwarding is OK
echo 1 > /proc/sys/net/ipv4/ip_forward
for f in /proc/sys/net/ipv4/conf/*/rp_filter; do echo 1 > $f; done


ps: tested kernels are 2.6.27-r8 and 2.6.30-r6
+ latest stable iptables-1.4.3.2

any ideas? :-(
Back to top
View user's profile Send private message
Anarcho
Advocate
Advocate


Joined: 06 Jun 2004
Posts: 2970
Location: Germany

PostPosted: Wed Sep 30, 2009 12:24 pm    Post subject: Reply with quote

Maybe try suggestions under "Incorrect MTU Value" on http://www.gentoo.org/doc/en/home-router-howto.xml#doc_chap7
_________________
...it's only Rock'n'Roll, but I like it!
Back to top
View user's profile Send private message
zerkms
n00b
n00b


Joined: 21 Aug 2008
Posts: 43
Location: Russia, Komsomolsk-na-Amure

PostPosted: Wed Sep 30, 2009 12:36 pm    Post subject: Reply with quote

nope, that doesn't helps (i got that advice on #gentoo @ freenode) :-(

i've heard that snat/dnat instead of my nat can help. is it true?
Back to top
View user's profile Send private message
think4urs11
Bodhisattva
Bodhisattva


Joined: 25 Jun 2003
Posts: 6659
Location: above the cloud

PostPosted: Wed Sep 30, 2009 10:57 pm    Post subject: Re: slow nat (??) Reply with quote

zerkms wrote:
But when gentoo is provides internet to windows with nat
via X-connect between Gentoo and Windows box?
If yes did you set (on both sides) NIC speed/duplex to auto or fixed values?
_________________
Nothing is secure / Security is always a trade-off with usability / Do not assume anything / Trust no-one, nothing / Paranoia is your friend / Think for yourself
Back to top
View user's profile Send private message
zerkms
n00b
n00b


Joined: 21 Aug 2008
Posts: 43
Location: Russia, Komsomolsk-na-Amure

PostPosted: Wed Sep 30, 2009 11:53 pm    Post subject: Re: slow nat (??) Reply with quote

Think4UrS11 wrote:
zerkms wrote:
But when gentoo is provides internet to windows with nat
via X-connect between Gentoo and Windows box?
If yes did you set (on both sides) NIC speed/duplex to auto or fixed values?


gentoo and windows connected through gigabit switch and samba works fine (20-30mb/s)
Back to top
View user's profile Send private message
plut0
Apprentice
Apprentice


Joined: 21 Dec 2004
Posts: 272

PostPosted: Thu Oct 01, 2009 3:50 am    Post subject: Reply with quote

Is TCP window scaling enabled? If so, try disabling it.

Code:
sysctl net.ipv4.tcp_window_scaling
Back to top
View user's profile Send private message
zerkms
n00b
n00b


Joined: 21 Aug 2008
Posts: 43
Location: Russia, Komsomolsk-na-Amure

PostPosted: Thu Oct 01, 2009 7:24 am    Post subject: Reply with quote

plut0 wrote:
Is TCP window scaling enabled? If so, try disabling it.

Code:
sysctl net.ipv4.tcp_window_scaling


guys, sorry, i just was unlucky when testing nat - all the servers (such as kernel.org and the same) round robins (with dns) gentoo router to fast IP's and windows behind nat to slow one %)

sorry :-)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum