A Linux command-line walkthrough for setting a static IP instead of the default IPv4 DHCP
When deploying the new AWS Transform discovery tool, the only option for the deployed virtual machine is IPv4 DHCP. Some VMware customers have security policies forbidding DHCP on server subnets. This post shows you how to configure a static IP on the deployed VM.
Prerequisites
This article assumes you have basic knowledge of navigating a Linux directory tree, creating files, and deleting files.
Deploy the OVA appliance using the Deploy the discovery tool section of the setup instructions.
Procedure
-
Access the deployed VM's console using the Accessing the discovery tool VM section of the setup instructions.
-
Create a file to disable cloud init network configuration
/etc/cloud/cloud.cfg.d/99-disable-cloud-init-network.cfg
#cloud-config
network:
config: disabled
-
Delete the automatically generated DHCP file in /etc/systemd/network
rm /etc/systemd/network/10-cloud-init-ens192.network
-
Create a static network configuration. Replace the example below with IP addresses relevant to your environment.
/etc/systemd/network/20-ens192-static.network
[Match]
Name=ens192
[Network]
DHCP=no
Address=192.168.110.224/24
Gateway=192.168.110.1
DNS=10.200.102.11
DNS=10.200.103.11
[Link]
RequiredForOnline=yes
-
Reboot the VM
shutdown -r now