Nathan H
Nathan H

Reputation: 49451

VMWare Fusion: Change IP of vmnet8

I migrated to a new computer (Mac).

I had a virtual machine on VMWare Fusion which used vmnet8: 172.16.134.1.
When I moved it to the new computer, it assigned vmnet8: 172.16.250.1.

This IP was hardcoded in several places for my development environment (for example a self-signed SSL certificate).
Is there an easy way to change IP? Or am I better of creating a new certificate and changing all my hardcoded values?

Upvotes: 4

Views: 5479

Answers (1)

l'L'l
l'L'l

Reputation: 47282

In OS X you can edit either the general networking configuration or specifically the .conf files. To change the subnet along with the dhcp generated ips for the vm look at following:

/Library/Preferences/VMware Fusion/networking
/Library/Preferences/VMware Fusion/vmnet8/nat.conf
/Library/Preferences/VMware Fusion/vmnet8/dhcpd.conf

networking

answer VNET_8_HOSTONLY_SUBNET 172.16.134.0

nat.conf

# NAT gateway address
ip = 172.16.134.2

dhcpd.conf

subnet 172.16.134.0 netmask 255.255.255.0 {
    range 172.16.134.128 172.16.134.254;
    option broadcast-address 172.16.134.255;
    option domain-name-servers 172.16.134.2;
    option domain-name localdomain;
    default-lease-time 1800;                # default is 30 minutes
    max-lease-time 7200;                    # default is 2 hours
    option netbios-name-servers 172.16.134.2;
    option routers 172.16.134.2;
}
host vmnet8 {
    hardware ethernet 00:00:00:00:00:00;    # vm mac address
    fixed-address 172.16.134.1;
    option domain-name-servers 0.0.0.0;
    option domain-name "";
    option routers 0.0.0.0;
}

Restart VMWare Fusion and the vm should reflect the new subnet/ips.

This assumes you have already shutdown your vm, backed up your vms/confs/settings and most importantly know what you're doing.

Upvotes: 4

Related Questions