SHARE
TWEET

Untitled

a guest Oct 17th, 2019 85 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # I copied this from another person. I have not been able to find the link. once i do i will link it here.
  2. # i made some modifications - mainly adding variables
  3. # this script causes the zerotier interface to not be accessible by other applications which is why it didn't
  4. # cut it for me
  5. #!/bin/bash
  6. #create netns
  7. sudo service zerotier-one restart
  8. INF='<zerotier interface name>'
  9. IP='<zerotier ip>/24'
  10. # could be wrong here. need more info
  11. GW='<ip in same subnet as zerotier>'
  12. WPREFIX='<path to wine prefix>'
  13. APP_PATH='<path to app inside wine>'
  14. sudo ip netns delete myNamespace
  15. sudo ip netns add myNamespace
  16. #link iface to netns
  17. sudo ip link set $INF  netns myNamespace
  18. #set ip address in namespace
  19. sudo ip netns exec myNamespace ifconfig $INF $IP up
  20. #set loopback (may be needed by process run in this namespace)
  21. sudo ip netns exec myNamespace ifconfig lo 127.0.0.1/8 up
  22. #set route in namespace
  23. sudo ip netns exec myNamespace route add default gw $GW
  24. #force firefox to run inside namespace (using eth0 as outgoing interface and the route)
  25. sudo ip netns exec myNamespace env WINEPREFIX="$WPREFIX" wine $APP_PATH
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top