Ethernet on BBB is setup for static IP but unable to access server

Hi,

I had installed lighttpd webserver on my BBB, and I had disabled bonescript service, the bonescript socket service. This allowed me to use port 80. I was able to access lighttpd server using an ethernet cable.

Suddenly today I found that I cannot access my web server on BBB it using the Ethernet cable,

Please could anyone suggest why this is happening.

I had configured ethernet for static addressing using this script.

#!/bin/bash

#setup the ethernet address
ifconfig eth0 192.168.0.88 netmask 255.255.255.0
route add default gw 192.168.0.1
ifconfig eth0 up

pinging 192.168.0.88 from my laptop brings no response from the BBB, similarly pinging 192.168.0.1 from the BBB has no response.

I can access lighttpd server using the USB cable when it is connected to my laptop.

Could anyone explain why usb accesses lighttpd while ethernet fails. Is there any configuration required for the lighttpd conf file ?? I only configured PHP on lighttpd…

Please help…

thanks
a

I managed to solve the problem, but I cannot understand how the solution works.

After adding a delay of 30 seconds and then executing the ifconfig settings causes the ethernet to be setup correctly. So this script works correctly.

#!/bin/bash

#setup the ethernet address

sleep 30

ifconfig eth0 192.168.0.88 netmask 255.255.255.0
route add default gw 192.168.0.1
ifconfig eth0 up

So adding a delay of 30 seconds after startup solved the problem.

Could anyone explain why this is required…Is there a better method of setting up the ethernet on the BBB.

I tried the method given on derek malloy’s website, but for some reason the settings get overwritten…

thanks
a