SSH to a VM with NAT network.

Discussions related to using VirtualBox on Linux hosts.
Post Reply
hack3rcon
Posts: 204
Joined: 28. Feb 2016, 10:44

SSH to a VM with NAT network.

Post by hack3rcon »

Hello.
How can I SSH to VM that it's network configuration in NAT? My host is "Debian 8.6 x86_64" and VM is "CentOS 7.6 x86_64". The VM IP address is "10.0.2.15" and I set a secondary IP address to my NIC as below:

Code: Select all

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

auto eth1:0
iface eth1:0 inet static
address 10.0.2.14
netmask 255.255.255.0
broadcast 10.0.2.255
and "ifconfig" show me:

Code: Select all

eth1:0    Link encap:Ethernet  HWaddr 00:11:3b:15:4a:32  
          inet addr:10.0.2.14  Bcast:10.0.2.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
But I can't ping "10.0.2.15". What is my problem?

Thank you.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: SSH to a VM with NAT network.

Post by socratis »

Take a look at https://www.virtualbox.org/manual/ch06. ... king-modes and you'll know why... ;)
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Post Reply