Forked from sampowers/map_remote_ipmi_ports_to_loopback_ip.sh
Created
July 6, 2016 18:27
-
-
Save wica128/fa9e80fe627946090b579528abe43dea to your computer and use it in GitHub Desktop.
SSH tunnel 127.0.0.2 to supermicro IPMI system
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