blob: 3baa679a8b527937fb2294c4c57e82f05497fa7e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
config_simple() {
cat >> /etc/config/network <<EOF
config interface lan
option ifname eth0
option type bridge
option proto static
option ipaddr 192.168.1.1
option netmask 255.255.255.0
option ip6assign 60
EOF
}
config_dsa() {
cat >> /etc/config/network <<EOF
config interface eth0
option ifname eth0
config interface wan
option ifname wan
option proto dhcp
option hostname openwrt
config interface lan
option ifname "lan1 lan2 lan3 lan4"
option type bridge
option proto static
option ipaddr 192.168.1.1
option netmask 255.255.255.0
option ip6assign 60
config interface wan6
option ifname @wan
option proto dhcpv6
config globals globals
option ula_prefix auto
EOF
}
cat > /etc/config/network <<EOF
config interface loopback
option ifname lo
option proto static
option ipaddr 127.0.0.1
option netmask 255.0.0.0
EOF
if grep -q lan /proc/net/dev; then
config_dsa
else
config_simple
fi
|