# Argh! Dodgy Network Connection...

## minidud23

hi there, all!! up until yesterday I was running Redhat 9 on my laptop, and everything was fine, boot up:ok, browsing:ok, downloading:ok, etc etc.  But I decided to install Gentoo.  Now, my network card (3Com pcmcia) was autodetected and gentoo used dhcp to connect to the router/modem, and I had a net connection without having to do anything!  Cool, I thought.

Well, there is still networking, but something isn't right with it.  I have *NO* idea what's wrong.  But webpages (with mozilla and lynx) wont download about 50% of the time, the browser just sits there, and sometimes, when I try to emerge some software - the emerge process will start to download the file, and then stop after a random amount of time, and it wont continue the download untill I Ctrl+C and start it again myself....even then it sometimes stalls *again*, and I have to kill it.

Does anyone have any ideas whats going wrong?  This is a pretty big pain in the ass for me, as I can't just leave my computer to emerge a lot of software incase the download stalls, and I'd need to kill it again.

Any help would be much appreciated! 

Thanks for reading...

----------

## slartibartfasz

happend to me after the upgrade to the latest gcc/glibc - try to '/etc/init.d/net.eth0 restart' and see it if helps...

----------

## uzik

Is it DNS lookups that are slow?

it might be pointed to a nonexistant DNS server and timing out then falling over to a secondary DNS that is working.

----------

## karl420

I agree. You should inspect /etc/resolv.conf

Karl

----------

## minidud23

well, there doesn't seem to be anything wrong with the dns addresses in resolv.conf...not that i can see anyways.  i can ping the ip's that are in there.

mozilla is also giving me a lot of "Document contains no data" errors, too.  Wow, this is the most annoying thing in the world!  

The addys in resolv.conf are the same ones that my router detects through dhcp...

any other ideas?

cheers.

----------

## think4urs11

Hi!

Most common error is autonegotiation

Have you tried to set your NIC to some fixed values for speed/duplex?

HTH

T.

----------

## ben

Hi,

If it works for some times and then stop and maybe even resume then I qould think it is an interrupts problem, you may want to arange them manually in the BIOS.

Now if some specific web page timeouts then it may be ECN so:

echo "0" > /proc/sys/net/ipv4/tcp_ecn

HTH

Ben

----------

## krusty_ar

I've never experinced that, but lately there has been a bunch of posts about random net card behabiour, some of them where related with APIC and ACPI (IIRC).

I think both can be disabled at boot time with -no-apic and -no-acpi

----------

## ben

It is APIC which poses problem lately, APIC is a programmable interrupts controller

ACPI is the successor of APM and AFAIK is innocent on that matter

HTH

Ben

----------

## minidud23

hi again.

i've looked into the autonegotiotion stuff, and i think i need to set the speed of the card (it's a pcmcia 3com card), to 10Mb (it auto negotioates to 100).

i checked out the mii-tool program, and i've tried this command:

mii-tool -F 10baseT-HD

and 

mii-tool eth0 -F 10baseT-HD

but i get these errors, respectively:

SIOCGMIIPHY on 'eth0' failed: Operation not supported

no MII interfaces found

---

SIOCGMIIPHY on 'eth0' failed: Operation not supported

any ideas how i can set this on my card, or turn off autonegotiation?

cheers

----------

## minidud23

bump!

c'mon guys....say after me..."We can do it"! Yeah!

 :Rolling Eyes: 

----------

## think4urs11

Hi!

Try to turn off ACPI + APM at first. After this use mii to set the speed.

Had the same strange error on a (very old) notebook with PCMCIA NIC. Without ACPI/APM everthings fine and the notebook won't be moved (it's my mailserver right now) so who cares  :Smile: 

I think if this works there are some parameters you can configure with the NIC driver itself to get the values fixed.

HTH

T.

----------

## minidud23

how can i turn off acpi and apm?  i tried taking them out of the kernel, then booted again, but the problem persists.

hmmm...

----------

## think4urs11

seems to be a good hidden error   :Twisted Evil: 

well, lets deal with that one...

ok, it works sometimes, sometimes not... 

please post your 

- /etc/resolv.conf

- /etc/conf.d/net

- /etc/make.conf

(via  sed -e '/^#\|^[\t ]*#\|^$/d' *FILENAME* to get rid of any comments)

output of

- dmesg | grep -i ethernet

