juste apres avoir falshé xxx.trx ====== LAN configuration ====== etc/config/network config interface lan option type bridge option ifname "eth0.0" option proto static option ipaddr 192.168.0.1 option netmask 255.255.255.0 option gateway 192.168.0.254 option dns 80.118.192.111 ====== X - WRT ====== root@OpenWrt:/etc# vi ipkg.conf src release http://downloads.openwrt.org/kamikaze/7.09/brcm-2.4/packages src packages http://downloads.openwrt.org/kamikaze/7.09/packages/mipsel <=============ligne a changer (+7.09) dest root / dest ram /tmp src X-Wrt http://downloads.x-wrt.org/xwrt/kamikaze/7.09/brcm-2.4/packages <=============ligne a ajouter ============ #ipkg update #ipkg install webif par webif ... config 'timezone' 'timezone' config_set 'timezone' 'posixtz' 'CET-1CEST,M3.5.0,M10.5.0/3' config_set 'timezone' 'zoneinfo' 'Europe/Paris' Installing NTPCLIENT buuton ajouter le serveur NTP : "fr.pool.ntp.org" actived le wifi config_set 'wl0' 'disabled' '0' config_set 'cfg2' 'hidden' '0' config_set 'cfg2' 'isolate' '0' config_set 'cfg2' 'bgscan' '0' config_set 'cfg2' 'wds' '0' config_set 'wl0' 'channel' '2' ====== interface web embarqué ====== en utilisant web if comment la page command ([[maison2:configuration_open_wrt:remote_shell]]) ====== vsftpd ====== #ipkg install vsftpd ============================================== === - vsftpd.conf 1/18 5% == ============================================== background=YES listen=YES anonymous_enable=NO local_enable=YES write_enable=YES local_umask=022 check_shell=NO #dirmessage_enable=YES ftpd_banner=Welcome to blah FTP service. secure_chroot_dir=/var/run <=============ligne a ajouter session_support=NO #syslog_enable=YES #userlist_enable=YES #userlist_deny=NO #userlist_file=/etc/vsftpd.users #xferlog_enable=YES #xferlog_file=/var/log/vsftpd.log #xferlog_std_format=YES ====== NTP ====== root@OpenWrt:~# date * reset sans cable reseau : activation console COM1 :date :Sat Jan 1 01:00:41 CET 2000 * puis branchement cable reseau : Sat Jan 1 01:01:41 CET 2000 * attente 5 minutes : Sat Jan 1 01:06:41 CET 2000 * connection ssh : Sat Jan 1 01:07:40 CET 2000 la meme chose apres installation de openntpd * reset sans cable reseau : activation console COM1 :date :Sat Jan 1 01:00:41 CET 2000 * puis branchement cable reseau : Sat Jan 1 01:01:41 CET 2000 * attente 5 secondes : Wed Apr 14 22:55:51 CEST 2010 ===== Synchroniser via NTP l’horloge du routeur ===== Par défaut, le routeur ne synchronise pas son horloge, il est donc nécessaire de lui ajouter un démon NTP qui est disponible dans le package openntpd. Par défaut, ce package synchronise le temps avec le pool de serveurs pool.ntp.org. Il est tout d’abord nécessaire de définir le fuseau horaire, (ici pour la France, voir le wiki d’OpenWRT pour d’autres localisations) : root@wrt-paris:~# echo "CET-1CEST-2,M3.5.0/02:00:00,M10.5.0/03:00:00" > /etc/TZ (deja fait par webif , mais on peut verifer par un cat /etc/TZ) Ensuite, il faut installer openntpd : root@wrt-paris:~# ipkg install openntpd Puis redémarrer le routeur. Sep 28 13:51:30 abu ntpd[4100]: adjtime failed: Invalid argument The problem is that your clock seems to be off by about 2 hours, and the kernel doesn't allow adjusting a clock which such big offset because it'll just take too long. What you can do is: - Edit the /etc/default/openntpd file and uncomment the line: #DAEMON_OPTS="-s" So that it reads DAEMON_OPTS="-s" This will set the clock correctly once at startup. - Use some other means of setting your clock correct, like running ntpdate. ====== prolific serial to usb interface ====== http://wiki.openwrt.org/inbox/howto/install-usb-support Installing kmod-usb-serial-pl2303 (2.4.34-brcm-1) to root... Downloading http://downloads.x-wrt.org/xwrt/kamikaze/7.09/brcm-2.4/packages/./kmod-usb-serial-pl2303_2.4.34-brcm-1_mipsel.ipk Installing kmod-usb-serial (2.4.34-brcm-1) to root... Downloading http://downloads.x-wrt.org/xwrt/kamikaze/7.09/brcm-2.4/packages/./kmod-usb-serial_2.4.34-brcm-1_mipsel.ipk Configuring kmod-usb-serial Configuring kmod-usb-serial-pl2303 Done. Installing kmod-usb-uhci (2.4.34-brcm-1) to root... Downloading http://downloads.x-wrt.org/xwrt/kamikaze/7.09/brcm-2.4/packages/./kmod-usb-uhci_2.4.34-brcm-1_mipsel.ipk Configuring kmod-usb-uhci Done. PCI: Enabling device 01:03.0 (0000 -> 0001) uhci.c: USB UHCI at I/O 0x100, IRQ 2 usb.c: new USB bus registered, assigned bus number 2 hub.c: USB hub found hub.c: 2 ports detected PCI: Enabling device 01:03.1 (0000 -> 0001) uhci.c: USB UHCI at I/O 0x120, IRQ 2 usb.c: new USB bus registered, assigned bus number 3 hub.c: USB hub found hub.c: 2 ports detected hub.c: new USB device 01:03.0-1, assigned address 2 usbserial.c: PL-2303 converter detected usbserial.c: PL-2303 converter now attached to ttyUSB0 (or usb/tts/0 for devfs) hub.c: new USB device 01:03.0-2, assigned address 3 usbserial.c: PL-2303 converter detected usbserial.c: PL-2303 converter now attached to ttyUSB1 (or usb/tts/1 for devfs) root@OpenWrt:/dev/usb/tts# ls 0 1 ====== OWFS ====== [[maison2:configuration_open_wrt:OWFS]] ====== se faire un initapp ====== --> utiliser le fichier de demrrage de webbif : system->startup ====== dyndns ====== installer updatedd et updatedd-mod-ovh petit script activer au demarrage : #!/bin/sh registered="0.0.0.0" max_days=10 # max number of days to go without forcing an update last_update=`date +%s` max_seconds=`expr $max_days*24*60*60` while :; do current=$(wget -O - http://checkip.dyndns.org|sed s/[^0-9.]//g) if [ $(($last_update+$max_seconds)) -lt `date +%s` ] then # set old_ip to be different, forcing an update registered="0.0.0.0" fi if [ "$current" != "$registered" ] then updatedd ovh -- --ipv4 $current user:psw public_URL registered=$current last_update=`date +%s` fi sleep 300 done ce script plante de temps en temps en restant planté sur le wget __lien de support :__ * http://kubuntu.free.fr/wiki/?page=OpenWrt_backfire a regarder pour WOL et updatedd * http://lermit-informatique.blogspot.fr/2009/08/ovh-le-dynhost-de-ovh-et-updatedd.html ===== Mettre à jour dynhost (ovh) en php ===== $credentials = "identifiantdynhost:motdepasseovh"; $url = "http://www.ovh.com/nic/update?system=dyndns&hostname=nomdedomaine&myip=ip"; $headers = array( "User-Agent: ipcheck/0.67", "Authorization: Basic " . base64_encode($credentials)); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 60); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $data = curl_exec($ch); if (curl_errno($ch)) print "Error: " . curl_error($ch); echo $data; //variante dans un genre de shell # Update DynDNS with the new IP :set DynDNSUrl ("http://".$DynDNSUsername.":".$DynDNSPassword."@".$DynDNSServiceProvider." /nic/update?system=dyndns&hostname=".$DynDNSHostname."&myip=".$CurrentPublicIP."&wildcard=no"); /tool fetch url=$DynDNSUrl dst-path="/dyndns.txt"; [[http://sourceforge.net/projects/gnuwin32/files/wget/1.11.4-1/wget-1.11.4-1-setup.exe/download?use_mirror=heanet|wget pour windows]] solution pour papa ====== configuer le bouton pour le wifi sur le WL500GP (non utilisé) ====== BUTTON Event RESTORE reset EZSETUP ses mkdir -p /etc/hotplug.d/button wget -O /etc/hotplug.d/button/01-wifitoggle "http://wiki.openwrt.org/OpenWrtDocs/Customizing/Software/WifiToggle?action=AttachFile&do=get&target=wifitoggle.hotplug1" wget -O /etc/config/wifitoggle "http://wiki.openwrt.org/OpenWrtDocs/Customizing/Software/WifiToggle?action=AttachFile&do=get&target=wifitoggle.config1" * en kamikaze7.08 : uci set wifitoggle.cfg1.button=ses * en kamikaze8.09 : voir la nouvelle procédure ... [[maison2:configuration_open_wrt:kamikaze_8_09_rc1]] uci commit wifitoggle dans /etc/hotplug.d/button/01-wifitoggle modifier local section="cfg1" par si kamikaze 8.09 local section="cfg022c70" rajouter dans case "$WIFI_RADIOSTATUS" in 0|"") uci_set "wireless" "$section" "disabled" "1" uci_commit "wireless" echo 0 >> /proc/diag/led/power <=============ligne a ajouter wifi ;; 1) uci_set "wireless" "$section" "disabled" "0" uci_commit "wireless" echo 1 >> /proc/diag/led/power <=============ligne a ajouter wifi ;; ====== recativer le telnet (obsolète) ====== modifier /etc/init.d/telnet root@OpenWrt:/etc/init.d# vi telnet #!/bin/sh /etc/rc.common # Copyright (C) 2006 OpenWrt.org START=50 start() { if [ \! -f /etc/passwd ] || \ <=============ligne a suprimer awk -F: '/^root:/ && ($2 != "") && ($2 !~ /\!/) {exit 1}' /etc/passwd 2>/dev/null || \ <=============ligne a suprimer [ \! -x /usr/sbin/dropbear ] <=============ligne a suprimer then \ <=============ligne a suprimer telnetd -l /bin/login fi <=============ligne a suprimer } stop() { killall telnetd } modifier /bin/login #!/bin/sh # Copyright (C) 2006 OpenWrt.org grep '^root:[^!]' /etc/passwd >&- 2>&- <=============ligne a suprimer [ "$?" = "0" -a -z "$FAILSAFE" ] && <=============ligne a suprimer { <=============ligne a suprimer echo "Login failed." <=============ligne a suprimer exit 0 <=============ligne a suprimer } || { <=============ligne a suprimer cat << EOF <=============ligne a suprimer === IMPORTANT ============================ <=============ligne a suprimer Use 'passwd' to set your login password <=============ligne a suprimer this will disable telnet and enable SSH <=============ligne a suprimer ------------------------------------------ <=============ligne a suprimer EOF <=============ligne a suprimer } <=============ligne a suprimer exec /bin/ash --login afin d'accéder en shell de l'exterieur on utilisera [[maison2:configuration_open_wrt:remote_shell]] ====== changer le login root pour plus de secu (non utilisé) ====== en fait il n'est pas possible d'ajouter d'autres utilisateurs. donc pour accéder d'un site distant on utilisera un telnet like ou la procedure de login n'utilise pas la password root ... ====== OPEN SSH (non utilisé) ====== a supprimé , prends trop de mémoire , | **repository** | **SUBJECT** | **name** |**Version**|**Depends**|**Section**|**Size**|**Description**^ |PACKAGE|openssh^openssh-server | 4.5p1-1 | libopenssl, zlib | net |195419| OpenSSH server OpenSSH server. | |RELEASE|openssh^ libopenssl | 0.9.8e-1 | zlib | libs |472517| Open source SSL toolkit (libraries) The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a full-strength general purpose cryptography library. This package contains the OpenSSL shared libraries, needed by other programs. | |RELEASE|openssh^ zlib | 1.2.3-4 | | libs |35787| Library implementing the deflate compression method | 703ko! root@OpenWrt:/etc/ssh# ssh-keygen -t rsa1 -N "" -b 1024 Generating public/private rsa1 key pair. Enter file in which to save the key (/tmp/.ssh/identity): ssh_host_key Your identification has been saved in ssh_host_key. Your public key has been saved in ssh_host_key.pub. The key fingerprint is: fe:d2:2d:42:d7:bd:df:0b:65:bb:1a:c3:32:92:e2:82 root@OpenWrt root@OpenWrt:/etc/ssh# /usr/sbin/sshd Missing privilege separation directory: /var/empty root@OpenWrt:/etc/ssh#mkdir /var/empty root@OpenWrt:/etc/ssh#/usr/sbin/sshd # /etc/init.d/sshd start ====== installation du disque usb externe (non utilisé)====== j'ai formaté le disque USB en FAT32 pour qu'il soit reconnu sous Windows et linux. Pour faire ceci sur un disque de 500Go il faut passer par l'utilitaire [[http://www.ridgecrop.demon.co.uk/index.htm?fat32format.htm|fat32format.exe]] parceque windows refuse de le faire. G:\cdrom_install_div\cd_install>fat32format d: Warning ALL data on drive 'd' will be lost irretrievably, are you sure (y/n) :y Size : 500GB 976768002 sectors 512 Bytes Per Sector, Cluster size 32768 bytes Volume ID is 1edf:1b4b 32 Reserved Sectors, 119206 Sectors per FAT, 2 fats 15258274 Total clusters 15258273 Free Clusters Formatting drive d:... Clearing out 238508 sectors for Reserved sectors, fats and root cluster... Wrote 122116096 bytes in 4.99503 seconds, 24447496.327525 bytes/sec Initialising reserved sectors and FATs... Done l'installation proprement dite ipkg install kmod-usb2 insmod usbcore insmod ehci-hcd ipkg install kmod-usb-storage ipkg install kmod-fs-vfat ipkg install fdisk df -h Filesystem Size Used Available Use% Mounted on none 14.9M 32.0k 14.9M 0% /tmp /dev/mtdblock/4 6.0M 1.9M 4.1M 31% /jffs mini_fo:/jffs 1.2M 1.2M 0 100% / connexion du disque root@OpenWrt:/# hub.c: new USB device 01:03.2-1, assigned address 2 scsi0 : SCSI emulation for USB Mass Storage devices Vendor: WD Model: 5000AAV External Rev: 1.65 Type: Direct-Access ANSI SCSI revision: 02 Attached scsi disk sda at scsi0, channel 0, id 0, lun 0 SCSI device sda: 976773168 512-byte hdwr sectors (500108 MB) Partition check: /dev/scsi/host0/bus0/target0/lun0: p1 fdisk -l Device Boot Start End Blocks Id System /dev/scsi/host1/bus0/target0/lun0/part1 1 60801 488384001 c W95 FAT32 (LBA) a mettre dans dans /etc/init.d/done mount /dev/scsi/host1/bus0/target0/lun0/part1 /mnt_usb_stick <=== port USB le plus haut mount /dev/scsi/host0/bus0/target0/lun0/part1 /mnt_usb_stick <=== port USB le plus bas [[http://forum.openwrt.org/viewtopic.php?id=17424| ntfs-3g is working on Wl-500g Premium kernel 2.4 by MoD ]] ====== samba ====== ipkg install samba-server /etc/hosts 27.0.0.1 localhost. 192.168.0.1 openwrt <================ à ajouter to start : /etc/init.d/samba start a mettre dans /etc/init.d/done /etc/samba/smb.conf [global] syslog = 0 syslog only = yes workgroup = GBA <================== modifié server string = OpenWrt Samba Server security = share encrypt passwords = yes guest account = nobody local master = yes name resolve order = lmhosts hosts bcast [HDD500] comment = /mnt_usb_stick path = /mnt_usb_stick browseable = yes public = yes writeable = yes [tmp] comment = /tmp path = /tmp browseable = yes public = yes writeable = no