0

I have a C# .net application running in my own embedded custom linux distro generated by buildroot tool, my hardware is a FriendlyArm4412. I use eth0 interfaces to connect my application to the internet without any problem. The problem is: If I connect the ethernet cable before the system boot everything is OK but if I plug the cable after the system boot my system can't get an ip address. I see this because my application shows on the screen "ip address: 127.0.0.1" which is just my local address.

I've already tried to use the Connman network manager which worked very well for the problem above, but I realized that connman ignores my /etc/network/interfaces settings which is bad because my application sets up some things in this file, like static ip address, wlan0 interface, etc.

What can I do ? Any idea ?

  • Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Super User](http://superuser.com/) or [Unix & Linux Stack Exchange](http://unix.stackexchange.com/) would be a better place to ask. – jww Nov 13 '17 at 14:43

1 Answers1

0

Check DefaultAutoConnectTechnologies configuration parameter in /etc/connman/main.conf file. See whether ethernet is present or not.

Connman doesn't use /etc/network/interfaces file. You need to use Connman D-Bus API's to set static IP to your network interface. Download Connman source code and see doc/service-api.txt for D-Bus API. Also see test/set-ipv4-method python script in source directory for a quick code reference on how to set static IP using D-Bus API.

If you don't want to use D-Bus API, you can edit connman storage directory files to set static IP before connman start. But editing connman storage directory is not a right way to do this. Default Connman storage directory is /var/lib/connman/ethernet_$mac_address_cable/*.

Ravi
  • 986
  • 12
  • 18