Forked from sampowers/map_remote_ipmi_ports_to_loopback_ip.sh
Created
March 24, 2014 13:24
-
-
Save butlerpeter/9739989 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x | |
shell='user@ssh-host-on-ipmi-network' | |
ipmihost='192.168.1.16' | |
ifalias='127.0.0.2' | |
ports="80 443 623 5900 5901 5120 5123 8889" | |
for p in $ports; do | |
fwportspec=" ${fwportspec} -L $ifalias:$p:$ipmihost:$p " | |
done | |
sudo ifconfig lo0 alias $ifalias | |
sudo ssh -v -C $fwportspec $shell | |
sleep 1 | |
sudo ifconfig lo0 -alias $ifalias |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment