a guest Oct 17th, 2019 85 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- # I copied this from another person. I have not been able to find the link. once i do i will link it here.
- # i made some modifications - mainly adding variables
- # this script causes the zerotier interface to not be accessible by other applications which is why it didn't
- # cut it for me
- #create netns
- sudo service zerotier-one restart
- INF='<zerotier interface name>'
- IP='<zerotier ip>/24'
- # could be wrong here. need more info
- GW='<ip in same subnet as zerotier>'
- WPREFIX='<path to wine prefix>'
- APP_PATH='<path to app inside wine>'
- sudo ip netns delete myNamespace
- sudo ip netns add myNamespace
- #link iface to netns
- sudo ip link set $INF netns myNamespace
- #set ip address in namespace
- sudo ip netns exec myNamespace ifconfig $INF $IP up
- #set loopback (may be needed by process run in this namespace)
- sudo ip netns exec myNamespace ifconfig lo 127.0.0.1/8 up
- #set route in namespace
- sudo ip netns exec myNamespace route add default gw $GW
- #force firefox to run inside namespace (using eth0 as outgoing interface and the route)
- sudo ip netns exec myNamespace env WINEPREFIX="$WPREFIX" wine $APP_PATH
RAW Paste Data