2012-05-29 16:39:15 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2014-05-28 21:43:39 +00:00
|
|
|
# Copyright (C) 2012-2014 OpenWrt.org
|
2012-05-29 16:39:15 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
[ -e /etc/config/network ] && exit 0
|
|
|
|
|
2013-10-14 19:46:40 +00:00
|
|
|
touch /etc/config/network
|
|
|
|
|
2012-05-29 16:39:15 +00:00
|
|
|
set_lan_dhcp() {
|
|
|
|
local ifname=$1
|
|
|
|
uci batch <<EOF
|
|
|
|
set network.lan='interface'
|
|
|
|
set network.lan.ifname='$ifname'
|
|
|
|
set network.lan.proto='dhcp'
|
2013-04-09 08:03:08 +00:00
|
|
|
set network.lan6='interface'
|
|
|
|
set network.lan6.ifname='@lan'
|
|
|
|
set network.lan6.proto='dhcpv6'
|
|
|
|
set network.lan6.reqprefix='no'
|
2012-05-29 16:39:15 +00:00
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
|
|
|
. /lib/functions/uci-defaults.sh
|
2014-06-26 10:13:47 +00:00
|
|
|
. /lib/kirkwood.sh
|
2014-06-24 18:18:53 +00:00
|
|
|
|
|
|
|
board=$(kirkwood_board_name)
|
2012-05-29 16:39:15 +00:00
|
|
|
|
|
|
|
ucidef_set_interface_loopback
|
|
|
|
|
2014-06-24 18:18:53 +00:00
|
|
|
case "$board" in
|
2015-02-12 14:39:26 +00:00
|
|
|
"dockstar"|\
|
2015-05-08 20:12:39 +00:00
|
|
|
"goflexhome"|\
|
2015-02-12 14:39:26 +00:00
|
|
|
"goflexnet"|\
|
|
|
|
"iconnect"|\
|
|
|
|
"ib62x0"|\
|
2014-06-24 18:18:53 +00:00
|
|
|
"pogo_e02")
|
2013-10-31 12:04:04 +00:00
|
|
|
set_lan_dhcp "eth0"
|
|
|
|
;;
|
2014-11-10 23:55:10 +00:00
|
|
|
"ea3500")
|
|
|
|
ucidef_set_interfaces_lan_wan "eth0" "eth1"
|
2015-01-25 13:11:02 +00:00
|
|
|
ucidef_add_switch "switch0" "1" "1"
|
|
|
|
ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5"
|
|
|
|
ucidef_add_switch_vlan "switch0" "2" "4 6"
|
2014-11-10 23:55:10 +00:00
|
|
|
;;
|
2014-06-24 18:18:53 +00:00
|
|
|
"ea4500")
|
2014-05-28 21:43:39 +00:00
|
|
|
ucidef_set_interfaces_lan_wan "eth0" "eth1"
|
2015-01-25 13:11:02 +00:00
|
|
|
ucidef_add_switch "switch0" "1" "1"
|
|
|
|
ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5"
|
|
|
|
ucidef_add_switch_vlan "switch0" "2" "4 6"
|
2014-05-28 21:43:39 +00:00
|
|
|
;;
|
2014-12-19 11:05:13 +00:00
|
|
|
"guruplug-server-plus")
|
|
|
|
set_lan_dhcp "eth0" "eth1"
|
|
|
|
;;
|
|
|
|
"sheevaplug" | \
|
|
|
|
"sheevaplug-esata")
|
|
|
|
set_lan_dhcp "eth0"
|
|
|
|
;;
|
2012-05-29 16:39:15 +00:00
|
|
|
*)
|
|
|
|
ucidef_set_interface_lan "eth0"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
uci commit network
|
|
|
|
|
|
|
|
exit 0
|