RouterboardRB500Linux
Verze z 21. 3. 2007, 21:44, kterou vytvořil 10.107.2.91 (diskuse)
Nejzajimavejsi je skript /etc/init.d/setnet ktery jsem uzpusobil na kompletni fungovani routerboardu jako AP Bridge
<bash> start() {
echo -n $"Starting Networking: " modprobe ath_pci outdoor=1 countrycode=276
#loopback interfacy ip l s up dev lo ip a a 127.0.0.1/8 dev lo
- ip l s up dev dummy0
- ip a a 10.x.0.z/32 dev dummy0
#ethernet
- ip l s up dev eth2
- ip a a 192.168.0.1/24 dev eth2
#wifi /usr/local/bin/wlanconfig ath0 destroy /usr/local/bin/wlanconfig ath1 destroy /usr/local/bin/wlanconfig ath0 create wlandev wifi0 wlanmode ap ip l s up dev ath0 iwconfig ath0 essid "spar2.hkfree.net" iwpriv ath0 mode 1 iwconfig ath0 rate auto /usr/local/bin/athctrl ath0 -d 8000 iwconfig ath0 channel 100
- iwconfig ath0 txpower 2
/usr/local/bin/wlanconfig ath1 create wlandev wifi1 wlanmode ap ip l s up dev ath1 iwconfig ath1 essid "spar2.hkfree.org" iwpriv ath1 mode 1 iwconfig ath1 rate auto /usr/local/bin/athctrl ath1 -d 8000 iwconfig ath1 channel 100
- iwconfig ath1 txpower 2
#nastavit mac filtr na jen povolene MACy iwpriv ath0 maccmd 1 iwpriv ath0 maccmd 2
#Nahodit bridge brctl addbr br0 brctl addif br0 eth0 brctl addif br0 eth1 brctl addif br0 ath1 brctl addif br0 eth2 brctl addif br0 ath0
ifconfig eth0 up ifconfig eth1 up ifconfig eth2 up ifconfig ath1 up ifconfig ath1 up ifconfig br0 up ifconfig br1 10.107.2.92 netmask 255.255.255.248 broadcast 10.107.2.95 up #povol routovani echo "1" > /proc/sys/net/ipv4/ip_forward
#povol source routing echo "1" > /proc/sys/net/ipv4/conf/all/accept_source_route #vypni rp-filter echo "0" > /proc/sys/net/ipv4/conf/all/rp_filter
#default route ip r a default via 10.107.2.89
#nastav cas ze site rdate -s 10.15.0.1
return $RETVAL
}
</bash>
Mac adresy do seznamu povolenych se pridavaji takto: <bash> iwpriv ath0 addmac 11:22:33:44:55:66 </bash>