forked from freifunk-franken/firmware
Generate default layer3 config
This commit is contained in:
parent
aa15ac7812
commit
75abee0ec7
|
@ -0,0 +1,49 @@
|
|||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
BOARD="$(uci get board.model.name)"
|
||||
. /etc/network.$BOARD
|
||||
|
||||
# skip if gateway configuration already exists
|
||||
if [ -s /etc/config/gateway ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
touch /etc/config/gateway
|
||||
|
||||
essid='noservice.freifunk'
|
||||
chan2ghz='1'
|
||||
chan5ghz='36'
|
||||
|
||||
uci batch <<EOF
|
||||
set gateway.meta='gateway'
|
||||
set gateway.meta.config_version='2'
|
||||
|
||||
add gateway client
|
||||
set gateway.@client[0].vlan='1'
|
||||
set gateway.@client[0].essid='$essid'
|
||||
set gateway.@client[0].chan2ghz='$chan2ghz'
|
||||
set gateway.@client[0].chan5ghz='$chan5ghz'
|
||||
|
||||
add gateway wan
|
||||
set gateway.@wan[0].vlan='2'
|
||||
|
||||
set gateway.1=vlan
|
||||
set gateway.1.comment='client'
|
||||
set gateway.1.ports='$BATMAN_PORTS $CLIENT_PORTS'
|
||||
set gateway.2=vlan
|
||||
set gateway.2.comment='wan'
|
||||
set gateway.2.ports='$WAN_PORTS'
|
||||
|
||||
add gateway dns
|
||||
add_list gateway.@dns[0].server='fd43:5602:29bd:ffff:1:1:1:1'
|
||||
EOF
|
||||
|
||||
# TODO: one-port
|
||||
# TODO: two-port
|
||||
# TODO: dsa
|
||||
|
||||
uci commit gateway
|
||||
|
||||
exit 0
|
Loading…
Reference in New Issue