My Centos's IP is diferent of the normal.

And I can't access it in a ssh command see here

And when I tried access using ssh noting see here

I want to use ssh and samba client, but my IP is diferent.

And I have install Centos in my other VM in a diferent Ubuntu, but the IP appear the same

How can I fix this problem?


Depends on how you configured your network interfaces. I would check in /etc/sysconfig/network-scripts/ifcfg-eth0 on the new VM and see if you can just change the value for IPADDR if it's present. If you have NetworkManager running and the interface is configured with NM_CONTROLLED=yes then the change will be applied when you save the file, otherwise you'll have to do a service network restart to make the change effective.

  • Ok @Joel Davis, but see my ifcfg-eth0 [link]uploaddeimagens.com.br/imagens/… – Vitor Mazuco Mar 26 '14 at 15:15
  • 1
    You're coming off DHCP, which means it's the DHCP server that is giving the same IP address out, probably because the MAC address didn't change when you cloned. I'd change the MAC at the VirtualBox and RHEL (in that same file) levels and then reboot. – Bratchley Mar 26 '14 at 15:17
  • Right @Joel Davis. But how can I change the MAC at the VirtualBox and RHEL? – Vitor Mazuco Mar 26 '14 at 15:21
  • 1
    Change the MAC Address in the file you showed me to take care of RHEL and in VirtualBox: VirtualBox Main Manager -> guest settings -> networking -> advanced – Bratchley Mar 26 '14 at 15:41
  • when I tried to connect using ssh appear the message "Connection refused" or "No route to host" even than I change the port, noting change. See link uploaddeimagens.com.br/imagens/… – Vitor Mazuco Apr 1 '14 at 15:46

This looks like you're using VirtualBox VM with a NAT network (it seems to give the address by default). If so, you need to set up a port forward to access port 22 on the VM from the host.

  1. Open Settings->Network for the VM
  2. Click the little blue arrow next to the Advanced box
  3. Click the box at the bottom labelled "Port Forwarding"
  4. Click the green "+" to add a rule
  5. Add the rule Host IP="", Host Port="2222", Guest IP="", Guest Port="22"
  6. From the host, you should be able to "ssh -p2222"

This is a bit stupid compared to the way VMWare does NAT. It creates a separate network interface on the host for NAT, so no forwarding is necessary.

  • ok, but when I do rhis, can I make a ssh and samba client connection? – Vitor Mazuco Mar 27 '14 at 14:18
  • Yes, you can. And this should be the accepted answer. (Commenting for future readers, since OP posted over 2 years ago.) – dr01 Sep 23 '16 at 10:13
  • To back up @dr01, I just used this answer to fix the same issue. I'm using a CentOS 7 guest on a Win7 host. – industry7 Feb 17 '17 at 19:45
  • This worked for me. – Santiago Trejo Jul 18 '18 at 18:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.