# Slow net connection

## decrease789

Ok... I am going to go INSaNe!! I am kinda new to linux and to gentoo..... I have been trying to get my gentoo installation working with my new internet connection for ages... here's how the story goes

1. Installed gentoo

2. Everything OK, Internet working fine ADSL (tiscali) behind router (10.0.0.xxx network)

3. Moved house. New Internet connection... no router.. and the connection did not work with linux straight off... weird goings on... had internet for brief connections when i had been fiddling with /etc/conf.d/net and renewing the dhcp with dhcpcd.... Had no luck

4. Got a router (192.168.1.xxx networ.). Still no connection. Fiddle with it for ages and found that  the lisa process was interfering with the connection.

5. Connected!!!!!

6. Then I realise my bandwidth is poor...... very poor.... if I start downloading i ll get about 12 kbps to start with and then it will fall until it stalls. I usually get a steady downstream of about 75 kbps on winblows. Any ideas????

this is my current /etc/conf.d/net

```

# /etc/conf.d/net:

# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/conf.d/net,v 1.7 2002/11/18 19:39:22 azarah Exp $

# Global config file for net.* rc-scripts

#original iface settings for previous connection

#iface_eth0="10.0.0.14 broadcast 10.0.0.255 netmask 255.0.0.0"

#iface_eth1="207.170.82.202 broadcast 207.0.255.255 netmask 255.255.0.0"

iface_eth0="192.168.1.100 broadcast 192.168.1.255 netmask 255.255.255.0"

# it seems to work static or dhcp..... but either way still a slow connection

# For DHCP set iface_eth? to "dhcp"

# For passing options to dhcpcd use dhcpcd_eth?

#

#iface_eth0="dhcp"

# For setting the default gateway

#

gateway="eth0/192.168.1.1"

```

im finding it difficult to find out how specify my own dns servers when i have dhcp on how do i do this... if i edit /etc/resolv.conf it just changes back when i have dhcp on

this is my ifconfig output.... dont think this is much use but, hey, you guys may spot something dumb i have done

```

eth0      Link encap:Ethernet  HWaddr 00:10:4B:69:4E:C1

          inet addr:192.168.1.100  Bcast:192.168.1.255  Mask:255.255.255.0

          inet6 addr: fe80::210:4bff:fe69:4ec1/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:2191 errors:0 dropped:0 overruns:0 frame:0

          TX packets:2715 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:1033773 (1009.5 Kb)  TX bytes:308562 (301.3 Kb)

          Interrupt:10 Base address:0xde00

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:8 errors:0 dropped:0 overruns:0 frame:0

          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:400 (400.0 b)  TX bytes:400 (400.0 b)

```

sorry for the big post please help me.... i feel lost!  :Sad: Last edited by decrease789 on Tue Aug 10, 2004 11:04 pm; edited 2 times in total

----------

## Frodg

Some of the later 2.6 kernels have this slow down issue....

Mine was fixed with runing these commands:

```

# sysctl -w net.ipv4.tcp_moderate_rcvbuf=0 

# sysctl -w net.ipv4.tcp_default_win_scale=0 

```

Got back the speed except for the connection to some odd sites....

----------

## decrease789

```

root@jimbox / # sysctl -w net.ipv4.tcp_moderate_rcvbuf=0

error: 'net.ipv4.tcp_moderate_rcvbuf' is an unknown key

root@jimbox / # sysctl -w net.ipv4.tcp_default_win_scale=0

error: 'net.ipv4.tcp_default_win_scale' is an unknown key

```

no luck mate! any idea why that didnt work?

anyway i have a 2.4 kernel... thanks anyway....

----------

## Frodg

Sorry - can't help then - good luck

----------

## floam

You may want to upgrade to 2.6. It's faster in many respects.

----------

## pjp

Moved from Documentation, Tips & Tricks.

----------

## gnuageux

Youve checked to ensure that youre not running into a duplex mismatch or something?

----------

## Frodg

So how do you check for that? and then fix it?

I don't have the problem with the currnet kernel but if I use the older 2.6.8 kernels I still have installed I do have the problem....

----------

## decrease789

this connection is worse than dialup......

the connection is totally fine in windows with downloads of 75 kbps... compared to a 825 B/s - 1.5 kbps in gentoo!

no i have not checked to see if it is a duplex mismatch,  how can I check if this is the problem and fix it....

----------

## gnuageux

Heres a script to check to see if that is ineed the case:

[url] http://blue.netnation.com/sim/projects/duplextest/  [/url]

A general rule of thumb is that if your connected to a hub, then you should be set to half duplex, switches full.

----------

