OpenWrt Kamikaze v8.09.2 on ASUS WL-HDD2.5 running PPPoE over br-lan
由於手邊沒有La Fonera, 所以只剩ASUS WL-HDD2.5 可供實驗, 由於先前已經變磚過一次, 所以這次特別小心
雖然ASUS WL-HDD2.5 的network 組態有 "switch" 一項, 但小弟尚未搞懂, 所以只沿用前面採用過的的旁門左道
[B]/etc/config/network[/B]:
[CODE][FONT="細明體"]config 'switch' 'eth0'
option 'vlan0' '1 2 3 4 5*'
option 'vlan1' '0 5'
config 'interface' 'loopback'
option 'ifname' 'lo'
option 'proto' 'static'
option 'ipaddr' '127.0.0.1'
option 'netmask' '255.0.0.0'
config 'interface' 'lan'
option 'type' 'bridge'
option 'ifname' 'eth1'
option 'proto' 'static'
option 'ipaddr' '192.168.1.1'
option 'netmask' '255.255.255.0'
config 'interface' 'wan'
option 'ifname' 'br-lan'
option 'proto' 'pppoe'
option 'username' '[email protected]'
option 'password' 'PASSWORD'
option 'keepalive' '3'
option 'defaultroute' '1'
option 'ppp_redial' 'persist'
option 'persist'
#In case you brick your router
config 'alias'
option 'interface' 'wan'
option 'proto' 'static'
option 'ipaddr' '169.254.255.1'
option 'netmask' '255.255.0.0'[/FONT][/CODE]
[B]/etc/init.d/custom-user-startup[/B]:
[CODE][FONT="細明體"]#!/bin/sh /etc/rc.common
START=98
start() {
ifup wan
wifi up
ifconfig br-lan 192.168.1.1 netmask 255.255.255.0
}[/FONT][/CODE]
輸入完畢請執行:
[CODE][FONT="細明體"]chmod +x /etc/init.d/custom-user-startup
/etc/init.d/custom-user-startup enable
/etc/init.d/custom-user-startup start[/FONT][/CODE]
以上指令會產生 /etc/rc.d/S98custom-user-startup
重啟之後檢查結果:
[CODE][FONT="細明體"]root@OpenWrt:~# route ; brctl show
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
xxx.xx.xx.xxx * 255.255.255.255 UH 0 0 0 ppp0
192.168.1.0 * 255.255.255.0 U 0 0 0 br-lan
169.254.0.0 * 255.255.0.0 U 0 0 0 br-lan
default hxxx.sxx.xx.hin 0.0.0.0 UG 0 0 0 ppp0
bridge name bridge id STP enabled interfaces
br-lan 8000.0015f2aabbcc no eth1
wl0[/FONT][/CODE]