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