I
I
Ivan Nikolaevich2014-02-16 18:45:22
Debian
Ivan Nikolaevich, 2014-02-16 18:45:22

VirtualBox how to assign an external IP to a guest machine?

Purpose: to be able to access the guest system through the address.
There is a dedicated remote server with SSH and VNC access:
1. Host - Debian 7.4 wheezy, amd64
2. Guest - Ubuntu 64 with an integrated megaplan box image .

Of the possibilities for administering a child system, there are:
- The ability to try to assign an IP to yourself via DHCP
- The ability to enter 4 parameters manually through the interface (IP adress, Subnet mask, Gateway IP, DNS server ip)
- The ability to manually edit the /etc/network/interfaces file

Screenshot of the interface:
ef0a1750183b4fa3a637b612d6bc267f.png



Attempts:
1. The connection type is bridged, the DHCP server is not responding
Screenshot of the error:
675da2edc9c6407ab58387f67896ba31.png

2. An attempt to enter the pens gave nothing.
On a dedicated server (Host) initially allocated 2 IP
a10581d9f4a04057a94c3ff33fc70f42.png

92.63.107.5 is the master. I tried to use 62.109.28.74 as the external IP for the guest machine, but it didn't work.

PS I don't know Unix and networks well =(
Please help me solve the problem.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan Nikolaevich, 2014-02-19
@north_leshiy

The geek community could not help in solving the question = (
And I tried so hard, composing the question)
I am writing the Solution + comments , maybe it will come in handy for someone)
I decided to rent an additional third IP, find out from the provider its mask and gateway address, set the settings in /etc/ network/intefaces/guest of the machine, set up a bridge and everything worked after a
reboot
) the provider will not miss the call from this IP, but from a different MAC address.
2. You could try to use NAT, but I did not have enough knowledge to put it.
PS Support for the megaplan - a hat, a regulated response of the support for 3 days. Considering that CRM is a vital system for the company that uses it (the whole business is tied to it), then it is simple if work fails in several. days incurs significant losses for the company.

B
bob12, 2019-01-18
@bob12

Solution for forwarding through NAT using VBoxManage
Let's assume that you have NAT configured on the first interface of the virtual machine: Let's also assume that the external IP accessible from the Internet on your machine is 1.1.1.1. In this case, for forwarding, for example, SSH/HTTP/HTTPS, you can use the following commands:

VBoxManage modifyvm "VM name" --natpf1 "myssh,tcp,1.1.1.1,22,,22"
VBoxManage modifyvm "VM name" --natpf1 "myhttp,tcp,1.1.1.1,80,,80"
VBoxManage modifyvm "VM name" --natpf1 "myhttps,tcp,1.1.1.1,443,,443"

You can read more in the official documentation at https://www.virtualbox.org/manual/ch06.html in section 6.3.1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question