Skip to content

Instantly share code, notes, and snippets.

@petrblaho
Last active August 29, 2015 14:16
Show Gist options
  • Save petrblaho/ee563fc88ee8b081a8a1 to your computer and use it in GitHub Desktop.
Save petrblaho/ee563fc88ee8b081a8a1 to your computer and use it in GitHub Desktop.
#!/usr/bin/sh
## UNDERCLOUD
# from lab
ROUTE_DEV=virbr0
VIRT_IP=`cat /var/lib/libvirt/dnsmasq/default.leases | awk '{print $3}' | head -n1` #undercloud VM IP - get first one
BM_NETWORK_CIDR=192.0.2.1/32
ip route replace $BM_NETWORK_CIDR dev $ROUTE_DEV via $VIRT_IP
#!/usr/bin/sh
# from laptop
# run from inlunch dir
LAB_USER=`cat hosts.instack-virt | tail -n1 | awk '{print $1}' | awk -F@ '{print $1}'`
LAB_HOST=`cat hosts.instack-virt | tail -n1 | awk '{print $1}' | awk -F@ '{print $2}'`
UNDERCLOUD_IP=192.0.2.1
sudo iptables -t nat -A OUTPUT -d $UNDERCLOUD_IP -j DNAT --to-destination 127.0.0.1
ssh -Nf $LAB_USER@$LAB_HOST -L 8774:$UNDERCLOUD_IP:8774 -L 9292:$UNDERCLOUD_IP:9292 -L 8777:$UNDERCLOUD_IP:8777 -L 9696:$UNDERCLOUD_IP:9696 -L 6385:$UNDERCLOUD_IP:6385 -L 8004:$UNDERCLOUD_IP:8004 -L 5000:$UNDERCLOUD_IP:5000 -L 8585:$UNDERCLOUD_IP:8585 -L 35357:$UNDERCLOUD_IP:35357
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment