les drivers ethernet ne sont pas présent dans l'image de base openwrt.
il faut donc installer kmod-via-rhine sans carte réseau :)
téléchargez les là: [http://downloads.openwrt.org/kamikaze/8.09/x86/packages/kmod-via-rhine_2.6.25.17-x86-1_i386.ipk] ( pour kamikaze 8.09) il faut ensuite copier le .ipk sur la CompactFlash et à l'aide d'un cable série les installer
#ipkg kmod-via-rhine_2.6.25.17-x86-1_i386.ipk
soit compiler à l'aide du target “alix” présent dans la version svn actuelle. afin que les drivers soient déja présent dans l'image.
télecharger une image recente soit la stable de openwrt:
wget http://downloads.openwrt.org/kamikaze/8.09.1/x86/openwrt-x86-ext2.image
Inserez votre compact flash (vérifier qu'elle ne s'est pas montée au démarrage ( #mount )) ensuite écrivez l'image à l'aide de la commande “dd”.
#dd if=openwrt-x86-ext2.image of=/dev/sdx
adaptez sdx en fonction de votre système une fois terminé il est temps d'inserer la carte et de mettre la machine sous tension.
pour y acceder la première fois c'est en telnet (il faut bien sùr savoir préalablement configurer une interface en 192.168.1.[2-254] )
#ifconfig eth0:0 192.168.1.23 & telnet 192.168.1.1
vous voila loggé, !!avant toute chose n'oubliez pas d'attribuer un mot passe lors de la première connection en telnet.
root@OpenWrt:/# passwd Changing password for root New password: Bad password: too weak Retype password: Password for root changed by root
installer les modules madwifi
#ipkg update && ipkg install kmod-madwifi
les fichiers de config se trouvent dans /etc/config/
/etc/config/network
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 ifname 'eth0'
option proto 'static'
option ipaddr '192.168.0.16'
option netmask '255.255.255.0'
option gateway '192.168.0.134'
option dns '4.2.2.2'
#
#
config "interface" "lan1"
option ifname 'eth1'
option proto 'static'
option ipaddr '10.93.0.65'
option netmask '255.255.255.224'
#
#### Wireless configuration
config interface wlan
option ifname ath0
option proto static
option ipaddr 10.93.0.98
option netmask 255.255.255.224
on peut également les manipuler avec la commande uci
root@rmolen5g:~# uci show network network.loopback=interface network.loopback.ifname=lo network.loopback.proto=static network.loopback.ipaddr=127.0.0.1 network.loopback.netmask=255.0.0.0 network.lan=interface network.lan.ifname=eth0 network.lan.proto=static network.lan.ipaddr=192.168.0.16 network.lan.netmask=255.255.255.0 network.lan.gateway=192.168.0.134 network.lan.dns=4.2.2.2 network.lan1=interface network.lan1.ifname=eth1 network.lan1.proto=static network.lan1.ipaddr=10.93.0.65 network.lan1.netmask=255.255.255.224 network.wlan=interface network.wlan.ifname=ath0 network.wlan.proto=static network.wlan.ipaddr=10.93.0.98 network.wlan.netmask=255.255.255.224
configurer le wireless
avec une atheros
nous utiliseront le mode ahdemo pour etre compatible avec les wrt flashé en freifunk
exemple de fichiers de config ( éditez /etc/config/wireless)
vi /etc/config/wireless
config wifi-device wifi0
option type atheros
option channel 1
option agmode 11b
option diversity 0
option txantenna 1
option rxantenna 1
config wifi-iface
option device wifi0
option network wlan
option mode ahdemo
option ssid bombolong
option hidden 0
option txpower 16
option encryption none
option bssid ca:fe:ca:fe:ca:fe
astuce 5ghz rajouter le country code dans le fichiers /etc/modules.d/50-madwifi
ath_pci countrycode=56
astuce: avec atheros et le mode 11a l' option distance est importante.
exemple de fichiers de config ( qui se trouve dans /etc/config/wireless)
config wifi-device wifi0
option type atheros
option country 56
option channel 140
option disabled 0
option distance 3000
option agmode 11a
option diversity 0
option txantenna 1
option rxantenna 1
config wifi-iface
option device wifi0
option network wlan
option mode sta
option ssid josaphatmaster
et vu par uci
root@rmolen5g:~# uci show wireless wireless.wifi0=wifi-device wireless.wifi0.type=atheros wireless.wifi0.country=56 wireless.wifi0.channel=140 wireless.wifi0.disabled=0 wireless.wifi0.distance=3000 wireless.wifi0.agmode=11a wireless.wifi0.diversity=0 wireless.wifi0.txantenna=1 wireless.wifi0.rxantenna=1 wireless.cfg2=wifi-iface wireless.cfg2.device=wifi0 wireless.cfg2.mode=sta wireless.cfg2.ssid=josaphatmaster
avec une mini-pci type prism
…
/etc/config/firewall
config 'defaults'
option 'syn_flood' '1'
option 'input' 'ACCEPT'
option 'output' 'ACCEPT'
option 'forward' 'REJECT'
option 'drop_invalid' '0'
#definir les zones
config 'zone'
option 'name' 'lan'
option 'input' 'ACCEPT'
option 'output' 'ACCEPT'
option 'forward' 'REJECT'
config 'zone'
option 'name' 'wan'
option 'input' 'REJECT'
option 'output' 'ACCEPT'
option 'forward' 'REJECT'
option 'masq' '1'
option 'mtu_fix' '1'
config 'zone'
option 'name' 'wlan'
option 'input' 'REJECT'
option 'output' 'ACCEPT'
option 'forward' 'REJECT'
option 'masq' '1'
# règles de forward
config 'forwarding'
option 'src' 'lan'
option 'dest' 'wan'
config 'forwarding'
option 'src' 'lan'
option 'dest' 'wlan'
#pour ouvrir certains ports
config 'rule'
option 'src' 'wan'
option 'proto' 'udp'
option 'dest_port' '68'
option 'target' 'ACCEPT'
config 'rule'
option 'src' 'wan'
option 'proto' 'icmp'
option 'icmp_type' 'echo-request'
option 'target' 'ACCEPT'
config 'include'
option 'path' '/etc/firewall.user'
ipkg update ipkg install olsrd olsrd-mod-bmf olsrd-mod-dot-draw olsrd-mod-dyn-gw olsrd-mod-httpinfo olsrd-mod-nameservice
/etc/config/olsr
config 'olsrd'
option 'IpVersion' '4'
option 'FIBMetric' 'flat'
option 'LinkQualityAlgorithm' 'etx_ff'
option 'NatThreshold' '0.75'
config 'LoadPlugin'
option 'library' 'olsrd_dyn_gw_plain.so.0.4'
config 'LoadPlugin'
option 'library' 'olsrd_nameservice.so.0.3'
option 'hosts_file' '/var/etc/hosts.olsr'
option 'suffix' '.rc'
config 'LoadPlugin'
option 'library' 'olsrd_txtinfo.so.0.1'
option 'accept' '127.0.0.1'
config 'Interface'
option 'ignore' '0'
option 'interface' 'wlan'
option 'Ip4Broadcast' '255.255.255.255'
une fois le fichier configuré vous pouvez activer olsr au demarage avec la commande suivante
#/etc/init.d/olsrd enable
#ipkg update && ipkg install kmod-ipv6 radvd ip kmod-ip6tables ip6tables
page d'origine: http://www.e-bulles.be/bubble/Kamikaze derniere mise à jour:20 janvier 2011 David Kowalkowski