1 | # DebWrt Debian interfaces: broadcom |
---|
2 | # |
---|
3 | # - broadcom based devices |
---|
4 | # - b43 or proprietary wl kernel module driver |
---|
5 | # - hostapd or nas |
---|
6 | # - robocfg |
---|
7 | # |
---|
8 | # Tested on Asus WL-500g Premium v1. |
---|
9 | # |
---|
10 | # Amain <amain@debwrt.net> |
---|
11 | |
---|
12 | auto lo |
---|
13 | iface lo inet loopback |
---|
14 | |
---|
15 | auto eth0 |
---|
16 | iface eth0 inet manual |
---|
17 | pre-up /sbin/ifconfig eth0 up |
---|
18 | pre-up /usr/sbin/robocfg switch disable 2>/dev/null |
---|
19 | pre-up /usr/sbin/robocfg vlans enable reset 2>/dev/null |
---|
20 | pre-up /usr/sbin/robocfg vlan 1 ports "0 5t" 2>/dev/null |
---|
21 | pre-up /usr/sbin/robocfg vlan 2 ports "1 2 3 4 5t" 2>/dev/null |
---|
22 | pre-up /usr/sbin/robocfg port 0 state enabled stp none 2>/dev/null |
---|
23 | pre-up /usr/sbin/robocfg switch enable 2>/dev/null |
---|
24 | pre-up /usr/sbin/robocfg show 2>/dev/null |
---|
25 | post-down /usr/sbin/robocfg switch disable 2>/dev/null |
---|
26 | post-down /usr/sbin/robocfg vlans enable reset 2>/dev/null |
---|
27 | post-down /usr/sbin/robocfg vlan 0 ports "0 1 2 3 4 5u" 2>/dev/null |
---|
28 | post-down /usr/sbin/robocfg port 0 state enabled stp none 2>/dev/null |
---|
29 | post-down /usr/sbin/robocfg switch enable 2>/dev/null |
---|
30 | post-down /usr/sbin/robocfg show 2>/dev/null |
---|
31 | post-down /sbin/ifconfig eth0 down |
---|
32 | |
---|
33 | auto wan |
---|
34 | iface wan inet manual |
---|
35 | pre-up if ! grep -q eth0 /etc/network/run/ifstate; then echo "First bring eth0 up."; false; fi |
---|
36 | pre-up /etc/firewall/firewall.sh start |
---|
37 | pre-up /sbin/ip link add link eth0 name wan type vlan id 1 |
---|
38 | pre-up start-stop-daemon --start \ |
---|
39 | --oknodo \ |
---|
40 | --quiet \ |
---|
41 | --pidfile /var/run/dhclient.wan.pid \ |
---|
42 | --exec /sbin/dhclient \ |
---|
43 | -- -v -pf /var/run/dhclient.wan.pid -lf /var/lib/dhcp/dhclient.wan.leases -nw wan |
---|
44 | post-down /sbin/ip link delete wan |
---|
45 | post-down start-stop-daemon --stop \ |
---|
46 | --signal HUP \ |
---|
47 | --pidfile /var/run/dhclient.wan.pid \ |
---|
48 | --exec /sbin/dhclient |
---|
49 | post-down /etc/firewall/firewall.sh stop |
---|
50 | |
---|
51 | auto lan |
---|
52 | iface lan inet manual |
---|
53 | pre-up if ! grep -q eth0 /etc/network/run/ifstate; then echo "First bring eth0 up."; false; fi |
---|
54 | pre-up /sbin/ip link add link eth0 name lan type vlan id 2 |
---|
55 | post-down /sbin/ip link delete lan |
---|
56 | |
---|
57 | #auto wlan0 |
---|
58 | #iface wlan0 inet manual |
---|
59 | # pre-up /sbin/ip link set wlan0 up |
---|
60 | # post-up touch /etc/network/run/wlan0 |
---|
61 | # post-down /sbin/ip link set wlan0 down |
---|
62 | # post-down rm -f /etc/network/run/wlan0 |
---|
63 | |
---|
64 | auto wl0 |
---|
65 | iface wl0 inet manual |
---|
66 | pre-up /usr/sbin/pciunbind |
---|
67 | pre-up /usr/sbin/wlc ifname wl0 ap 1 |
---|
68 | pre-up /usr/sbin/wlc ifname wl0 channel 5 |
---|
69 | pre-up /usr/sbin/wlc ifname wl0 ssid DebWrt |
---|
70 | pre-up /usr/sbin/wlc ifname wl0 up |
---|
71 | pre-up /sbin/ip link set wl0 up |
---|
72 | post-up touch /etc/network/run/wl0 |
---|
73 | post-down /sbin/ip link set wl0 down |
---|
74 | post-down /usr/sbin/wlc ifname wl0 down |
---|
75 | post-down rm -f /etc/network/run/wl0 |
---|
76 | |
---|
77 | auto br-lan |
---|
78 | iface br-lan inet static |
---|
79 | bridge-ports lan wl0 |
---|
80 | bridge-stp off |
---|
81 | bridge-maxwait 0 |
---|
82 | address 192.168.1.1 |
---|
83 | netmask 255.255.255.0 |
---|
84 | post-up [ -f /etc/network/run/wl0 ] && \ |
---|
85 | start-stop-daemon --start \ |
---|
86 | --background \ |
---|
87 | --oknodo \ |
---|
88 | --quiet \ |
---|
89 | --pidfile /var/run/nas.wl0.pid \ |
---|
90 | --exec /usr/sbin/nas \ |
---|
91 | -- -P /var/run/nas.wl0.pid -H 34954 -l br-lan -i wl0 -A -m 128 -w 4 -g 3600 -k "debwrtdebwrt" -s DebWrt |
---|
92 | pre-down [ -f /etc/network/run/wl0 ] && \ |
---|
93 | start-stop-daemon --stop \ |
---|
94 | --signal HUP \ |
---|
95 | --pidfile /var/run/nas.wl0.pid \ |
---|
96 | --exec /usr/sbin/nas |
---|