InternetGatewayDevice testIGD = IGDs[0];
System.out.println("Found device " + testIGD.getIGDRootDevice().getModelName());
// now let's open the port
String localHostIP = InetAddress.getLocalHost().getHostAddress();
// we assume that localHostIP is something else than 127.0.0.1
boolean mapped = testIGD.addPortMapping("Some mapping description",
null, port, port,
localHostIP, 0, "TCP");
if (mapped) {
System.out.println("Port " + port + " mapped to " + localHostIP);
}