LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-11-2019, 05:35 AM   #1
bongo_zg
LQ Newbie
 
Registered: Nov 2019
Posts: 2

Rep: Reputation: Disabled
Losing network after ssh login


I am running vmware (workstation) on my Win 10 host machine, and set up centos 7 vm with NAT configuration.
For the last 2 weeks, I am running into problems with a network of the VM, which is being lost from time to time.
While there are no network problems on the (physical) router, and my host machine operates just fine, I was unable to find a clue what might cause it. Until today...
I found out that I am losing connection after I connect to vm by ssh from my host machine.
I ran ping 8.8.8.8, which was working fine, but once I ssh to it, it all stopped.

Firewall (on vm) is down, iptables and ip6tables down as well. I switched off Win 10 firewall (both private and public).

I am not a linux admin, but I have used VMs before, and it seemed like a straight forward to set up NAT network, etc.. (on my vmware, I have set up NAT network, but I am connecting directly to VMNet2, which is NAT, but not NAT). Also, I am not using dhcp, but a static configuration
 
Old 11-11-2019, 07:28 AM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by bongo_zg View Post
I found out that I am losing connection after I connect to vm by ssh from my host machine.
I ran ping 8.8.8.8, which was working fine, but once I ssh to it, it all stopped.
Can you be a bit more precise?

You ssh from the host to the guest. Then you lose connection - which connection? From the host to the guest, from the guest to the host, from the host to 8.8.8.8, from the guest to 8.8.8.8, something else?

You ran ping 8.8.8.8 where? On the guest, in the console? Or in another ssh session?

What stopped? Can you still use a shell in the console, has the guest crashed?

When you terminate the ssh connection that makes everything stop, does everything go back to normal?

If you still have a shell on the guest, you can start by exploring your network setup, e.g. listing all interfaces and IP addresses.

Last edited by berndbausch; 11-11-2019 at 07:29 AM.
 
Old 11-11-2019, 07:46 AM   #3
bongo_zg
LQ Newbie
 
Registered: Nov 2019
Posts: 2

Original Poster
Rep: Reputation: Disabled
I am ssh from my host OS to my VM. I have 2 open consoles within my VM, one is pinging my vmware nat gateway, another one is pinging 8.8.8.8

After I log in to my vm from my host, the one that pings 8.8.8.8 loses connection to 8.8.8.8
Anything else works fine, including my ssh session.
After I leave the session, network is still lost. It only gets fixed after I reboot the vm (centos 7)

Whenever I try to ping 8.8.8.8 from my host OS, it is possible

this is ifconfig:
Quote:
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.2.10 netmask 255.255.255.0 broadcast 192.168.2.255
inet6 fe80::4a03:a0db:bc72:724e prefixlen 64 scopeid 0x20<link>
inet6 fd15:4ba5:5a2b:1002:69d2:c7a:cdef:1888 prefixlen 64 scopeid 0x0<global>
ether 00:0c:29:18:3b:1b txqueuelen 1000 (Ethernet)
RX packets 1899 bytes 179541 (175.3 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 3565 bytes 347290 (339.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 48 bytes 4080 (3.9 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 48 bytes 4080 (3.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:ee:d1:1e txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)

Last edited by bongo_zg; 11-11-2019 at 09:31 AM.
 
Old 11-11-2019, 09:36 AM   #4
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Since I can't comment on the VMware network setup, let's assume that the problem is in the guest.

To summarize the problem: Guest's internet connection seems to be interrupted when you ssh into the guest from the host. Rebooting the guest fixes the problem. Guest's connection from and to the host is fine.

Baffling. I am in the dark and can only offer a few steps to take.

On the guest, I would first look at network parameters before and after the problem occurs. That is, run
Code:
ip address
ip route
before and after the connection gets interrupted, then compare the output.

I would also use Wireshark to trace both the VMware interface and the external interface for ICMP traffic to/from the guest. The goal is to find out at which point echo requests or replies disappear.

If there are alternatives for accessing the guest over the network, I would also try them out. How do you ssh into it - from the Powershell command line, using a tool like Putty or MobaXterm? Can you use another tool? Enable telnet (I know it's not secure, but this is for testing) and see if telnetting into the guest has the same effect.

And of course, check if anything changes in the VMware network configuration. Unfortunately I don't know what to check for here. Can you set up a bridged connection instead of NAT and see what happens then?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Fast login via ssh / Slow login via login manager with machine in AD-domain c01d Linux - Server 2 03-01-2016 01:52 AM
CentOS 6 - KVM - Physical host losing network connectivity after Bridge configuration gkulkarni Linux - Virtualization and Cloud 10 10-27-2013 04:41 PM
losing DSL, losing GRUB controller andreas_skw Linux - Newbie 4 06-14-2008 01:36 AM
losing DSL, losing GRUB controller andreas_skw Linux - Newbie 1 06-10-2008 11:46 AM
eth0 losing link shortly after 'setting network parameters' on boot scylla Linux - Networking 1 04-13-2005 09:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration