Unable to ssh to a Linux VM after a day

4

1

I have a machine running 4 VMs on it. There is one Fedora VM which is causing me some trouble. The IPs of the VMs are something like 10.100.100.* I have a Windows PC which is in the same network. It has an IP 10.100.25.77. When I reboot the Fedora VM, I am able to ping it from my Windows PC as well as use putty to ssh to it. The next day, I cant ping it or ssh from my Windows PC. However I can ping and ssh to the other VMs on the machine. If I ssh to one of the other VMs, I can ping and ssh to the Fedora VM. Next if I restart it, things get back to normal and I can access it without any issues. The IP of the VM doesn't change after rebooting and it is statically assigned

I would like to know what is causing this and how to get it fixed.

As a last resort, I am thinking of running a cron job to restart the VM every night, it is not a critical server, but will be generally used occasionally in the day time.

Nmap scan report for 10.100.100.81
Host is up (0.00018s latency).
Not shown: 995 closed ports
PORT    STATE SERVICE
21/tcp  open  ftp
22/tcp  open  ssh
111/tcp open  rpcbind
139/tcp open  netbios-ssn
445/tcp open  microsoft-ds
MAC Address:XX:XX:XX:XX:XX:XX (VMware)

iamme

Posted 2012-10-05T06:35:43.087

Reputation: 513

ssh and ping both timeout. I will run an nmap scan and post the results here in a few hours. One observation I made, is that I can ssh to it from any IP with the IP 10.100.100.* Dont know if this points to anything – iamme – 2012-10-08T05:10:24.027

1

I have asked another question following up on this http://superuser.com/questions/484816/what-is-the-point-of-system-autodeath

– iamme – 2012-10-08T07:04:14.867

Answers

1

As I have written in one of the comments, my VM had an autodeath cron job running. I got to know this by opening /var/log/messages and found the message " localhost autodeath: Default route disabled by autodeath cron job." After deleting " /etc/cron.daily/system-autodeath.sh", ping works fine the next day

iamme

Posted 2012-10-05T06:35:43.087

Reputation: 513

2

I don't have enough reputation to add a comment so writing an answer...

Question? What are you using for virtualization and what kind of networking environment do you have? (bridged/routed/etc)

Check the following:

  1. Fedora VM Netmask it's 255.0.0.0

  2. After it get unreachable, get into one of the VM's that can access the bad VM, jump to it through ssh from another VM and then try to ping the windows host from it. If it suceed, try to ssh into it from windows, if now works then your problem is windows host arp request to locate fedora are not being send-to/replied-by Fedora VM.

  3. Wait to happen again and then compare between the fedora nonreachable linux VM and another linux VM the output of the following commands:

    • route -n
    • arp -a
    • iptables -L -n -v
  4. Check on /var/log/messages or /var/log/syslog if any service that it's being automatically restarted during the night by logrotate or whatever, if so try to restart the service yourself from shell to see if that's breaking your networking on Fedora VM as this would explain why always stop working after one day.

Good luck

Valor

Posted 2012-10-05T06:35:43.087

Reputation: 471

This was a helpful answer! I opened /var/log/messages and found the following localhost autodeath: Default route disabled by autodeath cron job. So I deleted the death date line from vim /etc/sysconfig/system-autodeath.conf. I have restarted the machine. Will mark this answer tomorrow. But it looks good to me. There was a line missing in route -n, so this looks to be it – iamme – 2012-10-08T06:58:27.163

@jogabonito I don't think that removing that line will work as you expect, just checked the cron script source here and it seems it sets a default date and then reads config, so what you need to do is disable cron script (remove it or take exec permission away from it).

– Valor – 2012-10-08T07:32:03.267

Isn't the default DEATHDATE=2038-01-20. That should be fine for me.....( Set Reminder to self, check IP access in 2038 :-) ) – iamme – 2012-10-08T07:48:44.093

Also saw where the cron job is, I have deleted it, will update tomorrow – iamme – 2012-10-08T07:58:14.773

@jogabonito it worked? Vm still pinging? – Valor – 2012-10-08T19:26:06.670

very much so :-) – iamme – 2012-10-09T03:59:43.367