Steps to connect VM from Host Machine - Putty or any client tool
Enable IP Address - here the IP Address is 192.168.1.30, most of the other details are default - change as per need
File to Edit - /etc/sysconfig/network-scripts/ifcfg-enp0s3
[root@mongo3 ~]# cat /etc/sysconfig/network-scripts/ifcfg-enp0s3
IPADDR=192.168.1.30
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=enp0s3
UUID=84fc37d1-2c3c-4db5-b08a-0480dd0016db
DEVICE=enp0s3
ONBOOT=yes
DNS1=8.8.8.8
DNS2=8.8.4.4
[root@mongo1 ~]#
Restart Network
service network restart
Check the IP Addr using - ip addr
Connect the VM from Host Machine using Putty
Change the Host name
hostnamectl set-hostname mongo3
Reboot after hostname change
init 6
When you relogin using the same IP, you can see the hostname changed as mongo3
Done...