Bonjour,
Mon problème est le suivant :
Je veux faire de mon raspberry un serveur web basique et je veux le mettre en
Ip fixe.
Raspberry sous Os Raspian, ssh activé sur le port 46
Si Raspberry en DHCP dans /etc/network/interfaces alors connexion ssh fonctionne ssh pi@192.168.0.51 -p 46
Que l'IP réservée sur la freebox soit à l'intérieur ou en dehors de la plage DHCP, si le Raspberry est en DHCP, ça fonctionne
J'ai une freebox, j'ai attribué une ip fixe au raspberry hors de la plage Dhcp
192.168.0.51
J'ai suivi et trouvé différents tutos :
http://hawkcreation.com/raspberry-pi-in … miers-pas/http://blog.idleman.fr/raspberry-pi-19- … s-astuces/https://www.modmypi.com/blog/tutorial-h … ip-addresshttp://cpalui.free.fr/index.php?post/20 … spberry-PiJ'ai donc édité le /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
adress 192.168.0.51
gateway 192.168.0.254
netmask 255.255.255.0
network 192.168.0.0
dns-nameservers 192.168.0.51 192.168.0.254
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
Alors qu'en le laissant en DHCP, je peux communiquer avec en ssh, quand je le mets en ip fixe, il n'est pas sur le réseau.
gaby@wheezy:~$ ssh -p 46 pi@192.168.0.51
pi@192.168.0.51's password:
Linux raspberrypi 3.6.11+ #538 PREEMPT Fri Aug 30 20:42:08 BST 2013 armv6l
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sat Oct 19 15:06:22 2013 from 192.168.0.40
pi@raspberrypi ~ $ ifconfig
eth0 Link encap:Ethernet HWaddr b8:27:eb:db:d2:36
inet adr:192.168.0.51 Bcast:192.168.0.255 Masque:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:85 errors:0 dropped:0 overruns:0 frame:0
TX packets:71 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
RX bytes:8321 (8.1 KiB) TX bytes:8837 (8.6 KiB)
lo Link encap:Boucle locale
inet adr:127.0.0.1 Masque:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
pi@raspberrypi ~ $ netstat -nr
Table de routage IP du noyau
Destination Passerelle Genmask Indic MSS Fenêtre irtt Iface
0.0.0.0 192.168.0.254 0.0.0.0 UG 0 0 0 eth0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
pi@raspberrypi ~ $ sudo nano /etc/network/interfaces
Utilisez « fg » pour revenir à nano.
[1]+ Stoppé sudo nano /etc/network/interfaces
pi@raspberrypi ~ $ sudo nano /etc/network/interfaces
pi@raspberrypi ~ $ sudo nano /etc/hosts
pi@raspberrypi ~ $ sudo nano /etc/resolv.conf
pi@raspberrypi ~ $ sudo reboot
Broadcast message from root@raspberrypi (pts/0) (Mon Oct 21 10:19:31 2013):
The system is going down for reboot NOW!
pi@raspberrypi ~ $ Connection to 192.168.0.51 closed by remote host.
Connection to 192.168.0.51 closed.
gaby@wheezy:~$ ssh -p 46 pi@192.168.0.51
ssh: connect to host 192.168.0.51 port 46: No route to host
gaby@wheezy:~$ ssh -p 46 pi@192.168.0.51
ssh: connect to host 192.168.0.51 port 46: No route to host
gaby@wheezy:~$ ssh -p 46 pi@192.168.0.51
ssh: connect to host 192.168.0.51 port 46: No route to host
Ca a pas l'air de marcher. J'ai un peu tout essayé : mais j'ai un No route to host...
Changer de /etc/network/interfaces
le /etc/hosts
J'ai bien récupéré les bonnes infos et voici le dernier /etc/network/interfaces
auto lo
iface lo inet loopback
#auto eth0
iface eth0 inet static
adress 192.168.0.51
gateway 192.168.0.254
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
#dns-nameservers 192.168.0.51 192.168.0.254
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
127.0.0.1 localhost
#::1 localhost ip6-localhost ip6-loopback
#fe00::0 ip6-localnet
#ff00::0 ip6-mcastprefix
#ff02::1 ip6-allnodes
#ff02::2 ip6-allrouters
127.0.1.1 raspberrypi
#192.168.0.51 raspberrypi
J'ai aussi essayé en mettant le hosts 192.168.0.51 raspberrypi mais ça marche pas non plus
le etc/resolv.conf
nameserver 192.168.0.254
nameserver 192.168.0.51
le etc/hostname
Je comprends pas, ça marche bien en DHCP mais pas en static.
Je contrôle la freebox, le raspberry n'est pas sur le réseau comme si la machine était éteinte.
Je pourrais rester en DHCP puisque j'ai une adresse fixe configurée sur la freebox. Je redirigerais alors sur l'adresse en question. mais comme je suis tombé sur un os, c'est un peu frustrant et je veux piger.
Merci de votre aide
Dernière modification par Pr.JMENTAPE (22-10-2013 05:07:36)