Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

To get static IP address

avatar
Contributor

HI All, I facing an issue of different IP address everytime when I am restarting VMWare machine. Can some one suggest how to get the same/static IP address. (let me know if I do need to change any .vmx file or any other file entry). Thanks.

1 ACCEPTED SOLUTION

avatar

In your /etc/network/interfaces file, you probably have something like the following:

auto lo
iface lo 
inet loopback

auto eth0
iface eth0 
inet dhcp

In your /etc/network/interfaces file, you need to change the inet element under eth0 to static and add your desired networking info:

auto lo
iface lo 
inet loopback

auto eth0
iface eth0 
inet static
address 192.168.78.10
netmask 255.255.255.0
network 192.168.78.0
broadcast 192.168.78.255
gateway 192.168.78.1

The first three elements of your address, network, broadcast, and gateway should be the same as those in the ip automatically assigned by vmware to your vm (in this case, 192.168.178). The fourth element of your address should be something between 3 and 128 inclusive, to avoid conflicts with dhcp (in this case 10). The fourth element of network is always 0. The fourth element of broadcast is always 255. The fourth element of gateway is always 1.

Finally, be sure to restart your vm for the above changes to take effect and then follow the steps in our doc to check DNS and NSCD.

View solution in original post

5 REPLIES 5

avatar

In your /etc/network/interfaces file, you probably have something like the following:

auto lo
iface lo 
inet loopback

auto eth0
iface eth0 
inet dhcp

In your /etc/network/interfaces file, you need to change the inet element under eth0 to static and add your desired networking info:

auto lo
iface lo 
inet loopback

auto eth0
iface eth0 
inet static
address 192.168.78.10
netmask 255.255.255.0
network 192.168.78.0
broadcast 192.168.78.255
gateway 192.168.78.1

The first three elements of your address, network, broadcast, and gateway should be the same as those in the ip automatically assigned by vmware to your vm (in this case, 192.168.178). The fourth element of your address should be something between 3 and 128 inclusive, to avoid conflicts with dhcp (in this case 10). The fourth element of network is always 0. The fourth element of broadcast is always 255. The fourth element of gateway is always 1.

Finally, be sure to restart your vm for the above changes to take effect and then follow the steps in our doc to check DNS and NSCD.

avatar
Expert Contributor

Tom is correct, but if using virtual client such as vmware fusion you'll have to do it differently. Grab the MAC address of the VM by selecting the VM->Virtual Machine->Settings->Network Adapter->Advanced Options and copy the MAC Address

vi /Library/Preferences/VMware Fusion/vmnet8/dhcp.conf

add the line at the bottom of the conf file

host hdp24 {

hardware ethernet 00:0C:29:42:61:D7;

fixed-address 192.168.245.133;

}

avatar
@rahul jain: Was this answer helpful? If so, could you please accept it through the HCC? If not, is there some follow-up I could help you with?

avatar
Contributor

HI Tom/Dan, Thanks for your quick reply and followup on this.

But I tried using Tom's option which did not work here. For Dan's suggestion too I tried but seems I can not find the path vi /Library/Preferences/VMware Fusion/vmnet8/dhcp.conf where I can add the up the line. Not sure if I am looking at the right place. But may you please mention it step by step if I can follow you.

Thanks in advance. Best Regards, Rahul

avatar
Super Collaborator