Skip to content

Instantly share code, notes, and snippets.

@mpetronic
mpetronic / netsetup.sh
Created September 25, 2015 18:01
VM Network Setup
#!/bin/bash
# Copy this script to a VMWare template or guest before you clone it
# and then you an more easily setup the networking on the clone. It
# configures the hostname, gateway, and IP address. Assumes the clone
# only has one network interface (eth0). It also fixes up the udev
# settings and dynamically reloads the network interface and the
# hostname into the kernel so no reboot is needed.
#
# Usage: ./netsetaup.sh <hostname> <ipaddr> <gateway> [netmask]