02_network 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. d7800 |\
  14. r7500 |\
  15. r7500v2 |\
  16. r7800 |\
  17. vr2600v)
  18. ucidef_add_switch "switch0" \
  19. "1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
  20. ;;
  21. c2600)
  22. ucidef_add_switch "switch0" \
  23. "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "6@eth1" "5:wan" "0@eth0"
  24. ;;
  25. db149)
  26. ucidef_set_interface_lan "eth1 eth2 eth3"
  27. ucidef_add_switch "switch0" \
  28. "1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
  29. ;;
  30. ea8500)
  31. hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
  32. ucidef_add_switch "switch0" \
  33. "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
  34. ucidef_set_interface_macaddr "lan" "$hw_mac_addr"
  35. ucidef_set_interface_macaddr "wan" "$hw_mac_addr"
  36. ;;
  37. nbg6817)
  38. hw_mac_addr=$(mtd_get_mac_ascii 0:APPSBLENV ethaddr)
  39. ucidef_add_switch "switch0" \
  40. "1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
  41. ucidef_set_interface_macaddr "lan" "$(macaddr_add $hw_mac_addr 2)"
  42. ucidef_set_interface_macaddr "wan" "$(macaddr_add $hw_mac_addr 3)"
  43. ;;
  44. *)
  45. echo "Unsupported hardware. Network interfaces not intialized"
  46. ;;
  47. esac
  48. board_config_flush
  49. exit 0