First of all, sorry but I'm not super confident with linux and openwrt network configuration.
I'd like to have an aruino yun as a server that accepts requests in my home network.
Due to the fact that it has to be a server I think the best option is to configure it with a static ip address.
To do that I've configured my router to start the dhcp from 192.168.3.100 and higher. Lower then 100 are static ip address.
Even if I read some posts already in this forum I'm not sure I'm doing it in the right way because sometimes when I reset the board or the router (switching off and on the power) the openwrt machine in the yun loses the network configuration I have done.
It's not very clear if the problem is caused by the reset of the yun, the reset of the router, or both the things in some weird combination.
I'd like my yun to be always with the same ip address, even if the router is down for a while, even if I restart the yun and the wifi net is up, event if I restart the yun and the wifi net is down.
I've tried some different things from various post (*) but I think the best is from http://forum.arduino.cc/index.php/topic,217733.0.html
root@Arduino:~# cat /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 proto 'dhcp'
option 'proto' 'static'
option 'ipaddr' '192.168.3.42' # the status ip address I want
option 'netmask' '255.255.255.0'
option 'gateway' '192.168.0.1'
option 'dns' '192.168.0.1'
config interface 'wan'
option ifname 'eth1'
option proto 'dhcp'
option metric '10'
Sometimes it loses the net configuration: if I restart the yun It has a dhcp address (like 192.168.3.104) OR it open the access point setting (I haven't understand what causes what). Once it also happened that the white led that notify me the openwrt is ok (I have the new openwrt image) was not on (and this scared me a little).
Due to the fact that sometimes it loses the net configuration I have commented out the line
in the file /etc/rc.local
root@Arduino:~# cat /etc/rc.local
# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.
# Log down the server output
cd /root/node; node server.js > $logfilename 2>&1
But I'm not sure it is enough to stay permanently with a static ip address and wait for the wifi net go up again.
Please post anything that could help me, some other posts, or man pages, because it is really annoying to set configuration every time!
Hope not to be too openwrt illiterate : )