Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Strange Network Configuration
PostPosted: Fri May 27, 2011 7:37 am 
Offline

Joined: Mon May 23, 2011 10:25 pm
Posts: 5
Hi,

I am the following on a SAM9G45 board when boot using flash as a filesystem:

eth0 Link encap:Ethernet HWaddr 08:00:3E:26:0A:55
inet addr:192.192.192.200 Bcast:192.192.192.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:199 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:29682 (28.9 KiB) TX bytes:0 (0.0 B)
Interrupt:25 Base address:0xc000

/etc/network/interfaces:

# Configure Loopback
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.1.200
gateway 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255

Also, can someone explain why /etc/init.d has the following contents:

[root@Mini6045:/etc/init.d]# ls -al
drwxr-xr-x 1 root root 2048 Jun 29 2010 .
drwxr-xr-x 1 root root 2048 Jun 29 2010 ..
-rwxr-xr-x 1 root root 2482 Jun 24 2010 S01udev
-rwxr-xr-x 1 root root 1365 Jun 24 2010 S20urandom
-rwxr-xr-x 1 root root 397 Jun 24 2010 S40network
-rwxr-xr-x 1 root root 90 Jun 29 2010 S50modules
-rwxr-xr-x 1 root root 408 Jun 24 2010 rcS

I expected /etc/init.d/networking et al.

Thanks,

Kenny


Top
 Profile  
 
 Post subject: Re: Strange Network Configuration
PostPosted: Fri May 27, 2011 10:11 am 
Offline

Joined: Thu Jan 06, 2011 11:13 am
Posts: 31
Hello,

Is it only once the board has started? What happens if you do ifdown/ifup?


Ludovic


Top
 Profile  
 
 Post subject: Re: Strange Network Configuration
PostPosted: Fri May 27, 2011 8:20 pm 
Offline

Joined: Mon May 23, 2011 10:25 pm
Posts: 5
This seems to work but with some errors that I do not understand.

[root@Mini6045:/]# ping 192.168.1.8
PING 192.168.1.8 (192.168.1.8): 56 data bytes
ping: sendto: Network is unreachable
[root@Mini6045:/]# ifdown eth0
ifdown: interface eth0 not configured
[root@Mini6045:/]# ifup eth0
run-parts: /etc/network/if-pre-up.d: No such file or directory
run-parts: /etc/network/if-up.d: No such file or directory
ifup: can't open '/var/run/ifstate': No such file or directory
[root@Mini6045:/]# ping 192.168.1.8
PING 192.168.1.8 (192.168.1.8): 56 data bytes
64 bytes from 192.168.1.8: seq=0 ttl=64 time=195.683 ms

This notion of using BusyBox may be a source of my problem. I was trying the usual Linux stuff:

/etc/init.d/networking stop | start

Instead there is

/etc/init.d/S40network

and inside this script the network is hardcoded:case "$1" in
start)
echo "Starting network..."
# /sbin/ifup -a
/sbin/ifconfig eth0 192.192.192.200 netmask 255.255.255.0
;;
stop)
echo -n "Stopping network..."
# /sbin/ifdown -a
# /sbin/ifconfig eth0 down
# /sbin/ifconfig eth1 down
;;
restart|reload)
"$0" stop
"$0" start
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
esac

exit $?

So what is the proper way to configure the network? Sorry, this must be a newbie question. I can't seem to find good resources for this kind of information (recommendations?).

Is there only one runlevel in embedded linux? Is that why the startup scripts are all dumped in to /etc/init.d rather than links to the master scripts in the runlevel directories?

Thanks,

Kenny


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: