0

I am pretty new to Ubuntu so I tried to change my static IP address, and sometimes it works and the IP address changes.

I shutdown the OS, and my static IP address changes, but I can ping to others. When I check virtual network editor, my interface didn't show up.

There is no eth0 in virtual network editor:

Chai T. Rex
  • 5,193
  • 1
    The eth0 interface is shown as VMnet8. It's almost definitely not set up as a static IP address. It probably uses DHCP to get an address. – Chai T. Rex Dec 24 '17 at 13:29
  • You have to check in the properties of the VM what NIC is connected to which virtual network. Please note that the default for host only is DHCP. – vidarlo Dec 24 '17 at 13:39
  • how to change it to static? – Fariliana Eri Dec 24 '17 at 14:16
  • Run the following command, copy the output, paste it into your question, select the text, and press the {} button in the editor. If you are on Ubuntu 14.04, run nmcli dev list iface eth0. Otherwise, run nmcli device show eth0. – Chai T. Rex Dec 24 '17 at 15:16

1 Answers1

0

The eth0 interface is shown as VMnet8. To set up a static IP address on NAT, VMware Workstation's documentation says that you must use an address ending somewhere in 3 to 127.

To change the address to static, you can follow the instructions on an answer to a question about setting up static IP addresses on Ubuntu (which I've modified below to better suit you):

Edit /etc/network/interfaces to reflect something like this:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.59.3
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.59.2
dns-nameservers 192.168.59.2

Then do a:

sudo /etc/init.d/networking restart

Change 192.168.59.3 to other addresses up to 192.168.59.127 for other virtual machines that need a static IP address.

Chai T. Rex
  • 5,193