LINKSYS wrt54gl: Porovnání verzí
Řádek 230: | Řádek 230: | ||
− | '''MAC filter''' | + | '''MAC filter ve skriptu s komentarem''' |
Nebavi te na WWW rozhrani RC5 zadavat stale dalsi a dalsi MAC adresy pripojenych stanic? Chybi ti tam moznost k MAC adrese si pripsat nejakou poznamku (napr. jmeno pripojence)? Chces pro vice linksysu mit centralni spravu MAC adres? Pak je tady pro tebe tento skript: | Nebavi te na WWW rozhrani RC5 zadavat stale dalsi a dalsi MAC adresy pripojenych stanic? Chybi ti tam moznost k MAC adrese si pripsat nejakou poznamku (napr. jmeno pripojence)? Chces pro vice linksysu mit centralni spravu MAC adres? Pak je tady pro tebe tento skript: | ||
Řádek 255: | Řádek 255: | ||
Skript se ulozi do linksyse pod jmenem /mac.list. Pri jeho pouzivani nedoporucuju pouzivat WWW rozhrani, nebot MAC adresa tamtudy pridana se pri pristim pouziti skriptu prepise. | Skript se ulozi do linksyse pod jmenem /mac.list. Pri jeho pouzivani nedoporucuju pouzivat WWW rozhrani, nebot MAC adresa tamtudy pridana se pri pristim pouziti skriptu prepise. | ||
+ | |||
+ | ''VojtaLhota'' | ||
+ | |||
+ | '''Mereni sily signalu od pripojenych stanic''' | ||
+ | root@Lhota3-vsesmer:/usr/bin# cat rssi | ||
+ | |||
+ | Je treba nainstalovat balicek wl: | ||
+ | |||
+ | ipkg install wl | ||
+ | |||
+ | A potom pouzit prikazy: | ||
+ | |||
+ | wl assoclist | ||
+ | wl rssi <MAC_adresa> | ||
+ | |||
+ | Nebo tento simple&stupid skript (/usr/bin/rssi): | ||
+ | |||
+ | #!/bin/sh | ||
+ | wl assoclist | while read a b; do echo -n "$b "; wl rssi $b; done | ||
+ | |||
+ | ''VojtaLhota'' |
Verze z 1. 9. 2006, 05:30
OpenWRT firmware Whiterussian RC4 do Linksyse WRT54GL najdete zde
OpenWRT firmware Whiterussian RC5 do Linksyse WRT54GL najdete zde
- Nahrava se pomoci WWW rozhrani primo v linksysu.
- Prihlaseni do original firmware je bez jmena a heslo je admin
- Defaultni IP je 192.168.1.1 (maska 255.255.255.0)
- Po prvnim prihlaseni (telnetem) je treba dat reboot, aby se zaktivoval filesystem
- Po prvnim rebootu si ihned zmente heslo (passwd), rebootnout AP a prihlasit se pres ssh (telnet se pak automaticky zablokuje).
- Toto heslo je zaroven heslem na www (uzivatel root)
- robocfg a wl (+jine utility) je treba dohrat jako balik pres zalozku system - installed software. Jako prvni je treba dat "Update package lists"
Přístup do linksyse (přes SSH) je možný pouze z LAN (4 porty) nebo z WLAN (radio). Pokud se do něj chcete dostat přes SSH i z WAN portu, je tčeba jít do souboru /etc/init.d/S45firewall:
(tenhle řádek tam je) iptables -A INPUT -i \! $WAN -j ACCEPT # allow from lan/wifi interfaces (tenhle přidejte) iptables -A INPUT -i $WAN -j ACCEPT # allow from wan interfaces
- Predelani linksyse na router co ma 5 sitovych ethernet karet (wifi zustava jedno)
- Nastaveni 5ti sitovek na jednotlive porty switche (vcetne WAN)
<bash> nvram set vlan0_ports="1 5*" nvram set vlan0_hwname="et0" nvram set vlan1_ports="4 5*" nvram set vlan1_hwname="et0" nvram set vlan2_ports="2 5*" nvram set vlan2_hwname="et0" nvram set vlan3_ports="3 5*" nvram set vlan3_hwname="et0" nvram set vlan4_ports="0 5*" nvram set vlan4_hwname="et0" nvram commit reboot
- Nastaveni portu 1 pro vlan0 je vyzadovano pro budouci mozny upgrade firmware.
- Upgrade fw nejde kdyz neni port 1 ve vlan0.
</bash>
Pak bude toto rozdeleni vlan0-> port3 vlan1-> wanport(internet) vlan2-> port2 vlan3-> port1 vlan4-> port4
- Aktivace zbyvajicich vlanu (defaultni jsou aktivni jen vlan0 a 1) je nutno provadet uz skriptem po kazdem bootu:
<bash> vconfig add eth0 2 #Pridat vlan2 k eth0 vconfig add eth0 3 #Pridat vlan3 k eth0 vconfig add eth0 4 #Pridat vlan4 k eth0
ifconfig vlan2 hw ether XX:XX:XX:XX:XX:02 #Nastavit mac adresu pro vlan2 ifconfig vlan3 hw ether XX:XX:XX:XX:XX:03 #Nastavit mac adresu pro vlan3 ifconfig vlan4 hw ether XX:XX:XX:XX:XX:04 #Nastavit mac adresu pro vlan4
ifconfig vlan0 xx.xx.xx.xx netmask xx.xx.xx.xx broadcast xx.xx.xx.xx up #Nastavit IP adresu pro vlan0 ifconfig vlan1 xx.xx.xx.xx netmask xx.xx.xx.xx broadcast xx.xx.xx.xx up #Nastavit IP adresu pro vlan1 ifconfig vlan2 xx.xx.xx.xx netmask xx.xx.xx.xx broadcast xx.xx.xx.xx up #Nastavit IP adresu pro vlan2 ifconfig vlan3 xx.xx.xx.xx netmask xx.xx.xx.xx broadcast xx.xx.xx.xx up #Nastavit IP adresu pro vlan3 ifconfig vlan4 xx.xx.xx.xx netmask xx.xx.xx.xx broadcast xx.xx.xx.xx up #Nastavit IP adresu pro vlan4 </bash>
- Nastaveni FD / HD / 10 / 100 pro jednotlive porty
- Pro nastavovani jednotlivych vystupu, je treba nainstalovat balik robocfg
- ipkg update
- nasledovne na www kliknout na install u prislusneho baliku
<bash> robocfg show #Zobrazit aktualni konfiguraci vsech portu robocfg port X media <auto|10HD|10FD|100HD|100FD> #Nastaveni modu portu robocfg port X mdi-x <auto|on|off> #Nastaveni Auto-Cross </bash>
- Nastavovani vystupniho vykonu radiove casti
- Pro nastavovani vykonu je treba nainstalovat balik wl pres web admina linksyse
- nastavovani vykonu probiha pomoci prikazu wl
<bash> wl curpower #Vypis vsech hodnot o vykonu wl txpwr X #X je v mW wl txpwr #bez parametru zobrazi aktualni nastaveni vykonu v mW </bash>
- Ukazka jak umi wrt54gl regulovat:
- Vetsi sloupec je wl txpwr 251 a ten mensi (zaregulovany) je wl txpwr 1
- na obrazku z netstumbleru je videt ze to umi regulovat v rozmezi ca 25db
- Drobne stripky z testovani HWAP Linksys:
BusyBox v1.00 (2005.11.23-21:46+0000) Built-in shell (ash) Enter 'help' for a list of built-in commands. _______ ________ __ | |.-----.-----.-----.| | | |.----.| |_ | - || _ | -__| || | | || _|| _| |_______|| __|_____|__|__||________||__| |____| |__| W I R E L E S S F R E E D O M WHITE RUSSIAN (RC4) ------------------------------- * 2 oz Vodka Mix the Vodka and Kahlua together * 1 oz Kahlua over ice, then float the cream or * 1/2oz cream milk on the top. --------------------------------------------------- root@OpenWrt:~#
root@OpenWrt:~# df Filesystem 1k-blocks Used Available Use% Mounted on /dev/root 3264 1884 1380 58% / none 7188 12 7176 0% /tmp
root@OpenWrt:/etc/quagga# free total used free shared buffers Mem: 14376 9136 5240 0 0 Swap: 0 0 0 Total: 14376 9136 5240
- ospf a zebra bezici na predelanem linksysu:
<bash> linksys-ospf> show ip ospf interface eth0 is up
OSPF not enabled on this interface
eth1 is up
OSPF not enabled on this interface
lo is up
OSPF not enabled on this interface
vlan0 is up
Internet Address 192.168.2.2/24, Broadcast 192.168.2.255, Area 0.0.0.0 Router ID 192.168.1.124, Network Type BROADCAST, Cost: 100 Transmit Delay is 1 sec, State Waiting, Priority 1 No designated router on this network No backup designated router on this network Timer intervals configured, Hello 15, Dead 40, Wait 40, Retransmit 5 Hello due in 00:00:02 Neighbor Count is 0, Adjacent neighbor count is 0
vlan1 is up
Internet Address 10.107.0.74/30, Broadcast 10.107.0.75, Area 0.0.0.0 Router ID 192.168.1.124, Network Type BROADCAST, Cost: 100 Transmit Delay is 1 sec, State Waiting, Priority 1 No designated router on this network No backup designated router on this network Timer intervals configured, Hello 15, Dead 40, Wait 40, Retransmit 5 Hello due in 00:00:02 Neighbor Count is 0, Adjacent neighbor count is 0
vlan2 is down
OSPF not enabled on this interface
vlan3 is up
Internet Address 192.168.1.124/24, Broadcast 192.168.1.255, Area 0.0.0.0 Router ID 192.168.1.124, Network Type BROADCAST, Cost: 10 Transmit Delay is 1 sec, State Waiting, Priority 1 No designated router on this network No backup designated router on this network Timer intervals configured, Hello 5, Dead 40, Wait 40, Retransmit 5 Hello due in 00:00:02 Neighbor Count is 0, Adjacent neighbor count is 0
vlan4 is down
OSPF not enabled on this interface
</bash> <bash> linksys-Zebra> show interface Interface eth0 is up, line protocol detection is disabled
index 2 metric 1 mtu 1500 <UP,BROADCAST,RUNNING,PROMISC,MULTICAST> HWaddr: 00:14:bf:ef:2c:b9
Interface eth1 is up, line protocol detection is disabled
index 3 metric 1 mtu 1500 <UP,BROADCAST,RUNNING,MULTICAST> HWaddr: 00:14:bf:ef:2c:b9 inet 10.107.99.1/27 broadcast 10.107.99.31
Interface lo is up, line protocol detection is disabled
index 1 metric 1 mtu 16436 <UP,LOOPBACK,RUNNING> inet 127.0.0.1/8
Interface vlan0 is up, line protocol detection is disabled
index 5 metric 1 mtu 1500 <UP,BROADCAST,RUNNING,MULTICAST> HWaddr: 00:14:bf:ef:2c:b9 inet 192.168.2.2/24 broadcast 192.168.2.255
Interface vlan1 is up, line protocol detection is disabled
index 6 metric 1 mtu 1500 <UP,BROADCAST,RUNNING,PROMISC,MULTICAST> HWaddr: 00:14:bf:ef:2c:ba inet 10.107.0.74/30 broadcast 10.107.0.75
Interface vlan2 is down
index 7 metric 1 mtu 1500 <BROADCAST,PROMISC,MULTICAST> HWaddr: 00:14:bf:ef:2c:bb
Interface vlan3 is up, line protocol detection is disabled
index 8 metric 1 mtu 1500 <UP,BROADCAST,RUNNING,PROMISC,MULTICAST> HWaddr: 00:14:bf:ef:2c:bc inet 192.168.1.124/24 broadcast 192.168.1.255
Interface vlan4 is down
index 9 metric 1 mtu 1500 <BROADCAST,PROMISC,MULTICAST> HWaddr: 00:14:bf:ef:2c:bd
</bash>
== Jak ozivit napul mrtvý WRT54GL ==
Kdyz uz je Linksys po zaruce a umrel nam treba po flashovani tak je treba k jeho oziveni ho kuchnout. Pozor pokud je jeste v zaruce, tak timto kuchnutim tu zaruku ztratis.
- Sundej gumove nozicky a vem plochy sroubovak. Nyni je treba ho zarazit do nozicky. Az to hlasite krupne (ne okolni plast, trosku s citem), tak je pripraveno k rozdelani. Toto u vsech 4 noh. Az se ti ho podari rozlousknout, tak pokracuj v nasledujicim bodu.
- Pokracujem tedy dal. Pin 16 u flash pameti vyzkratovat na zem, zapnout AP do elektriky. Nyni se vse rozsviti jako vanocni stromek. Cekej nez to vse pohasne. Nyni je Linksys ve flashovacim rezimu a ma ip 192.168.1.1 Pokud ne, tak je bud uplne spatnej, nebo si neco vynechal => zkus to vse znovu. Nyni pomoci tftp nahraj firmware: (nebo TFTP klient pro Windows)
<bash># tftp 192.168.1.1 > binary > trace > rexmt 1 > timeout 90 > put firmware.bin</bash>
- Ted bude blikat dioda POWER, Nesahat dokud neprestane blikat. Dle posledniho ozivovani to trvalo cca 10min. Az zhasne, tak mame flashnuto. Pokud ted nenapingas Linksys, tak je treba mu jeste smazat NVRAM.
- Smazani NVRAM: Vypni Linksyse,stiskni a drz tlacitko reset, zapni Linksys do elektriky. Dokud se nerozsviti DMZ drz reset, pak pust. Ted je NVRAM vycistena. Po zhasnuti DMZ by ses mel uz dostat telnetem na Linksys (192.168.1.1)
LAN/WAN, robocfg, ifconfig, porty a oznaceni na deklu
Ve vychozim stavu, po instalaci White Russian RC5:
web ifconfig port krabice LAN == br0 ( eth1 ------------------ WiFi ( vlan0 -- Port0,1,2,3 -- 4,3,2,1 WAN == vlan1 -------- Port4 -------- Internet
robocfg show
robocfg: oznaceni na krabici Port 0(W): 100FD enabled stp: none vlan: 0 mac: 00:00:00:00:00:00 4 \ Port 1(4): DOWN enabled stp: none vlan: 0 mac: 00:00:00:00:00:00 3 \ tyto 4 jsou Port 2(3): DOWN enabled stp: none vlan: 0 mac: 00:00:00:00:00:00 2 / vedle sebe Port 3(2): DOWN enabled stp: none vlan: 0 mac: 00:00:00:00:00:00 1 / Port 4(1): DOWN enabled stp: none vlan: 1 mac: 00:00:00:00:00:00 Internet Port 5(C): 100FD enabled stp: none vlan: 0 mac: 00:00:00:00:00:00 (zadne - to vede dovnitr)
MAC filter ve skriptu s komentarem
Nebavi te na WWW rozhrani RC5 zadavat stale dalsi a dalsi MAC adresy pripojenych stanic? Chybi ti tam moznost k MAC adrese si pripsat nejakou poznamku (napr. jmeno pripojence)? Chces pro vice linksysu mit centralni spravu MAC adres? Pak je tady pro tebe tento skript:
#!/bin/sh # # Skript pro MAC filtr, Linksys WRT54GL, firmware White Russian RC5 # VojtaLhota <vojta@lhota.hkfree.org> 9/2005 # [ -d /tmp/.webif ] || mkdir /tmp/.webif cat $0 | grep -i ^[0-9A-F][0-9A-F]: |\ sort |\ awk -- '{maclist= maclist $1 " "} END {print "wl0_maclist=\"" maclist "\""}' > /tmp/.webif/config-wireless sh /usr/lib/webif/apply.sh exit # # Sem se zapisuej povolene MAC adresy, jedna na radek. Za adresou muze byt # jakykoliv komentar. Po zmenach je tento soubor treba spustit # v prikazove radce: ./mac.list # 00:90:4B:AA:69:5E # ID 1547, IP 10.107.8.48, Josef Skocdopole 00:90:4B:AA:69:1E # IP 304, IP 10.107.8.55-9, Jarda Plech
Skript se ulozi do linksyse pod jmenem /mac.list. Pri jeho pouzivani nedoporucuju pouzivat WWW rozhrani, nebot MAC adresa tamtudy pridana se pri pristim pouziti skriptu prepise.
VojtaLhota
Mereni sily signalu od pripojenych stanic root@Lhota3-vsesmer:/usr/bin# cat rssi
Je treba nainstalovat balicek wl:
ipkg install wl
A potom pouzit prikazy:
wl assoclist wl rssi <MAC_adresa>
Nebo tento simple&stupid skript (/usr/bin/rssi):
#!/bin/sh wl assoclist | while read a b; do echo -n "$b "; wl rssi $b; done
VojtaLhota