To assign a fixed IP address to your Ubuntu Server running on VMware Workstation, you need to configure a static IP address in the Ubuntu network settings. Here’s how you can do it:
- Start the Ubuntu Server virtual machine in VMware Workstation.
- Log in to the Ubuntu Server using your credentials.
- Open a terminal window.
Next, we’ll configure the network settings manually by modifying the netplan configuration file.
Run the following command to edit the netplan configuration file:
sudo nano /etc/netplan/00-installer-config.yaml
In the editor, you will see some YAML code. Look for the network interface section and modify it as follows:
network:
ethernets:
enp0s3: # Replace with your actual network interface name (use ifconfig or ip addr show command to find it)
dhcp4: no
addresses: [192.168.1.100/24] # Replace with the desired static IP address and subnet mask
gateway4: 192.168.1.1 # Replace with your router's IP address
nameservers:
addresses: [8.8.8.8, 8.8.4.4] # Replace with preferred DNS server addresses
version: 2
Once you’ve made the changes, press Ctrl + X to save and exit the editor.
Apply the new network configuration by running this command:
sudo netplan apply
The static IP address should now be configured on your Ubuntu Server virtual machine running on VMware Workstation.
Please note that these instructions assume you are using a single virtual NIC (network interface card) for your VM and that it is connected to a NAT or bridged network within VMware Workstation. If you have multiple network interfaces or a different network configuration, you may need to adjust the instructions accordingly.
Also, make sure that the chosen static IP address is not already assigned to another device on your network to avoid conflicts.
If you encounter any issues or need further assistance, feel free to ask!
内容由零声教学AI助手提供,问题来源于学员提问