Last active
January 9, 2017 05:15
-
-
Save daktak/499a893fe348f0db611a63f8308520f7 to your computer and use it in GitHub Desktop.
Qubes-OS allow two appvms to talk to each other
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 | |
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