Advertisement
Guest User

Untitled

a guest
Apr 4th, 2013
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. target/linux/lantiq/base-files/etc/uci-defaults/02_network
  2.  
  3. #!/bin/sh
  4. #
  5. # Copyright (C) 2011-2012 OpenWrt.org
  6. #
  7.  
  8. [ -e /etc/config/network ] && exit 0
  9.  
  10. set_atm_wan() {
  11. local vpi=$1
  12. local vci=$2
  13. local encaps=$3
  14. local payload=$4
  15. uci batch <<EOF
  16. set network.atm='atm-bridge'
  17. set network.atm.vpi='$vpi'
  18. set network.atm.vci='$vci'
  19. set network.atm.encaps='$encaps'
  20. set network.atm.payload='$payload'
  21. set network.wan='interface'
  22. set network.wan.ifname='nas0'
  23. set network.wan.proto='pppoe'
  24. set network.wan.username='foo'
  25. set network.wan.password='bar'
  26. EOF
  27. }
  28.  
  29. . /lib/functions/uci-defaults.sh
  30. . /lib/functions/lantiq.sh
  31.  
  32. touch /etc/config/network
  33.  
  34. ucidef_set_interface_loopback
  35. ucidef_set_interface_lan 'eth0'
  36.  
  37. vpi=1
  38. vci=32
  39. encaps="llc"
  40. payload="bridged"
  41.  
  42. board=$(lantiq_board_id)
  43.  
  44. case "$board" in
  45. # adm6996
  46. ARV4520PW)
  47. ucidef_set_interface_lan "eth0.1"
  48. ucidef_add_switch "eth0" "1" "1"
  49. ucidef_add_switch_vlan "eth0" "1" "3 2 1 0 5t"
  50. ;;
  51.  
  52. ACMP252|GIGASX76X)
  53. ucidef_set_interface_lan "eth0.1"
  54. ucidef_add_switch "eth0" "1" "1"
  55. ucidef_add_switch_vlan "eth0" "1" "4 3 2 1 5t"
  56. ;;
  57.  
  58. # ar8316
  59. ARV4519PW|ARV7518PW)
  60. ucidef_set_interface_lan "eth0.1"
  61. ucidef_add_switch "switch0" "1" "1"
  62. ucidef_add_switch_vlan "switch0" "1" "0t 2 3 4 5"
  63. ;;
  64.  
  65. WBMR)
  66. ucidef_add_switch "switch0" "1" "0"
  67. ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4 5"
  68. ;;
  69.  
  70. esac
  71.  
  72. [ -z "$(ls /lib/modules/`uname -r`/ltq_atm*)" ] || set_atm_wan "$vpi" "$vci" "$encaps" "$payload"
  73.  
  74.  
  75. uci commit network
  76.  
  77. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement