initradios.sh 923 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/bash
  2. set -e
  3. function bridgeup {
  4. ifconfig $1 down 2> /dev/null || true
  5. brctl delbr $1 2> /dev/null || true
  6. brctl addbr $1
  7. brctl setfd $1 0
  8. brctl addif $1 $2
  9. ifconfig $1 $3
  10. ifconfig $1 up
  11. }
  12. # Configure the virtual or real interfaces
  13. rfkill unblock wifi 2> /dev/null || true
  14. rmmod mac80211_hwsim 2> /dev/null || true
  15. modprobe mac80211_hwsim radios=3
  16. sleep 1
  17. macchanger -m 02:00:00:00:00:00 wlan0 > /dev/null || true
  18. macchanger -m 02:00:00:00:01:00 wlan1 > /dev/null || true
  19. macchanger -m 02:00:00:00:02:00 wlan2 > /dev/null || true
  20. vtund -s -f vtund.server.conf
  21. vtund -f vtund.client.conf conn1 127.0.0.1
  22. sleep 0.4
  23. ifconfig tap0 up
  24. ifconfig tap1 up
  25. bridgeup br0 tap0 192.168.168.101
  26. bridgeup br1 tap1 192.168.168.102
  27. ifconfig wlan0 192.168.100.10
  28. ifconfig wlan1 192.168.100.11
  29. ifconfig wlan2 192.168.100.12
  30. echo "Done. It's recommended to execute this script twice. Remember to disable Wi-Fi in the OS."