Change ethernet settings

bluscape
I'm running a Qt app on a Mini2440. I need to change the ethernet settings
at run time. I'm having a very hard time accomplishing this. Changing the
IP, Netmask, Broadcast and brining the interface up and down is easy.

Changing the IP from static to DHCP and changing the gateway is what's
giving me a very hard time.

I'm currently using ioctl to do this.

If I could get the mini2440 to use the /etc/network/interfaces
configuration file it will simplify things. The Mini2440 currently gets its
configuration from somewhere else.

1.) How can I force the mini2440 to use /etc/network/interfaces
configuration file?

bluscape
Ok, looking at /etc/init.d/networking it seems like its trying to configure
using /etc/network/interfaces but running ifconfig, the network
configuration is definitely not from /etc/network/interfaces but rather
from the bootloader network configuration.

This is what the bootloader config looks like:

ip=none

# or set your networking parameters here
eth0.ipaddr=192.168.1.100
eth0.netmask=255.255.255.0
eth0.gateway=192.168.1.1
eth0.serverip=192.168.1.44
eth0.ethaddr=00:00:00:00:00:01

This is what /etc/network/interfaces looks like:

auto lo
iface lo inet loopback

 auto eth0
 iface eth0 inet static
  address 192.168.1.33  
  netmask 255.255.255.0
  broadcast 192.168.1.255
  gateway 192.168.1.1

This is the result from ifconfig:

eth0      Link encap:Ethernet  HWaddr 00:00:00:00:00:01
          inet addr:192.168.1.100  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1 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:64 (64.0 B)  TX bytes:0 (0.0 B)
          Interrupt:51 Base address:0x4300

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask: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 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

On the terminal output I get:

starting network interfaces...
RTNETLINK answers: File exists
Error: either "local" is duplicate, or "/24" is a garbage.
RTNETLINK answers: File exists
loading modules

I'm not sure where the RTNETLINK error comes from?
Is that called from /etc/init.d/networking?

bluscape
Any advice on this?

Thank you

davef
SDcard or NFS or NAND?

My notes say ip=none for SDcard and commented out for NFS.

Haven't got the mini2440 setup at the moment. I'll set it up later tonight.

davef
I'm not sure where the RTNETLINK error comes from?

Are you running a WiFi dongle on this platform?

ip=none for SDcard and uses networking in /etc/network/interfaces

bluscape
No Wifi. Like I say, it seems like its trying to configure from
/etc/network/interfaces but its complaining about:

Error: either "local" is duplicate, or "/24" is a garbage.

KansaiRobot
Any advice on this error?
I got the same problem but even worst I had it when trying to configure to
static IPs... 

what does this error mean and how to correct it

Any advice greatly appreciated

kansai

Juergen Beisert
"RTNETLINK answers: File exists" The corresponding interface is already
configured and up and running.