View previous topic :: View next topic |
Author |
Message |
zerkms n00b
Joined: 21 Aug 2008 Posts: 43 Location: Russia, Komsomolsk-na-Amure
|
Posted: Wed Sep 30, 2009 9:25 am Post subject: slow nat (??) |
|
|
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 |
|
|
Anarcho Advocate
Joined: 06 Jun 2004 Posts: 2970 Location: Germany
|
|
Back to top |
|
|
zerkms n00b
Joined: 21 Aug 2008 Posts: 43 Location: Russia, Komsomolsk-na-Amure
|
Posted: Wed Sep 30, 2009 12:36 pm Post subject: |
|
|
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 |
|
|
think4urs11 Bodhisattva
Joined: 25 Jun 2003 Posts: 6659 Location: above the cloud
|
Posted: Wed Sep 30, 2009 10:57 pm Post subject: Re: slow nat (??) |
|
|
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 |
|
|
zerkms n00b
Joined: 21 Aug 2008 Posts: 43 Location: Russia, Komsomolsk-na-Amure
|
Posted: Wed Sep 30, 2009 11:53 pm Post subject: Re: slow nat (??) |
|
|
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 |
|
|
plut0 Apprentice
Joined: 21 Dec 2004 Posts: 272
|
Posted: Thu Oct 01, 2009 3:50 am Post subject: |
|
|
Is TCP window scaling enabled? If so, try disabling it.
Code: | sysctl net.ipv4.tcp_window_scaling |
|
|
Back to top |
|
|
zerkms n00b
Joined: 21 Aug 2008 Posts: 43 Location: Russia, Komsomolsk-na-Amure
|
Posted: Thu Oct 01, 2009 7:24 am Post subject: |
|
|
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 |
|
|
|