Configure an IP address on a virtual machine
Learn how to configure an IP address on a virtual machine
Learn how to configure an IP address on a virtual machine
Last updated 18th November 2020
After you have created a virtual machine (VM), you can assign to it a public or private IP address so that the VM has internet and/or private network connectivity.
This guide will show you how to assign a public or private IP address to a virtual machine.
You can retrieve the information of your public IP address block directly from the vSphere client, by going to the Hosts and Clusters
section. Click on your datacenter and click on the Configure
tab. Then click Network
under OVHcloud
.
On each block delivered by OVHcloud, five IP addresses are reserved for configuring the network and must never be used for your virtual machines. The first and the last four IP addresses in the block are reserved for this purpose.
This is how a Managed Bare Metal IP block is organised:
Reserved
) corresponds to the network addressAvailable
) if no VM is using them, or as (Used
) if they are being usedTo configure a public IP address on your virtual machine, you must first choose the VMNetwork
interface in your VM network adapter settings:
Here is a configuration example on a Debian operating system:
auto eth0
iface eth0 inet static
address 46.105.220.xxx
netmask 255.255.255.240
broadcast 46.105.220.xxx
gateway 46.105.220.xxx
dns-nameservers 213.186.33.99
Mount the adapter using an ifup
in your interface.
You can also check the configuration with an ifconfig
.
If your virtual machine cannot find the network, try checking that the network adapter is configured on VMNetwork and not on LocalPortGroup or a VLAN. Check also that the adapter’s connection box is ticked.
Here is a configuration example for Windows:
In the configuration panel
, go to Network and Internet
, then Network and Sharing Centre
, and then Change Network Adapter
.
To speed up the process, you can click on the Windows search field and write Run
(or press the Windows and R keys at the same time). The Windows command console will open, and you can enter this command:
ncpa.cpl
Right-click on the corresponding VMNetwork adapter and click Properties
. Then select TCP/IPv4 protocol
and click again on Properties, then enter your IP information as follows:
IP address: 46.105.220.xxx
Subnet mask: 255.255.255.240
Default gateway: 46.105.220.yyy
DNS server: 213.186.33.99
The process for configuring a private IP address is similar to that of a public IP address. However, you must use the network adapter configured for your VLAN.
In your interface options, you can edit the following settings:
In your virtual machine settings, you can use a VLAN :
Here is a configuration example on a Debian operating system:
By editing the interfaces file, you can assign a private IP address on your chosen IP range:
auto eth0
iface eth0 inet static
address 192.168.70.1
netmask 255.255.255.0
gateway 192.168.70.254
Mount the adapter using an ifup
in your interface.
You can also check the configuration with an ifconfig
.
Here is a configuration example for Windows:
In the configuration panel
, go to Network and Internet
, then Network and Sharing Centre
, and then to Change Network Adapter
.
To speed up the process, you can click on the Windows search field and write Run
(or press the Windows and R keys at the same time). The Windows command console will open, and you can enter this command:
ncpa.cpl
Right-click on the corresponding VMNetwork adapter and click Properties
. Then select TCP/IPv4 protocol
and click again on Properties
, then enter your IP information as follows:
By modifying this interface, you can assign a private IP address on your chosen IP range:
IP address: 192.168.70.2
Subnet mask: 255.255.255.0
Default gateway: 192.168.70.254
Join our community of users on https://community.ovh.com/en/.
Please feel free to give any suggestions in order to improve this documentation.
Whether your feedback is about images, content, or structure, please share it, so that we can improve it together.
Your support requests will not be processed via this form. To do this, please use the "Create a ticket" form.
Thank you. Your feedback has been received.
Access your community space. Ask questions, search for information, post content, and interact with other OVHcloud Community members.
Discuss with the OVHcloud community