public final void setIp(String inDecimalIp) throws InvalidIPAddressException {

		if (inDecimalIp.equalsIgnoreCase("0.0.0.0")) { // test for 0.0.0.0
			throw new InvalidIPAddressException("Invalid IP Address");
		} else if (inDecimalIp == "127.0.0.1") { // test for loopback 127.0.0.1
			throw new InvalidIPAddressException("Invalid IP Address, this address is reserved for the loopback device");
		}

		String[] ip = inDecimalIp.split("\\."); // split string into an array

		for (int i = 0; i < ip.length; i++) {
			try {
				Integer octet = new Integer(ip[i].trim());
				// if (octet.intValue() == 255){ //test all octet's for 255
				// throw new
				// InvalidIPAddressException("Invalid IP Address, cant use Subnet Mask as IP address");
				// }
				// FIXME

				if (i == 0) { // test first octect for 0 eg 0.1.2.3 is an
								// invalid address
					if (octet.intValue() == 0) {
						throw new InvalidIPAddressException("Invalid IP Address");
					}
				}
			} catch (NumberFormatException e) {
				throw new InvalidIPAddressException("Invalid characters entered for IP address");
			}
		}

		if (IPV4Address.checkHostId(setDefaultSubnetMask(inDecimalIp), IPV4Address.toBinaryString(inDecimalIp))) { // test
																													// if
																													// the
																													// hostID
																													// is
																													// valid
			binaryIpAddress = IPV4Address.toBinaryString(inDecimalIp);
			binarySubnetMask = setDefaultSubnetMask(inDecimalIp);
		} else
			throw new InvalidIPAddressException("Invalid IP Address, invalid hostID");
	}