Skip to content

Instantly share code, notes, and snippets.

@trastle
Created July 6, 2015 08:54
Show Gist options
  • Save trastle/d118465bd413283ffc2e to your computer and use it in GitHub Desktop.
Save trastle/d118465bd413283ffc2e to your computer and use it in GitHub Desktop.
boot2docker-portforward.sh
#!/bin/bash
VMNAME="boot2docker-vm"
VBoxManage modifyvm "${VMNAME}" --natpf1 "tcp-port$i,tcp,127.0.0.1,2376,,2376";
VBoxManage modifyvm "${VMNAME}" --natpf1 "udp-port$i,udp,127.0.0.1,2376,,2376";
for i in {49001..49999}; do
VBoxManage modifyvm "${VMNAME}" --natpf1 "tcp-port$i,tcp,127.0.0.1,$i,,$i";
VBoxManage modifyvm "${VMNAME}" --natpf1 "udp-port$i,udp,127.0.0.1,$i,,$i";
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment