# Connections to server fails after # minutes

## Matti Kuokkanen

I have strange problem with Apache HTTP daemon. It should be working, but after some time no computer can get on it. Same deal with SSH. Just moment ago I plugged monitor to server, logged in, typed its IP-address to Links and it showed up without problem. I restarted whole computer, activated SSH and HTTP daemons, and connections worked well... for hour or so. What's the glitch here and how to fix it?

Server machine is old junk (K6-2 processor) and Internet connection is straight ADSL (no PPPoE) with DHCP. All Internet connections from server machine itself seems to work just fine at all times.

----------

## snIP3r

hi!

are there any messages in any log files that could give more information? dmesg or /var/log/messages or the apache log files?

i assume with "straight adsl" you mean that the gentoo box is connected to a router and the router connects to the internet?

so you have activated port forwarding? perhaps something is missing there?

HTH

snIP3r

----------

## Matti Kuokkanen

 *snIP3r wrote:*   

> i assume with "straight adsl" you mean that the gentoo box is connected to a router and the router connects to the internet?

 

Not quite. I'll give you as accurate description of my network as I can:

PC with Windows XP (I'm typing this with it)

Server (with Gentoo & co. on it)

External ADSL modem (TeleWell TW-EA701)

Everything connects to switch.

As for Internet connection, for Windows it works just by plugging cables in and turning DHCP on. Gentoo runs DHCP search when it is started and everything checks out automatically. There is no PPPoE kind of authentication dialog like with some other ISPs.

 *Quote:*   

> so you have activated port forwarding? perhaps something is missing there?

 

I just started it with command apache2ctl start and that's it (instructions say apachectl and it don't work - b00!). I didn't do any configurations, and I don't understand what port forwarding means (I might have read about it, and forgot).

Anyways problem happens with SSH too: PuTTY and WinSCP can't get through to server after certain amount of time. Yesterday I made test: I rebooted server, started daemons and immediately connected with PuTTY. I let it be hour or so, and connection didn't break up by itself. As long as PuTTY was running, all other programs (WinSCP and Internet Explorer) did get to server. Server seems to be like an open door: if PuTTY don't keep it open, something closes the door (screensaver or wind or... dunno) and locks it.

----------

## snIP3r

hi!

this is just a thought but it might be worth checking it:

if this is your modem: http://www.abusar.org/manuais/Leon_EA701.pdf then its a router and it might have its own dhcp server built in. so if you first get your ip from the gentoo box right after the pluggin in the cable, the later refresh of the ip address might assign an ip given by the router and so your gentoo box will not be available anymore. you can check this by watching your ip address on the xp client. if you cannot reach your gentoo box, check you ip config for change of the ip address...

another hint is for your apache: you have some start/stop scripts in your /etc/init.d directory and you can start apache with the 

```

/etc/init.d/apache2 start

```

command.

----------

## bunder

does your modem have an IP limit, you might have to check with your isp to see how many connections it and the CMTS will allow.

----------

## Matti Kuokkanen

 *snIP3r wrote:*   

> if this is your modem: http://www.abusar.org/manuais/Leon_EA701.pdf then its a router and it might have its own dhcp server built in.

 

That file don't have photos of the device (modem, router, what ever), but info checks out. Manual, that came with the device, is translated to finnish and has some modifications that include information about ISP. According manual, device is set to RFC 1483 Bridge mode, that is required by ISP.

As for terminology, in finnish language ADSL modem is preferred term over router and bridge. Dunno what's the correct term, but in addition of finnish terminology, cardboard box itself has External ADSL modem printed on it.

 *Quote:*   

> so if you first get your ip from the gentoo box right after the pluggin in the cable

 

Hell no! IP address (dynamic) comes from ISP for both computers.

 *Quote:*   

> you can check this by watching your ip address on the xp client. if you cannot reach your gentoo box, check you ip config for change of the ip address...

 

I haven't stared at IP address of this Windows machine, but on Gentoo's end it has stayed same past two weeks. There don't seem to be change for IP address when machine stays connected to Internet. Also reboots don't change IP address. However, longer periods of time off-line (days-weeks) have changed IP address.

Even IF Windows' machine IP changes, shouldn't server be accessible anyway? I want it to be accessible over Internet regardless client's IP address. Otherwise not much use to make WWW homepage for it, right?

 *Quote:*   

