I'm having problems trying to set a static IP address on my Intel Galileo Gen 2 with the most recent IoT devkit image installed. I'd like to make a persistent IP configuration for my Galileo since I'm using Eclipse for programming.
Since I've the new IoT devkit image installed, there's no "/etc/network/interfaces" file as there was before. Hence I'm using connmanctl as recommended.
I've been trying to follow the instructions /thread/60214 here and /message/310679 here but to no avail. I've also been reading from page 264 onwards of this http://wearcam.org/ece516/ArduinoLinux_by_ManoelCarlosRamon_9781430268390.pdf book.
- Inside "network" of System Preferences on Mac, I've configured the IPv4 manually, choosing the IP as being 192.168.1.27, the subnet mask being 255.255.0.0 and the router being 192.168.1.1. In accordance with the instructions in the book I've also set the DNS servers as 220.127.116.11 and 18.104.22.168. I've left out "internet sharing" for now.
- Finally, inside the shell I've run: ifconfig enp0s20f6 192.168.1.27 netmask 255.255.0.0 up in order to set the IP address
- From there I've tried pinging my computer's local connection 192.168.1.17 but it fails with nothing received.
- Then I've done: route add default gw 192.168.1.1 net mask 255.255.0.0 to set up a default route. I've tried pinging my computer again but still nothing.
- Since my configuration seems to be broken, the connmanctl actions seem pointless, however I've tried regardless.
- I've used $connmanctl config --ipv4 manual to try and set my static IP.
- I substituted: $connmanctl config ethernet_984fee01703b_cable --ipv4 manual 192.168.1.27 255.255.0.0 192.168.1.1
I haven't been able to ssh into 192.168.1.27 and Eclipse hasn't been able to connect either. The IP isn't static and resets itself after losing power.
One question I have is whether the IP address you manually assign to the ethernet port (inside System Preferences) has to be identical to the IP address you assign from inside the shell (see lines 1 & 2). At the bottom of page 268 in the book it says: Using the ifconfig command, type the valid IP address to be configured in your network...
Also, is there anything behind the subnet mask you use? When I first connected my ethernet cable to the board, it defaulted to 255.255.0.0 and that's what I went with. I've also tried 255.255.255.0 but to no avail.
Sorry if this is too long but I've just been trying to provide as much info as possible. Thanks for your help in advance.
What is the outcome of running uname -a?
While trying with connman, did you try to restart the service?
Did you get error messages?
Do you want to set a Static Ip for the Ethernet interface?
About the IP address set in the PC and the one set from the board, I think that are different processes. You can see on page 269 that is suggested to use an IP close to the one set it in the PC.
Take a look at: http://www.sustworks.com/site/prod_ipr_subnets.html Subnet Calculations | IPNetRouter Troubleshooting for more information about the netmask. Let me know if the number of hosts answers your question
If you want to set a Static IP for a WiFi network, let's try with this: http://stackoverflow.com/questions/31943490/how-to-set-static-ip-address-using-connman-for-wifi-netw... Static IP Address Using Connman
You should go to /var/lib/connman/wifi_xxx/ and edit the file named settings
thanks for your prompt reply. In the intervening time, I think I've got things semi-working. Sorry, I should have stated that I'm trying to configure a static IP over ethernet.
Running uname -a returns Linux galileo 3.8.7-yocto-standard # 1 Tue Jun 9 22:07:14 GMT 2015 i586 GNU/Linux
Repeating the steps I outlined above I've think I've managed to create a persistent IP. It's retained on shutdown and I can connect & launch the terminal inside Eclipse.
However, I can't ssh into the Galileo outside of Eclipse since it warns of a 'man-in-the-middle' attack. This might be a simple fix of changing out the ECDSA host key, but I've never done that before & don't know quite just yet.
Except it isn't long before this stops working entirely. I shutdown again or else disconnect and next time I boot the board I cannot ping to it. I'm certain the static IP is working since I can ssh into the board using my FTDI cable and check.
But I've figured out this is down to my service order configurations in System preferences on my computer. If I have "ethernet 2" (which is my connection to the galileo) placed first, above WiFi, I'm able to connect to 192.168.1.27. However, in this configuration I'm not able to connect to WiFi on my computer since ethernet 2 has priority.
Unfortunately, changing the two around causes the connection to the galileo to break.
After changing the service order configurations while the galileo was connected, I then did a shutdown -r now, rebooting the machine. It seemed to remember the configuration from there out. I hope I have everything working now - fingers crossed.
I also sorted my "remote host identification problem" by removing my "known-hosts" file on my computer. I couldn't use ssh-keygen -R as you would, so my last option was to delete the known-hosts file and start afresh. I was able to ssh over ethernet after that.
It seems that now is working fine but checking the images it seems that you are not able to ping yet. Are these images not updated? Or do you still have problems?
Thanks for taking note - no, not quite there yet. I thought I had things going but then things simply stopped working.
I have managed to create a static IP on the Galileo: 192.168.1.27 but when I connect the Galileo to power and through Ethernet I'm not able to ping or ssh into it.
Here's what that looks like:
This is how things look like in Network on my Mac:
If I connect my FTDI cable and ssh into my Galileo I can double check I've got a static IP, the answer's "yes":
Where I think the problem lies is in the IP routing, it's simply not able to make the connection:
For 'default', it has the correct(?) gateway but it's missing proper subnetting (so I presumed).
Thus I entered in: route add default gw 192.168.1.1 netmask 255.255.255.0 to change this, however it doesn't override what's there, rather it creates a duplicate.
Frankly, I don't know routing well enough since it's brand new to me but I feel it's were I'm falling down on this.
Another issue to mention is that the IP routing table resets itself when I reboot the Galileo. I don't know if that's intentional or I have to declare my changes 'static' another way.
Back on my Mac then, I can double check my IP addresses inside the terminal like so:
And then back on the Galileo I can have a go at pinging en1, en0 and the router (192.168.1.1):
You can see I get nothing pinging my wireless (eth1), I do get something pinging my ethernet connection (eth0) and nothing again when I ping my router.
Inside System preferences, I've made sure to enable "internet Sharing" over ethernet:
Below is another image showing the connections I have. I've even set the name servers using the command:
connmanctl config ethernet_984fee05a892_cable --nameservers 192.168.1.24 22.214.171.124
I'm afraid I'm out of ideas. This is my first time trying to do this and I could really use your help and of course, everyone who might have an idea.
Thanks very much,
Do you have updates on this? Have you been able to set a Static IP?
I was looking other threads related to this like:
First, I suggest you to use the latest EGIBC microSD image from: https://software.intel.com/en-us/iot/hardware/galileo/downloads IoT - Intel® Galileo Board Download | Intel® Developer Zone
Looking at those threads and doing some tests you should be using the interface enp0s20f6, then you need to disable connman if you are not going to use it because there could be a problem with the services and interfaces you are using.
I haven't tried with this: http://derekmolloy.ie/set-ip-address-to-be-static-on-the-beaglebone-black# Using_Connman Set IP address to be static with Connman but it has worked before for other makers, you could give it a try.
In your Route Table there are two default routes, have you tried to clean this table?
Thanks for the reply.
As per my previous answers, I've already stated that I'm up to date with the latest Linux image:
Linux galileo 3.8.7-yocto-standard # 1 Tue Jun 9 22:07:14 GMT 2015 i586 GNU/Linux
I've also already mentioned that been able to set a static IP address with connmanctl using the following command:
$connmanctl config --ipv4 manual
I'm also aware that eth0 has been renamed as enp0s20f6 in the new Linux image.
Again, it's apparent in my previous answer that I haven't had issue with using connmanctl, rather my issue is when I enable internet sharing on my Mac.
The two photos of my routing table differ because I did the following command:
route add default gw 192.168.1.1 netmask 255.255.255.0
I have flushed this table multiple times and made constant changes by my own discretion but it would help if I could get some guidance on how to make a bridging network so I could share my Mac's WiFi with the Galileo.
Without WiFi sharing on I can ssh over ethernet and things are working - except when I enable WiFi sharing. This http://www.jameco.com/Jameco/workshop/JamecoBuilds/intel-galileo.html tutorial gives an idea of what I'm trying to do.
Thanks for all the help you've offered me. I just wanted to update you to say I've managed to successfully connect the Galileo to the internet; via internet sharing on my Mac.
There wasn't necessarily anything wrong with what I was trying. It must have been the sequence of what I was doing - I think I had to restart the Galileo after reassigning the IP address.
Anyhow, I have Galileo up and running - so fingers crossed it should continue working!