Advertisement
Guest User

Untitled

a guest
Apr 26th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. root@dra7xx-evm:~# cat /etc/init.d/bridge.sh
  2. #!/bin/bash
  3. #
  4. ### BEGIN INIT INFO
  5. # Provides: bridge
  6. # Required-Start: $remote_fs
  7. # Required-Stop: $remote_fs
  8. # Default-Start: 2 3 5
  9. # Default-Stop: 0 1 6
  10. # Short-Description: Setup vif bridge
  11. # Description: Start/stop bridge
  12. ### END INIT INFO
  13. #
  14.  
  15. PATH="/sbin:/usr/sbin:/usr/local/sbin";
  16. slaveIfs="1 2 3 4 6 7 8 9 10";
  17. cmd="$1";
  18. [ -z "$cmd" ] && cmd="start";
  19. case "$cmd" in
  20. startcddbr br0;
  21. brctl addif br0 eth0;
  22. brctl addif br0 vif2.1;
  23. (ifdown eth0 1>/dev/null 2>&1;);
  24. ifconfig eth0 0.0.0.0 up;
  25. ifconfig vif2.1 0.0.0.0 up;
  26. for file in br0 eth0 vif2.1;
  27. do
  28. echo "1" > /proc/sys/net/ipv4/conf/${file}/proxy_arp;
  29. echo "1" > /proc/sys/net/ipv4/conf/${file}/forwarding;
  30. done;
  31. echo "1" > /proc/sys/net/ipv4/ip_forward;
  32. /etc/init.d/networking restart;
  33. ;;
  34. stop)
  35. ifconfig br0 down;
  36. brctl delbr br0;
  37. ifconfig br1 down;
  38. brctl delbr br1;
  39. ifconfig br2 down;
  40. brctl delbr br2;
  41. #ifup eth0; ### Adapt to your needs.
  42. #ifup eth1; ### Adapt to your needs.
  43. ;;
  44. restart,reload)
  45. $0 stop;
  46. sleep 3;
  47. $0 start;
  48. ;;
  49. esac;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement