8 Replies Latest reply on May 22, 2016 10:49 AM by BenKissBox

    How to setup your galileo to have a static IP on a LAN

    Seth Hunter

      Hi Guys,


      I was having a bit of trouble setting up a LAN so I could network my PC to multiple galileos. I managed to figure it out with my own method and wanted to post my method to help others who might be trying to do the same thing. Hope it helps.


      How to setup your Galileo with a Static IP in a LAN:


      1) create a backup of your /etc/network/interfaces file

      cp /etc/network/interfaces  /etc/network/interfaces.backup


      2) vi /etc/network/interfaces

      Change dhcp in the "iface wlan0 inet dhcp" line to static

      Comment out all the lines below and add the following lines.


      Your file will look like this:


      # Wireless interfaces

      auto wlan0

      iface wlan0 inet static






              #wireless_mode managed

              #wireless_essid any

              #wpa-driver wext

              #wpa-conf /etc/wpa_supplicant.conf



      My routers IP address is (standard linksys router).

      Choose a unique IP for the address line that is not 1 or 0 ( > 10)


      3) Save the file, and restart the wlan0

      ifdown wlan0

      ifup wlan0


      4) join the same network with your PC and ifconfig or ipconfig to get your IP address.


      5) ping  (or your unique IP) from your computer to test.


      6) If ping fails, unplug your galileo and let it go through the boot sequence as it may need to reset the network/interfaces configuration from dhcp to static

      7) try pinging again - at this point it worked for me. If you power down your router you may also need to restart the galileos to obtain a new lease, but it will have the same IP address.


        • 1. Re: How to setup your galileo to have a static IP on a LAN

          For some reason, I can't seem to get this to work (I am not using wireless). Below is my interfaces file:


          # The loopback interface

          auto lo

          iface lo inet loopback



          # Wireless interfaces

          iface wlan0 inet dhcp

                  wireless_mode managed

                  wireless_essid any

                  wpa-driver wext

                  wpa-conf /etc/wpa_supplicant.conf



          iface atml0 inet dhcp



          # Wired or wireless interfaces

          auto eth0

          iface eth0 inet static





          #iface eth1 inet dhcp



          # Ethernet/RNDIS gadget (g_ether)

          # ... or on host side, usbnet and random hwaddr

          iface usb0 inet static







          # Bluetooth networking

          iface bnep0 inet dhcp



          The same exact settings (Address, netmask,gateway)  work for the same exact plug/port on a standard Debian linux distribution desktop, however putting these settings in the Galileo doesn't work at all. Can't ping it or SSH into it or anything. Is there something obvious that I am missing that would prevent it from working?

          • 2. Re: How to setup your galileo to have a static IP on a LAN

            hi motifmike

            i had the same issue.. i found out that connmand was running and managing the network connection so the config file in /etc/network/interfaces was completely ignored. i switched back to the old networking init script by deleting the link to the connman init script and replacing it with a link for the networking init script. here are the commands that will do that on your gallileo:


            rm /etc/rc5.d/S05connman

            ln -s ../init.d/networking /etc/rc5.d/S05networking


            then reboot your gallileo and it should be reachable with the static ip you gave it. worked for me.

            • 3. Re: How to setup your galileo to have a static IP on a LAN



              What is the procedure to set the ip addres in static mode for the Galileo board?


              The linux distribution I have is the 2.8.7-yocto-standard and runs from the SD card.


              The distribution has not the interfaces file therefore it is not possible to write the networking values there.


              In principle the commands to set the address work, rather when I try to connect the board I got:


              ssh: connect to host 187.176.xxx.xxx port 22: Connection refused


              Rather ping command works.




              • 4. Re: How to setup your galileo to have a static IP on a LAN

                Hi Marco,

                A co-worker of mine Antonio Torres used the method below to get the static ip working on the galileo....There might be an easier way since we tried this 6 months ago, but thought I'd post it on his behalf just in case it might help you. If you are able to ping the galileo from another machine on the same network, that would make me think you have the network settings are ok but SSH is not running for some reason. Nonetheless, you can try the following:


                In order to set a static IP on a galileo board with yocto linux, we need to use connman (daemon for managing Internet connections within embedded device) since the built image does not read /etc/network/interfaces becausebusybox-udhcpc has been removed.

                By default, connman-tests is not installed on yocto which contains all the necessary scripts to set up the static IP. To verify if connman-tests is in the repositories type:

                # opkg list | grep connman

                If you find connman-tests in the list, then install it using the install command:

                # opkg install connman-tests


                If connman-tests is not in the repositories, then you will need to install it manually from this website : http://repo.opkg.net/galileo/i586/ using the command:


                # opkg -i connman-tests_1.12-r19.0_i586.ipk


                Note: You must install all its dependencies before. These are all the dependencies you will need:

                -rw-r--r-- 1 root root 151496 Oct 16 16:55 connman-tests_1.12-r19.0_i586.ipk

                -rw-r--r-- 1 root root  61044 Oct 16 16:59 libdbus-glib-1-2_0.100.2-r0_i586.ipk

                -rw-r--r-- 1 root root  7156 Oct 16 17:01 libpyglib-2.0-python0_2.27.91-r6_i586.ipk

                -rw-r--r-- 1 root root 118034 Oct 16 16:57 python-dbus_1.1.1-r2_i586.ipk

                -rw-r--r-- 1 root root 212966 Oct 16 17:01 python-pygobject_2.27.91-r6_i586.ipk

                Once connman-tests is installed, go to the directory /usr/lib/connman/test and see a list of scripts that allow you to modify your network connections:

                # cd /usr/lib/connman/test

                # ls -l

                total 72

                -rwxr-xr-x 1 root root 1118 Jul  6 12:21 backtrace

                -rwxr-xr-x 1 root root 2144 Jul  6 12:21 connect-provider

                -rwxr-xr-x 1 root root  890 Jul  6 12:21 disable-tethering

                -rwxr-xr-x 1 root root 1335 Jul  6 12:21 enable-tethering

                -rwxr-xr-x 1 root root  233 Jul  6 12:21 get-global-timeservers

                -rwxr-xr-x 1 root root  621 Jul  6 12:21 get-proxy-autoconfig

                -rwxr-xr-x 1 root root 1277 Jul  6 12:21 get-services

                -rwxr-xr-x 1 root root  229 Jul  6 12:21 get-state

                -rwxr-xr-x 1 root root 1512 Jul  6 12:21 list-services

                -rwxr-xr-x 1 root root 2120 Jul  6 12:21 monitor-connman

                -rwxr-xr-x 1 root root 2799 Jul  6 12:21 monitor-services

                -rwxr-xr-x 1 root root 1813 Jul  6 12:21 monitor-vpn

                -rwxr-xr-x 1 root root  346 Jul  6 12:21 remove-provider

                -rwxr-xr-x 1 root root  571 Jul  6 12:21 service-move-before

                -rwxr-xr-x 1 root root  485 Jul  6 12:21 set-domains

                -rwxr-xr-x 1 root root  386 Jul  6 12:21 set-global-timeservers

                -rwxr-xr-x 1 root root  982 Jul  6 12:21 set-ipv4-method

                -rwxr-xr-x 1 root root 1203 Jul  6 12:21 set-ipv6-method

                -rwxr-xr-x 1 root root  496 Jul  6 12:21 set-nameservers

                -rwxr-xr-x 1 root root 1274 Jul  6 12:21 set-proxy

                -rwxr-xr-x 1 root root  495 Jul  6 12:21 set-timeservers

                -rwxr-xr-x 1 root root  491 Jul  6 12:21 show-introspection

                -rwxr-xr-x 1 root root 9448 Jul  6 12:21 simple-agent

                -rwxr-xr-x 1 root root  390 Jul  6 12:21 test-clock

                -rwxr-xr-x 1 root root  351 Jul  6 12:21 test-compat

                -rwxr-xr-x 1 root root 5078 Jul  6 12:21 test-connman

                -rwxr-xr-x 1 root root 1610 Jul  6 12:21 test-counter

                -rwxr-xr-x 1 root root 2079 Jul  6 12:21 test-manager

                -rwxr-xr-x 1 root root  285 Jul  6 12:21 test-new-supplicant

                -rwxr-xr-x 1 root root 8951 Jul  6 12:21 test-session

                -rwxr-xr-x 1 root root 1333 Jul  6 12:21 test-supplicant

                -rwxr-xr-x 1 root root  528 Jul  6 12:21 vpn-connect

                -rwxr-xr-x 1 root root  534 Jul  6 12:21 vpn-disconnect

                -rwxr-xr-x 1 root root 1004 Jul  6 12:21 vpn-get

                Setting nameservers


                The first thing you need to do is setting up the nameservers manually by using the script set-nameservers. But first, let's run the script get-services to obtain basic information:

                # ./get-services

                [ /net/connman/service/ethernet_984fee016xxx_cable ]

                    IPv6.Configuration = { Method=auto Privacy=disabled }

                    AutoConnect = true

                    Name = Wired


                Note that ethernet_984fee016xxx_cable corresponds to your ethernet mac address. Then, run the set-nameservers script as follows:

                # ./set-nameservers

                Usage: ./set-nameservers <service> [nameserver*]

                # ./set-nameservers ethernet_984fee016xxx_cable UR.FAV.DNS.SRV


                Setting static IP


                Changing your network connection to use static IP, you will need to run the script set-ipv4-method as:


                # ./set-ipv4-method

                Usage: ./set-ipv4-method <service> [off|dhcp|manual <address> [netmask] [gateway]]

                # ./set-ipv4-method ethernet_984fee016xxx_cable manual UR.STA.TIC.IP UR.GAT.EWY.IP


                Give a few seconds to restart the connection and voila! the static IP will be set up to your galileo device.

                • 5. Re: How to setup your galileo to have a static IP on a LAN

                  I have configured static local ip but this time internet connection is disabled. I cannot ping any website. I googled the problem and found DHCP conf. so that it cannot find www.google.com for instance. Have you got any idea to solve the issue?

                  • 6. Re: How to setup your galileo to have a static IP on a LAN

                    I was trying this approach, but I get a:


                    root@galileo:/usr/lib/connman/test#  ./set-ipv4-method ethernet_984fee016xxx_cable manual

                    Traceback (most recent call last):

                      File "./set-ipv4-method", line 22, in <module>

                        properties = service.GetProperties()

                      File "/usr/lib/python2.7/site-packages/dbus/proxies.py", line 70, in __call__

                        return self._proxy_method(*args, **keywords)

                      File "/usr/lib/python2.7/site-packages/dbus/proxies.py", line 145, in __call__


                      File "/usr/lib/python2.7/site-packages/dbus/connection.py", line 651, in call_blocking

                        message, timeout)

                    dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownObject: Method "GetProperties" with signature "" on interface "net.connman.Service" doesn't exist

                    • 7. Re: How to setup your galileo to have a static IP on a LAN

                      Thank you for describing this trick Seth, but it does not seem to work (at least for me )

                      I have made a lot of investigations on my Galileo about that issue, and simply said, it appears that the interfaces file is not read/taken into account.

                      I thought that adding this line in the Arduino sketch would solve the issue, but not in all cases... (see below the test I made)  

                           system ("ifconfig eth0 inet netmask up");

                      Even doing a ifdown eth0 followed by a ifup eth0 does not solve the problem (the Galileo keeps using the address it got by DHCP)


                      Tes t1 : Galileo is not connected to a DHCP server + interfaces file modified for static IP address

                      - the Galileo starts a DHCP sequence at startup (it should not, because eth0 is set to static)

                      - when the DHCP sequence is done, the Galileo takes a 169.254.xx.xx as IP address (a ZeroConfig address)

                      - but the "system" call in the sketch works . I have a sketch sending data to the network, and I see that the source address is


                      Test 2 : I connect the Galileo to a network with a DHCP server (still with the interfaces file set to static)

                      - the Galileo does again the DHCP sequence at reboot, and gets an IP address from the network (which proves that it uses the DHCP whatever the interfaces file says)

                      - the "system" call in the sketch does not work anymore, the Galileo stays at the IP address obtained from the DHCP server


                      I suspect that there is an issue with the initialization sequence in Yocto, but I have no time to investigate this for now. Maybe some members of the forum will have an idea about that before I return to the tests



                      • 8. Re: How to setup your galileo to have a static IP on a LAN

                        I have been able to make some more tests and now I understand what happens.

                        The key is to use the getifaddrs() function and check the result. getifaddrs returns the list of IP addresses recognized by Linux.

                        In fact, if you call system ("ifconfig eth0 inet netmask up"); in a sketch, it does not replace the IP address in the Galileo, it creates a new entry in eth0. In other terms, the Galileo will answer to three IP addresses when you call this function:

                        - the loopback one (, which is always defined

                        - the IP address it got from the DHCP server ( in my case)

                        - the IP address from the sketch ( here)


                        A ping to both addresses works (except the of course, it would be your own computer to answer, not the Galileo)


                        You do not even have to change the interfaces file, this trick works with the DHCP enable

                        A funny thing to know : if there is no DHCP server in your network, the Galileo will first take a ZeroConf address, then it wil take the static IP you defined (the ZeroConf address is replaced by the other one, while a DHCP address is kept)

                        The only small issue I have found with this solution is that the IP address used to send packets from the Galileo is not the statically defined one, but the DHCP one (if there was one)