## gnuageux

You can change your duplex settings using ethtool. 

```
grady@MindStab ~$  emerge -s ethtool

Searching...   

[ Results for search key : ethtool ]

[ Applications found : 1 ]

 

*  sys-apps/ethtool

      Latest version available: 1.7

      Latest version installed: [ Not Installed ]

      Size of downloaded files: 70 kB

      Homepage:    http://sourceforge.net/projects/gkernel/

      Description: Utility for examining and tuning your ethernet-based network interface

      License:     GPL-2

```

The actual cmds would be:  (I think)

ethtool -s eth1 autoneg off

ethtool -s eth1 speed 100

Try this out, well see if that resolves. If not well go from there. But duplex mismatches results in discards / packet collisions / errors which can effectively render your connection useless.

----------

## decrease789

ok this is what i got....

192.168.1.1 is my dhcp server address (router's address) and

192.168.1.100 is the address of my box

what can i do now to fix the problem?

```

# ./duplextest -v 192.168.1.1

192.168.1.1     !!!!!!!!!!!!!!!.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Good.

# ./duplextest -v 192.168.1.1/255.255.255.0

Sweeping from "192.168.1.1" to "192.168.1.1"...

192.168.1.1     !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!..!!!!!!!!!!!!!!!.!!!.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.Problem! (5 dropped in 111 received)

# ./duplextest -v 192.168.1.1/255.255.255.0

Sweeping from "192.168.1.1" to "192.168.1.1"...

192.168.1.1     !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.!!!.Problem! (5 dropped in 291 received)

# ./duplextest -v 192.168.1.0/255.255.255.0

Sweeping from "192.168.1.0" to "192.168.1.1"...

192.168.1.0     Broadcast.

192.168.1.1     !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.!!!!!!!!!!!.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.!!!!!!!!!!!!!!!.Problem! (5 dropped in 287 received)

# ./duplextest -v 192.168.1.100/255.255.255.0

Sweeping from "192.168.1.100" to "192.168.1.101"...

192.168.1.100   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Good.

192.168.1.101   .................Unreachable.
```

----------

## gnuageux

emerge ethtool then 

ethtool -s eth1 autoneg off 

ethtool -s eth1 speed 100

I think that should resolve.

----------

## decrease789

ok this could be whats going wrong? ..... I tried to change the settings logged in as root.....

```

# ethtool -s eth0 autoneg off

Cannot get current device settings: Operation not supported

  not setting autoneg

# ethtool -s eth0 speed 100

Cannot get current device settings: Operation not supported

  not setting speed

# ethtool -s eth1 speed 100

Cannot get current device settings: No such device

  not setting speed

# ethtool -s eth0 speed 100

Cannot get current device settings: Operation not supported

  not setting speed

# ethtool -s eth0 duplex full

Cannot get current device settings: Operation not supported

  not setting duplex

# ethtool -s eth0 duplex half

Cannot get current device settings: Operation not supported

  not setting duplex

```

----------

## gnuageux

Odd?!?!?! Did you stop net.eth0 before you tried making those changes? I wonder if you have to specify net.ethX rather than just eth0

----------

## decrease789

no i did not stop net.eth0

but heres what happened when i did....

```
# /etc/init.d/net.eth0 stop

 * Unmounting network filesystems...                                               [ ok ]

 * Stopping samba...                                                               [ ok ]

 * Bringing eth0 down...                                                           [ ok ]

# ethtool -s eth0 autoneg off

Cannot get current device settings: Operation not supported

  not setting autoneg

# ethtool -s eth0 speed 100

Cannot get current device settings: Operation not supported

  not setting speed

```

----------

## gnuageux

Did you try ethtool -s net.eth0  autoneg off  ? I cant imagine thatt'd be it, but. . .

----------

## decrease789

heres what happened when i specified ethX

```
# ethtool -s ethX autoneg off

Cannot get current device settings: No such device

  not setting autoneg

# /etc/init.d/net.eth0 stop

 * Bringing eth0 down...                                                           [ ok ]

# ethtool -s ethX autoneg off

Cannot get current device settings: No such device

  not setting autoneg

```

----------

## gnuageux

Are you loading your nic card as a driver module? If so you can probably just edit /etc/modules.conf. 

Im sure that youd see a line that references your network interface. 

An example may be:

options driver/modulename auto_speed=0 line_speed=100 full_duplex=1

Change the auto speed to 0 so that it doesnt auto negotiate, then set the line speed to 100 & full duplex 1 for true.

----------

## gnuageux

Try:

```
ethtool -s net.eth0 autoneg off[quote] Or the module configuration above.[/quote]
```

----------

## gnuageux

You may find some good info here as well: 

http://www.google.com/linux?hl=en&lr=&ie=UTF-8&q=how+to+change+duplex+settings+eth0&btnG=Google+Search

----------

## decrease789

heres what happened when i specified ethX

```
# ethtool -s ethX autoneg off

Cannot get current device settings: No such device

  not setting autoneg

# /etc/init.d/net.eth0 stop

 * Bringing eth0 down...                                                           [ ok ]

# ethtool -s ethX autoneg off

Cannot get current device settings: No such device

  not setting autoneg
```

----------

## decrease789

```
# ethtool -s net.eth0 autoneg off

net.eth0 does not appear to be an ethernet device
```

----------

## gnuageux

Sorry I meant ethX as is X substitues whatever number int, be it 0 1 etc etc. But urs is 0. Did you try the module config?

----------

## decrease789

** edited **Last edited by decrease789 on Sat Aug 14, 2004 1:51 pm; edited 1 time in total

----------

## decrease789

not quite sure how to tell if i am loading with a module.....

eres my modules.conf should i just add that line and see if it works?

see above

----------

## decrease789

not quite sure how to tell if i am loading with a module.....

heres my modules.conf should i just add that line and see if it works?

```
### This file is automatically generated by modules-update

#

# Please do not edit this file directly. If you want to change or add

# anything please take a look at the files in /etc/modules.d and read

# the manpage for modules-update.

#

### modules-update: start processing /etc/modules.d/aliases

# Aliases to tell insmod/modprobe which modules to use 

# Uncomment the network protocols you don't want loaded:

# alias net-pf-1 off      # Unix

# alias net-pf-2 off      # IPv4

# alias net-pf-3 off      # Amateur Radio AX.25

# alias net-pf-4 off      # IPX

# alias net-pf-5 off      # DDP / appletalk

# alias net-pf-6 off      # Amateur Radio NET/ROM

# alias net-pf-9 off      # X.25

# alias net-pf-10 off      # IPv6

# alias net-pf-11 off      # ROSE / Amateur Radio X.25 PLP

# alias net-pf-19 off      # Acorn Econet

alias char-major-10-175   agpgart

alias char-major-10-200   tun

alias char-major-81   bttv

alias char-major-108   ppp_generic

alias /dev/ppp      ppp_generic

alias tty-ldisc-3   ppp_async

alias tty-ldisc-14   ppp_synctty

alias ppp-compress-21   bsd_comp

alias ppp-compress-24   ppp_deflate

alias ppp-compress-26   ppp_deflate

# Crypto modules (see http://www.kerneli.org/)

alias loop-xfer-gen-0   loop_gen

alias loop-xfer-3   loop_fish2

alias loop-xfer-gen-10   loop_gen

alias cipher-2      des

alias cipher-3      fish2

alias cipher-4      blowfish

alias cipher-6      idea

alias cipher-7      serp6f

alias cipher-8      mars6

alias cipher-11      rc62

alias cipher-15      dfc2

alias cipher-16      rijndael

alias cipher-17      rc5

# Support for i2c and lm_sensors

alias char-major-89    i2c-dev

# Old nvidia support ...

alias char-major-195 NVdriver 

alias /dev/nvidiactl char-major-195 

### modules-update: end processing /etc/modules.d/aliases

### modules-update: start processing /etc/modules.d/alsa

# Alsa 0.9.X kernel modules' configuration file.

# $Header: /home/cvsroot/gentoo-x86/media-sound/alsa-utils/files/alsa-modules.conf-rc,v 1.1 2003/08/05 21:07:55 johnm Exp $

# ALSA portion

alias char-major-116 snd

# OSS/Free portion

alias char-major-14 soundcore

##

## IMPORTANT:

## You need to customise this section for your specific sound card(s)

## and then run `update-modules' command.

## Read alsa-driver's INSTALL file in /usr/share/doc for more info.

##

##  ALSA portion

##alias snd-card-0 snd-als4000

## alias snd-card-0 snd-interwave

alias snd-card-0 snd-ens1371

##  OSS/Free portion

## alias sound-slot-0 snd-card-0

## alias sound-slot-1 snd-card-1

##

# OSS/Free portion - card #1

alias sound-service-0-0 snd-mixer-oss

alias sound-service-0-1 snd-seq-oss

alias sound-service-0-3 snd-pcm-oss

alias sound-service-0-8 snd-seq-oss

alias sound-service-0-12 snd-pcm-oss

##  OSS/Free portion - card #2

## alias sound-service-1-0 snd-mixer-oss

## alias sound-service-1-3 snd-pcm-oss

## alias sound-service-1-12 snd-pcm-oss

alias /dev/mixer snd-mixer-oss

alias /dev/dsp snd-pcm-oss

alias /dev/midi snd-seq-oss

# Set this to the correct number of cards.

options snd cards_limit=1

### modules-update: end processing /etc/modules.d/alsa

### modules-update: start processing /etc/modules.d/i386

alias parport_lowlevel parport_pc

alias char-major-10-144 nvram

alias binfmt-0064 binfmt_aout

alias char-major-10-135 rtc

### modules-update: end processing /etc/modules.d/i386

### modules-update: start processing /etc/modules.d/nvidia

# Nvidia drivers support

alias char-major-195 nvidia

alias /dev/nvidiactl char-major-195

# To tweak the driver the following options can be used, note that

# you should be careful, as it could cause instability!!

#

#   To enable Side Band Adressing:  NVreg_EnableAGPSBA=1

#

#   To enable Fast Writes: NVreg_EnableAGPFW=1

#

# To enable both for instance, uncomment following line:

#

#options nvidia NVreg_EnableAGPSBA=1 NVreg_EnableAGPFW=1

### modules-update: end processing /etc/modules.d/nvidia

### modules-update: start processing /etc/modules.d/svgalib

probeall  /dev/svga  svgalib_helper

### modules-update: end processing /etc/modules.d/svgalib
```

----------

## decrease789

ok what how do i find out what module name and drive that i need to put into this line....

options driver/modulename auto_speed=0 line_speed=100 full_duplex=1

----------

## decrease789

ok i think i found the solution on a different forum

 *Quote:*   

> i thought i would update as to what i had to do to get this going.
> 
>  after perusing through this forum i found a command that 
> 
>  i needed all along to make the changes....rmmod.
> ...

 

how can i do this in gentoo?

can you pass mode=0 to modprobe?

how do i pass the parameter on to dmfe module at bootup for gentoo?[/url]

----------

## decrease789

** edited **Last edited by decrease789 on Sat Aug 14, 2004 1:53 pm; edited 1 time in total

----------

## devon

 *decrease789 wrote:*   

> how do i pass the parameter on to dmfe module at bootup for gentoo?

 

One way off the top of my head is to add the command to /etc/conf.d/local.start.

----------

## gnuageux

Good suggestion devon. decrease789 did that work?

----------

## decrease789

how do i add this command to /etc/conf.d/local.start...

would it just be

```
dmfe mode=0

```

would i have to remove the dmfe module before i do this?

----------

## decrease789

how do i add this command to /etc/conf.d/local.start...

would it just be

```
dmfe mode=0

```

----------

## decrease789

the dmfe module is not installed.....

i dont have the network card for the dmfe module (davicom) i just looked at info center which says I have a .....

3COM Corporation 3c905B 100BaseTX [Cyclone]

i think i need to recompile my kernel to support a module for my specific network card.... im not sure does this seem likely?

could you tell me how to recompile my kernel with support with this network card

----------

## decrease789

im going to try to recompile the kernel myself i found a module i can compile.....

----------

## decrease789

well i recompiled the kernel.... I think I maybe on the right track (althought i could be completely wrong)....... now that I have recompiled the kernel... should linux use the driver for my network card by default or do I have to do something else?

----------

## decrease789

i just found this in /usr/src/linux/Documentation/networking/vortex.txt

 *Quote:*   

> 
> 
> The 3com cards appear to only respond to PAUSE frames which are
> 
>   sent to the reserved destination address of 01:80:c2:00:00:01.  They
> ...

 

this may be related to the error I got before......

----------

## decrease789

i found another post i think this is the solution.... what you think????

 *Quote:*   

> Maybe I should have stepped in sooner; I thought someone would bring it up. 
> 
>  This has been a continuing issue for any kernel more modified than vanilla-sources-2.4.20. There seem to be two fixes for this: 
> 
>  1. You have APIC compiled into your kernel. Turn it off by either recompiling a kernel without APIC support or adding "noapic" to your kernel arguments. 
> ...

 

----------

## R@NNIS

i'm quite sure this is a DNS problem.

when it's badly configured you just get this situation, ultra poor bw, the packets gets lost anywhere...

=> /etc/resolv.conf 

be sure it is correctly configured.

I hope it will help.

----------

## decrease789

i dont think this is the problem

i have tried

```

domain nicolson.biz

nameserver 192.168.1.1

```

and

```

domain nicolson.biz

nameserver 195.112.4.4

```

and the problem still occurs

----------

## decrease789

i have a new router and now there is no problem  :Very Happy: 

----------

