Changing the subnet mask in Vmware Workstation on Debian Jessie
Written on Tuesday, 2014-11-18 14:50. Updated Wednesday, 2014-11-19 00:50. Tagged english and vmware
This post is more than two years old. The information and advice it contains is dated.
I’m currently attending SANS SEC504: Hacker Tools, Techniques, Exploits and Incident Handling in London. For some of the labs in the course we need machines on the IPs 10.10.0.1 and 10.10.71.1 with a subnet mask of 255.255.0.0.
Changing the Subnet Mask for the NAT or host-only networks in VMware Workstation seems like such a easy thing to do. According to VMware it should be as easy as opening the Virtual Network Editor and “type a new value in the Subnet mask text box”.
Oh wait … I can’t change it. The field for subnet mask in the Virtual Network Editor is not editable.
Let’s keep googling - plenty matches, but everyone keeps insisting
it can be changed in the GUI, or mixes the subnet mask with the
subnet IP. Some posts blame permission, but since the Virtual
Network Editor always runs as root, that’s not the problem. There
are no listings for the vmnets in /etc/network/interfaces
or /etc/network/interfaces.d/
and changing the subnet mask
in NetworkManager does nothing.
After a lot of thinking (and just after I checked
/etc/network/interfaces
) I found
/etc/vmware/networking
- BINGO! This looks like just the file
we were looking for.
Before editing the file we should stop any vmware-related services that might use these files.
I’m not sure witch of these services use the files we are editing, so we’ll stop them all.
For the SANS course I have set up a new host-only network vmnet2.
Since we are using static IPs, and will be running malware on these
systems, I have disabled DHCP and not connected a host virtual
adapter. The shared folder option Map as a network drive in
Windows guests
still work, don’t ask me how. Below is the
configuration for vmnet2 with a subnet mask of 255.255.0.0.
Success! (but continue reading, we update the DHCP configuration below the picture)
VMware stores DHCP config and leases in
/etc/vmware/vmnet<NUM>/dhcpd/
. If we have changed the subnet
IP, subnet mask, or turned on or off DHCP, these files need to be
updated. The configfile contains autogenerated information surronded
by “DO NOT MODIFY SECTION”, so we should probably not edit it manually.
If we open VMware Virtual Network Editor (sudo vmware-netcfg
),
change a setting (e.g. the subnet IP from 10.10.0.0 to 10.11.0.0),
save, and then change it back again, VMware will update the files
for us.