Static IP address impossible to set

This is the place for software discussions not having a dedicated subforum

Static IP address impossible to set

Postby raulina » Thu Jul 06, 2017 3:17 pm

Hi all,

I have a wandboard quad rev b1, with ubuntu 16.04 and kernel 4.9.35. I am trying to set a static ip address, and it is turning me crazy because all I have tried has been useless. In fact, yesterday it seemed to work, but today it stopped, and I don't know why. I want the WB to boot with the ip 192.168.2.5, but it gets one from the dhcp of the network where it is connected.

First, my /etc/network/interfaces looks like:

Code: Select all
# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
#source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.2.5
netmask 255.255.255.0
broadcast 192.168.2.255
network 192.168.2.0
gateway 192.168.2.129
dns-nameservers 8.8.8.8


at the begging I found that there was a dhcp client called udhcpd, and I disabled it with update.rc. I checked and now it is not running. Running
Code: Select all
ps aux | grep dhcp
shows nothing. A similar search with the term "netw" or "etw" (to see if NetworkManager is working, or something similar) returns nothing either. Searching for "ip" returns

Code: Select all
root        99  0.0  0.0      0     0 ?        S<   14:38   0:00 [ipv6_addrconf]


But it should only configure the ipv6...

Any ideas?

Thank you.
raulina
 
Posts: 15
Joined: Thu May 05, 2016 3:23 pm

Re: Static IP address impossible to set

Postby raulina » Mon Aug 07, 2017 7:58 am

Finally, I found that connman was the responsible when I looked at /etc/resolv.conf. I solved it with:

Code: Select all
sudo apt-get remove connman
sudo reboot
raulina
 
Posts: 15
Joined: Thu May 05, 2016 3:23 pm

Re: Static IP address impossible to set

Postby Alizeh » Thu Oct 05, 2017 12:39 pm

Below is an example of a static IP configuration on a system with only one Ethernet interface (eth0) and 10.0.0.41/24 for the IP address. Opening the /etc/network/interfaces file will produce:

Code: Select all
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
    address 10.0.0.41
    netmask 255.255.255.0
    network 10.0.0.0
    broadcast 10.0.0.255
    gateway 10.0.0.1
    dns-nameservers 10.0.0.1 8.8.8.8
    dns-domain acme.com
    dns-search acme.com


Open your /etc/network/interfaces file, locate the:
    "iface eth0..." line and change dynamic to static
    address line and change the address to the static IP address
    netmask line and change the address to the correct subnet mask
    gateway line and change the address to the correct gateway address
    dns-nameservers line and change (or add) the nameserver information

If you aren't certain which IP address, subnet mask, gateway or dns-nameservers you need, please consult with your network administrator for the correct information.
____________________________
Automobile Dealership Software | ERP Accounting Software
Last edited by Alizeh on Wed Oct 18, 2017 6:51 am, edited 1 time in total.
Alizeh
 
Posts: 1
Joined: Wed Oct 04, 2017 10:27 am

Re: Static IP address impossible to set

Postby ClayMontgomery » Fri Oct 06, 2017 4:20 pm

I ran into the same problem with the Pyro version of Yocto, which now has connman installed by default. However, we can not remove connman from a Yocto system with apt-get.
If you want to restore the old way of configuring the network, you can remove connman with this:

update-rc.d -f connman remove

If you need to reinstall connman use:

update-rc.d connman defaults

However, removing connman also removes support for BlueZ (Bluetooth), oFono (Cellular), neard (Near Field Communications) and PacRunner from the Yocto system. So, you might want to leave it installed and configure connman for a static IP address, instead. That is done by editing this file:

/var/lib/connman/ethernet_<HASH>_cable/settings

Which is documented here:

https://www.mankier.com/5/connman-service.config

Regards, Clay
ClayMontgomery
 
Posts: 87
Joined: Tue Nov 19, 2013 9:14 pm


Return to Software - General

Who is online

Users browsing this forum: No registered users and 20 guests

cron