
When you deploy a Vultr virtual cloud server, it receives an IP address assignment automatically with DHCP. Usually, you do not need to change the network settings. However, if you are configuring BGP or private networks, you may need to set a static IP address for your server.
When you restore a server backup that used a static IP, it must be reset to DHCP to receive a working IP address. If you need to reset the network after restoring a snapshot, follow this guide which explains how to return a Vultr server to the default DHCP configuration.
Before proceeding, follow these steps to locate your server's network adapter name.
List your network configuration files. If your adapter name is eth0, you'll see:
You may see other adapter names if you previously deployed this server on a different Vultr host. If you have configuration files that do not match your current adapter names, it's a good practice to move them to a backup location.
Edit or create a new configuration file named ifcfg-{your adapter name}.
Replace any existing content with the following. Replace eth0 with your adapter name.
See if a static route configuration exists.
If there is a static route for your interface name, remove it.
Restart networking or reboot.
List your network configuration files. If your adapter name is enp1s0, you may see:
You may see other adapter names if you previously deployed this server on a different Vultr host. If you have configuration files that do not match your current adapter names, it's a good practice to move them to a backup location.
Edit or create a new configuration file named ifcfg-{your adapter name}.
Replace any existing content with the following. Replace enp1s0 with your adapter name.
Restart the connection or reboot. Replace enp1s0 with your adapter name in the commands below.
Edit your network interface file.
Replace the contents with the Vultr default information. Replace enp1s0 with your adapter name in three places.
Restart networking or reboot.
Run the following commands to return your system to DHCP. Replace enp1s0 with your adapter name.
Edit /etc/rc.conf.
Populate the file with the following.
hostname="example" with your hostname.ifconfig_vtnet0="DHCP" line for your adapter name, if needed.Reboot the system.
Edit /etc/hostname.vio0.
Delete everything in this file and replace it with a single line:
Reboot, or restart the networking subsystem.
List your network configuration files. If your adapter name is enp1s0, you'll see:
You may see other adapter names if you previously deployed this server on a different Vultr host. If you have configuration files that do not match your current adapter names, it's a good practice to move them to a backup location.
Edit or create a new configuration file named 10-{your adapter name}.yaml.
Replace any existing content with the following. Replace enp1s0 with your adapter name. YAML files require proper indentation. Pay attention to the formatting.
Update networking or reboot.
Use the web console to connect to the server desktop. (Changes to the network will disconnect you if you use Remote Desktop.)
Open Control Panel.
Click Network and Internet.
Click Network and Sharing Center.
Click the Ethernet connection to open the Ethernet Status dialog.
Click the Properties button.
Select Internet Protocol Version 4, then click the Properties button.
Set the adapter to Obtain an IP address automatically.
Click OK to save the settings.
0 Comments
Be the first to comment and share your perspective with the community.