> another hint is for your apache: you have some start/stop scripts in your /etc/init.d directory and you can start apache with the 
> 
> ```
> 
> /etc/init.d/apache2 start
> ...

 

Something wrong with apache2ctl start?

 *Quote:*   

> Anyways problem happens with SSH too: PuTTY and WinSCP can't get through to server after certain amount of time. Yesterday I made test: I rebooted server, started daemons and immediately connected with PuTTY. I let it be hour or so, and connection didn't break up by itself. As long as PuTTY was running, all other programs (WinSCP and Internet Explorer) did get to server. Server seems to be like an open door: if PuTTY don't keep it open, something closes the door (screensaver or wind or... dunno) and locks it.

 

Retested and confirmed. I'll keep PuTTY running for few hours more. In the meantime, please try if you can connect on my server. Right now its IP-address is:

http://84.251.66.143

It should display directory with following two files on it:

A_Game_With_Dice_by_lady_die.jpg

BattletechFinal2.aviLast edited by Matti Kuokkanen on Wed Mar 26, 2008 4:30 pm; edited 1 time in total

----------

## bunder

 *Quote:*   

>  In the meantime, please try if you can connect on my server. Right now its IP-address is: http://84.251.66.143 

 

works for me

----------

## Matti Kuokkanen

 *bunder wrote:*   

>  *Quote:*    In the meantime, please try if you can connect on my server. Right now its IP-address is: http://84.251.66.143  
> 
> works for me

 

Thank you! I'll shut off PuTTY and WinSCP now. Try it again hour after this post, and then say whether it works. If not, I'd like to know (possible) reason why not, or some way to find it out. Solution would be great too.

[edit]

Forgot to tell you, that even after other computers fail to connect to my Gentoo server, it itself can connect to Internet (with Irssi, Links, Firefox... it's not headless) and daemons are running.

----------

## snIP3r

ok, now i know how your config works. your gentoo box AND windows box both connect to your isp.

the info that the win xp box would not connect to the gentoo box after putty or winscp do not run for an hour looks like a timeout from your isp or your modem. if no traffic is produced it timeouts after some time (here ~1 hour). have you considered of this possibility?

HTH

snIP3r

----------

## bunder

 *Matti Kuokkanen wrote:*   

> Try it again hour after this post, and then say whether it works.

 

still works.

----------

## Matti Kuokkanen

 *snIP3r wrote:*   

> the info that the win xp box would not connect to the gentoo box after putty or winscp do not run for an hour looks like a timeout from your isp or your modem. if no traffic is produced it timeouts after some time (here ~1 hour). have you considered of this possibility?

 

I haven't think it exactly with term timeout... So what's the solution? Do I need leave 300+ watt eating monster turned on at all times and create some traffic for server?

----------

## Matti Kuokkanen

 *bunder wrote:*   

>  *Matti Kuokkanen wrote:*   Try it again hour after this post, and then say whether it works. 
> 
> still works.

 

Hour wasn't up yet  :Razz: 

----------

## snIP3r

 *bunder wrote:*   

>  *Matti Kuokkanen wrote:*   Try it again hour after this post, and then say whether it works. 
> 
> still works.

 

still works for me too.

i am still confused about the way you describe your connection to the internet. you must have entered some authentication information somewhere if you do not use pppoe. where did you do this?

HTH

snIP3r

----------

## Matti Kuokkanen

 *snIP3r wrote:*   

> i am still confused about the way you describe your connection to the internet. you must have entered some authentication information somewhere if you do not use pppoe. where did you do this?

 

I am confused about must have entered some authentication information somewhere  :Confused: 

[edit]

When I was installing Gentoo, I configured network with net-setup command, and it worked. Nowhere was asked about passwords, and I wasn't given any anyway.

----------

## snIP3r

 *Matti Kuokkanen wrote:*   

>  *snIP3r wrote:*   i am still confused about the way you describe your connection to the internet. you must have entered some authentication information somewhere if you do not use pppoe. where did you do this? 
> 
> I am confused about must have entered some authentication information somewhere 
> 
> [edit]
> ...

 

sorry but i still do not know what "straight adsl" means. for me it looks like all the info needed to connect to your isp is (perhaps automatically) entered in you adsl modem. could you tell me what ip adress your xp machine has?

----------

## Matti Kuokkanen

 *snIP3r wrote:*   

> sorry but i still do not know what "straight adsl" means.

 

It's not official term, I just used it to describe there is no need for PPPoE dialog or anything like it.

 *Quote:*   

> for me it looks like all the info needed to connect to your isp is (perhaps automatically) entered in you adsl modem.

 

Could be, but it works simple like that for internal modem too. My guess is that ISP identifies user by location.

 *Quote:*   

> could you tell me what ip adress your xp machine has?

 

88.193.129.238

What for do you need it?

----------

## snIP3r

 *Matti Kuokkanen wrote:*   

>  *snIP3r wrote:*   sorry but i still do not know what "straight adsl" means. 
> 
> It's not official term, I just used it to describe there is no need for PPPoE dialog or anything like it.

 

ok

 *Quote:*   

>  *Quote:*   for me it looks like all the info needed to connect to your isp is (perhaps automatically) entered in you adsl modem. 
> 
> Could be, but it works simple like that for internal modem too. My guess is that ISP identifies user by location.

 

hmmm, i am from germany and i only know isp's hat need authentication data to grant access. you have to either insert the data manually into the modem or automatically. your form of getting connected is not known to me.

 *Quote:*   

>  *Quote:*   could you tell me what ip adress your xp machine has? 
> 
> 88.193.129.238
> 
> What for do you need it?

 

it was only needed for my understanding. now i am totally confused  :Sad: 

first i thought that your xp would be disconnected by either your isp or your modem due to no traffic. but the thing is that you do not have to connect or disconnect. so automatic disconnection makes no sense for me. but the fact that you can only connect while creating traffic, and if you do not create traffic it will not work indicates a forced disconnection.   :Confused: 

have you contacted your isp already and asked him for any diagnosis??

p.s. i can still access the gentoo box...

----------

## Matti Kuokkanen

 *snIP3r wrote:*   

> i am from germany and i only know isp's hat need authentication data to grant access. you have to either insert the data manually into the modem or automatically. your form of getting connected is not known to me.

 

If automated telephone switch can direct telephone calls from one house to another, it shouldn't be that hard to understand that ADSL connections can work similar way. Line just stays always open.

 *snIP3r wrote:*   

> p.s. i can still access the gentoo box...

 

I see two possibilities:

1. Few people reading this topic have typed in the address and are downloading *.avi file, which keeps data going and prevents server's door from closing.

2. There was problem or glitch before, restart cleared it up and it hasn't appeared again yet.

----------

## snIP3r

so your server is accessible all the time now?

----------

## Matti Kuokkanen

 *snIP3r wrote:*   

> so your server is accessible all the time now?

 

Guess again! I woke up, had shover, tried IP addy with IE and PuTTY... can't connect! Let's solve this people! Where do I start? Let's start with assumption that problem is with my server and not with ISP.

Note: SSH and Apache daemons are on their default configurations. I have started them with following commands:

/etc/init.d/sshd start

apache2ctl start

----------

## snIP3r

does the server have the same ip we tested yesterday? i cannot connect it too. for me it looks like a isp issue and not caused by the server.

is the server responding after you restarted your dhcp client on the server?

----------

## Matti Kuokkanen

Thanks for quick reply... I wonder, do you get paid for it?

 *snIP3r wrote:*   

> does the server have the same ip we tested yesterday? i cannot connect it too.

 

Yes, IP address has stayed same. I made test run with Links, it finds server's own address and can get outside too (like to this forum).

 *Quote:*   

> for me it looks like a isp issue and not caused by the server.

 

How can I get confirmation about that? I could drag server to school and see how long it stays up and running there, but I'm leaving town today and probably won't be back until at end of month (I'm done with all the courses).

 *Quote:*   

> is the server responding after you restarted your dhcp client on the server?

 

Dunno how to do that. But so far restarting whole thing has solved that.

----------

## Matti Kuokkanen

So much about theory about PuTTY holding connection open. PuTTY and WinSCP were connected, and both said in chronus:

 *Quote:*   

> Network error: Software caused connection abort

 

This wasn't long after data transfer of several megabytes worth of data from server.

----------

## snIP3r

 *Matti Kuokkanen wrote:*   

>  *Quote:*    Thanks for quick reply... I wonder, do you get paid for it?

 

no i do not get paid for this. i only want to help others as well as i find help here with my problems  :Wink: 

 *Quote:*   

>  *snIP3r wrote:*   does the server have the same ip we tested yesterday? i cannot connect it too. 
> 
> Yes, IP address has stayed same. I made test run with Links, it finds server's own address and can get outside too (like to this forum).
> 
> 

 

hmmm, this makes still no sense for me...

 *Quote:*   

>  *Quote:*   for me it looks like a isp issue and not caused by the server. 
> 
> How can I get confirmation about that? I could drag server to school and see how long it stays up and running there, but I'm leaving town today and probably won't be back until at end of month (I'm done with all the courses).

 

you can call your isp's hotline and ask them for problems with your connection - like you did here. perhaps they can give you some of the answers you are looking for.

 *Quote:*   

>  *Quote:*   is the server responding after you restarted your dhcp client on the server? 
> 
> Dunno how to do that. But so far restarting whole thing has solved that.

 

you do not have to restart the whole server. you can restart the dhcp client by restarting the device that is connected to the adsl modem.

it like this:

```

/etc/init.d/net.ethX restart

```

the X is the device number of the concerned device.

HTH

snIP3r

----------

## kutte128

sorry to dig out this post, but did you solved the problem?

i have also the problem that i get timeouts after some time, but right after the timeout, it works again for some time.

i'm running a root-server with gentoo-hardened, so no problem with adsl or modems

----------