- netstat -rn

- lsmod 

- mii-tool -v

- ifconfig

- ping -c1 *YOURNAMESERVER*

same outputs for 'its working' and 'no go'

maybe there are differences we can have a look on

what else can be done?

check the cables, the temperature, the hub/switch/whatever

HTH

T.

----------

## minidud23

ok, well thanks for taking an interest in the problem  :Smile: 

here's the output of all of the commands you asked for...

thanks again!

/etc/resolv.conf

nameserver 194.74.65.69

nameserver 194.72.9.38

/etc/conf.d/net

iface_eth0="192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0"

iface_eth0="dhcp"

/etc/make.conf

USE="X gtk2 gnome dvd gui -xmms -qt -kde -alsa"

CHOST="i686-pc-linux-gnu"

dmesg (grep eth)

eth0: 3Com 3c575 Boomerang CardBus at 0x100, 00:60:08:02:ab:55, irq 9

eth0: Setting full-duplex based on MII #0 link partner capability of 01e1.

netstat -rn

Kernel IP routing table

Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface

192.168.8.0     0.0.0.0         255.255.255.0   U        40 0          0 eth0

127.0.0.0       127.0.0.1       255.0.0.0       UG       40 0          0 lo

0.0.0.0         192.168.8.1     0.0.0.0         UG       40 0          0 eth0

lsmod

Module                  Size  Used by    Not tainted

3c575_cb               21124   2

cb_enabler              2736   2 [3c575_cb]

serial_cs               6864   0 (unused)

ds                      6856   2 [cb_enabler serial_cs]

i82365                 37728   2

pcmcia_core            41984   0 [cb_enabler serial_cs ds i82365]

mii-tool

SIOCGMIIPHY on 'eth0' failed: Operation not supported

no MII interfaces found

ifconfig

eth0      Link encap:Ethernet  HWaddr 00:60:08:02:AB:55

          inet addr:192.168.8.2  Bcast:192.168.8.255  Mask:255.255.255.0

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:46595 errors:1 dropped:0 overruns:1 frame:1

          TX packets:46817 errors:0 dropped:0 overruns:0 carrier:1

          collisions:0 txqueuelen:100

          RX bytes:3662685 (3.4 Mb)  TX bytes:3131125 (2.9 Mb)

          Interrupt:9 Base address:0x100

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

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

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

          collisions:0 txqueuelen:0

          RX bytes:5416 (5.2 Kb)  TX bytes:5416 (5.2 Kb)

ping nameserver

PING 194.74.65.69 (194.74.65.69) 56(84) bytes of data.

64 bytes from 194.74.65.69: icmp_seq=1 ttl=249 time=17.1 ms

64 bytes from 194.74.65.69: icmp_seq=2 ttl=249 time=17.0 ms

64 bytes from 194.74.65.69: icmp_seq=3 ttl=249 time=16.7 ms

64 bytes from 194.74.65.69: icmp_seq=4 ttl=249 time=17.4 ms

--- 194.74.65.69 ping statistics ---

4 packets transmitted, 4 received, 0% packet loss, time 3014ms

rtt min/avg/max/mdev = 16.741/17.096/17.442/0.252 ms

----------

## think4urs11

Ok so begin with the obvious

 *minidud23 wrote:*   

> 
> 
> ...
> 
> /etc/conf.d/net
> ...

 

change this to read as

```

#iface_eth0="192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0"

iface_eth0="dhcp"

```

the first line isn't used anyways as shown in ifconfig (orange) - you got an dhcp address with correct mask and correct gateway

 *minidud23 wrote:*   

> 
> 
> ...
> 
> ifconfig
> ...

 

looking at the packet counters (blue) the card seems to work in some way...

try to boot with kernel parameters (1+3 or 2+3) maybe this does the trick if your kernel has still something in...

1)pci=noacpi

2)acpi=off

3)apm=off

HTH

T.

----------

## minidud23

how can i boot those kernel parameters?  i'm running grub as my boot loader, and it's set up to display a splash, so there is no command line input.

sorry for being a noob  :Smile: 

cheers,

----------

## minidud23

how can i boot those kernel parameters?  i'm running grub as my boot loader, and it's set up to display a splash, so there is no command line input.

sorry for being a noob  :Smile: 

cheers,

----------

## devon

You should be able to hit "e" when in the Grub menu to "e"dit.

----------

