# have to net.eth0 restart alot

## robodeath

Network setup:

Cable modem comes into gentoo box in eth0.  Cable comes out of gentoo box at eth1 and into a hub.  Two other computer connect to this hub.  

Problem:

About once a day the two other computers will lose internet connectivity.  When they do, I ssh into the gentoo box from one of the other two computers and try to ping www.google.com and it fails unknown host.  I run ifconfig and see both adapters configured correctly.  

Temporary fix:

I issue /etc/init.d/net.eth0 stop   and    /etc/init.d/net.eth0 start.  When the adapter comes back up, internet is restored to all computers instantly.

Any suggestions/log files you need?  It's been happening for the past few months.

----------

## dpshak

It seems to me that in comparing your setup to my setup, your gentoo box is the equivalent of my router.  My router takes care of connecting to the internet as well as providing address leasing to the rest of the computers on the local network.  In the router setup there is a section for setting the lease time for each client, to a maximum of 24 hours - at which time the lease is automatically renewed.  What I'm thinking, based on: *Quote:*   

>  About once a day the two other computers will lose internet connectivity

  is that eth0 is losing its address lease from your service provider.  Part of restarting the net.eth0 service is running your dhcp client which, of course, renews the address lease for eth0.  

This idea may be way out in left field somewhere, and even if it is correct, that pretty much exhausts my limited knowledge of networking - so I have no idea how to actually solve the problem.  :Embarassed: 

----------

## mudrii

do you have dhcp client instelled ? like dhcpcd, udhcpc and pump

Check the kernel and router configuration.

cat you post your /etc/conf.d/net

----------

## robodeath

I have dhcpd installed.  I don't have a router per say, the gentoo box acts as my router.  And the weird thing is that it's worked flawlessly for about 6 years.  I have made no config changes, in fact I hadn't even ssh'd into in about a year when it started happening.  I'm thinking it's either some weird config problem that came out of no where that i'll never be able to trace down or it could be my cable modem going out.  Either way, to test, I think I see a format in my near future.  

cat /etc/conf.d/net

config_eth1=( "192.168.1.1 broadcast 192.168.1.255 netmask 255.255.255.0" )

----------

## desultory

 *robodeath wrote:*   

> I'm thinking it's either some weird config problem that came out of no where that i'll never be able to trace down or it could be my cable modem going out.

 Considering how the problem appeared after multiple years without configuration changes in the system, unless the service provider changed their configuration, the latter is significantly more likely.

 *robodeath wrote:*   

> Either way, to test, I think I see a format in my near future.

 Before doing that, try keeping the modem cooler either by moving it or by positioning a fan to cool it actively.

----------

## robodeath

I moved the modem, ran the cables away from all other cables and put a fan on it.  I had a continuous ping going.  I saw the ping stop today, and instead of bringing eth0 down and back up, I waited.  One minute later the ping continued.  So it's like a temporary service interruption that just picks back up after waiting for about a minute.  I think my next step is a new modem.  Since I rent my modem from my ISP I can get it changed out for free.

----------

## defenderBG

next time when it happens, can u capture more info,

like for example if ur interface gets down?

(ifconfig -a)

try looking in dmesg for more info on the problem

post /etc/resolv.conf as well (and if there are other /etc/resolv.conf.<something>)

try pinging 64.233.167.99 (google.com) to check if the resolv is at fault.

if ur modem is at fault, than u will get ur interface administrativly shut down

----------

## robodeath

I got a new cable modem, still happens.

Also I have more to add.  When it goes down, I have to do one of three things.

Sometimes within 2 minutes it just comes back up and starts working again.

If that doesn't happen I restart net.eth0.

During the net.eth0 restart sometimes I get some messages like "ignoring packet (some long number) doesn't belong to us".

If I get that, I have to power cycle the modem.

I've ran a continuous ping to google.com.  When it goes down I don't get any errors, it just stops pinging for about 2 minutes and then picks back up again, skipping about 20 sequence numbers.  I've checked ifconfig when it goes down and eth0 is still there with the correct ip.

I think it could be my nic, but not having another nic i'm gonna borrow a linksys router and see what happens.  If it still goes down i'll check my cables and try other wall outlets.  If it doesn't go down I guess i'll splurge ($15) on a new nic.

----------

## tarpman

I lose internet service at home most days too, for up to 5 minutes at a time - mostly in the evening, around 10 PM; I consider it a lucky day if I go the whole evening without losing connectivity once or twice.  I've changed the router, the cable modem, all cables, and several NICs, to no avail.  I've decided to blame the ISP (Shaw) and put up with it.

----------

## robodeath

Anyone have any suggestions for a way I can tell when it goes down?  If I run a continuous ping it doesn't kill the ping, just jumps ahead a little.  Like if I had a script that checked the connection every few minutes and reported when it was down.

----------

## robodeath

I think I have it narrowed down to my cable outlet.  I've completely taken my gentoo box out of the scenario and gotten a new modem.  Now it's a netgear router and my two windows computer and it still happens.  I'm going to try a different wall outlet.

----------

## desultory

 *robodeath wrote:*   

> Anyone have any suggestions for a way I can tell when it goes down?  If I run a continuous ping it doesn't kill the ping, just jumps ahead a little.

 Have you tried the -w $deadline option for ping? Does that produce an error (as it should) if the host is not reachable during the specified time frame?

----------

## schally

My suggestion is that your isp disconnects after several hours,... same here with Telekom in Austria,... but with your netgear router you should be able to redial in a short time after that happens,... but that's only suggestions too,...

----------

