02_network 923 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/sh
  2. #
  3. # Copyright (c) 2015 The Linux Foundation. All rights reserved.
  4. # Copyright (c) 2011-2015 OpenWrt.org
  5. #
  6. . /lib/functions/uci-defaults.sh
  7. . /lib/ipq806x.sh
  8. . /lib/functions/system.sh
  9. board_config_update
  10. board=$(ipq806x_board_name)
  11. case "$board" in
  12. ap148 |\
  13. c2600 |\
  14. d7800 |\
  15. r7500 |\
  16. r7500v2 |\
  17. r7800)
  18. ucidef_add_switch "switch0" \
  19. "1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
  20. ;;
  21. db149)
  22. ucidef_set_interface_lan "eth1 eth2 eth3"
  23. ucidef_add_switch "switch0" \
  24. "1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
  25. ;;
  26. ea8500)
  27. hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
  28. ucidef_add_switch "switch0" \
  29. "1:lan" "2:lan" "3:lan" "4:lan" "0t@eth0" "5:wan" "0t@eth0"
  30. ucidef_set_interface_macaddr "lan" "$hw_mac_addr"
  31. ucidef_set_interface_macaddr "wan" "$hw_mac_addr"
  32. ;;
  33. *)
  34. echo "Unsupported hardware. Network interfaces not intialized"
  35. ;;
  36. esac
  37. board_config_flush
  38. exit 0