Outils pour utilisateurs

Outils du site


maison2:configuration_open_wrt:installed

Ceci est une ancienne révision du document !


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 (remote_shell)

doit'on sauvegarder les pages sur le wiki , en ce moment ce doit être situé dans NET/WL500GP , a vérifier

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

configuer le bouton pour le wifi

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
                ;;

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

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 remote_shell

changer le login root pour plus de secu

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

a supprimé , prends trop de mémoire ,

repository SUBJECT name VersionDependsSectionSizeDescription
PACKAGEopensshopenssh-server 4.5p1-1 libopenssl, zlib net 195419 OpenSSH server OpenSSH server.
RELEASEopenssh 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.
RELEASEopenssh 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

se faire un initapp

–> utiliser le fichier de demrrage de webbif : system→startup

maison2/configuration_open_wrt/installed.1333576046.txt.gz · Dernière modification : 04/2012 de fred