October 03, 2013

Accessing xSeries IMM indirectly via SOCKS

If you need to connect to IMM (Integrated Management Module) and you have no direct connection to this IP, but to one of the servers from the network where IMM is reachable.

1. Establish Reverse Proxy to one of the server from the network where IMM is reachable

$ ssh -D3008 -N user@

2. Add IMM IP as virtual to your current network interface in use (e.g. wlan0)

# IP=""
# ifconfig wlan0 add $IP
(seems is only optional) #echo "$IP     IMM-HOSTNAME" >> /etc/hosts

3. Establish port forwarding (via the proxy) from original source (IMM) to your virtual IP (which is set over wlan0 now)

# ncat -k -l $IP 80 --sh-exec "ncat -v --proxy-type socks4 --proxy $IP 80" &
# ncat -k -l $IP 3900 --sh-exec "ncat -v --proxy-type socks4 --proxy $IP 3900" &

# ps -ef|grep -w $IP |grep -v grep
root       454 31406  0 10:15 pts/12   00:00:00 ncat -k -l 3900 --sh-exec ncat -v --proxy-type socks4 --proxy 3900
root     32758 31406  0 10:15 pts/12   00:00:00 ncat -k -l 80 --sh-exec ncat -v --proxy-type socks4 --proxy 80

Now you can access IMM via your browser -> ; Remote Control (KVM) also works fine.

In case of problems, troubleshoot tcpdump in order to determine necessary ports to be forwarded

# tcpdump -vvv -en -i wlan0 > wlan0.tcpdump

For other ports check http://www.redbooks.ibm.com/abstracts/tips0511.html


# ps -ef|grep -w $IP |grep -v grep |awk '{print $2}' |xargs kill
# ifconfig wlan0 del $IP

Remove $IP from /etc/hosts