nvram fixup: move the nvram commit hook to commit for all variables, since changes...
[openwrt.git] / package / linux-atm / files / ipoa.sh
1 scan_ipoa() {
2 config_get ifname "$1" ifname
3 ipoadev="${ipoadev:-0}"
4 config_get unit "$1" unit
5 [ -z "$unit" ] && {
6 config_set "$1" ifname "atm$ipoadev"
7 config_set "$1" unit "$ipoadev"
8 ipoadev="$(($ipoadev + 1))"
9 }
10 }
11
12 setup_interface_ipoa() {
13 local iface="$1"
14 local config="$2"
15
16 config_get device "$config" device
17 config_get vpi "$config" vpi
18 vpi=${vpi:-8}
19 config_get vci "$config" vci
20 vci=${vci:-36}
21
22 config_get encaps "$config" encaps
23 case "$encaps" in
24 1|vc) ENCAPS="vc-encaps" ;;
25 *) ENCAPS="llc-encaps" ;;
26 esac
27
28 config_get mtu "$cfg" mtu
29 mtu=${mtu:-1500}
30 atmarp -c $device
31 ifconfig $device $ip netmask $mask mtu $mtu up
32 atmarp -s $gw $vpi.$vci null
33 route add default gw $gw
34 }
This page took 0.041486 seconds and 5 git commands to generate.