-
-
Save leoh0/ef5de7405be1421c0baab63038679967 to your computer and use it in GitHub Desktop.
script to get xet xhyve working with all vpn interfaces
This file contains hidden or 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 | |
interfaces=( $(netstat -in | egrep 'utun\d .*\d+\.\d+\.\d+\.\d+' | cut -d ' ' -f 1) ) | |
rulefile="rules.tmp" | |
echo "" > $rulefile | |
sudo pfctl -a com.apple/tun -F nat | |
for i in "${interfaces[@]}" | |
do | |
RULE="nat on ${i} proto {tcp, udp, icmp} from 192.168.64.0/24 to any -> ${i}" | |
echo $RULE >> $rulefile | |
done | |
sudo pfctl -a com.apple/tun -f $rulefile | |
# for vpn tunnel | |
docker-machine ssh default 'sudo ip l s mtu 1400 dev eth0' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment