Skip to content

Instantly share code, notes, and snippets.

@daktak
Last active January 9, 2017 05:15
Show Gist options
  • Save daktak/499a893fe348f0db611a63f8308520f7 to your computer and use it in GitHub Desktop.
Save daktak/499a893fe348f0db611a63f8308520f7 to your computer and use it in GitHub Desktop.
Qubes-OS allow two appvms to talk to each other
#!/bin/bash
vm1=$1
vm2=$2
fw=$3
ip1=`qvm-run -p -u root ${vm1} "ifconfig eth0 | grep 'inet ' | column -t | cut -d ' ' -f3"`
ip2=`qvm-run -p -u root ${vm2} "ifconfig eth0 | grep 'inet ' | column -t | cut -d ' ' -f3"`
if [ -z ${fw} ]; then
fw=sys-firewall
fi
exe="iptables -I FORWARD 2 -s ${ip1} -d ${ip2} -j ACCEPT && iptables -I FORWARD 2 -s ${ip2} -d ${ip1} -j ACCEPT"
#echo ${exe}
echo ${vm1} ${ip1}
echo ${vm2} ${ip2}
qvm-run -p -u root ${fw} "${exe}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment