Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Software] Handling IP addresses on Linaro OS

Off-Topic discussions about science, technology, and non Debian specific topics.
Post Reply
Message
Author
Stemmo
Posts: 30
Joined: 2013-08-20 10:16
Location: Italy

[Software] Handling IP addresses on Linaro OS

#1 Post by Stemmo »

Hi all,
I'm configuring a Linaro OS (Debian for ARM).

I need to understand which is the simplest way to switch the OS from DHCP to static network set;
sometime I will not have a remote GUI but I found the nmtui tool;
sometime I will need to switch from a web page, then by Apache/PHP script, so the changes must be simply.

The OS uses by default the NetworkManager set to DHCP.
If I simply added a /etc/network/interfaces.d/staticEth0 file and in my understanding this should override the NetworkManager settings since the NetworkManager.conf file contains the row:

Code: Select all

[ifupdown]
managed=false
If I reboot the board I only found a dynamic address. So the file is not sufficient to switch to static address.
If I take a look to syslog file I found:

Code: Select all

Dec 22 10:34:32 kitvpnT2 NetworkManager[312]: <info>  [1671701672.8253] ifupdown:       interface-parser: source line includes interfaces file(s) /etc/network/interfaces.d/staticEth0
Dec 22 10:34:32 kitvpnT2 NetworkManager[312]: <info>  [1671701672.8254] ifupdown:       interface-parser: parsing file /etc/network/interfaces.d/staticEth0
Dec 22 10:34:32 kitvpnT2 NetworkManager[312]: <info>  [1671701672.8255] ifupdown:       interface-parser: finished parsing file /etc/network/interfaces.d/staticEth0
So I guess the file is correct.

Any idea?
Thanks!
SteMMo

User avatar
cds60601
df -h | participant
df -h | participant
Posts: 750
Joined: 2017-11-25 05:58
Location: Florida
Has thanked: 138 times
Been thanked: 70 times

Re: [Software] Handling IP addresses on Linaro OS

#2 Post by cds60601 »

Generally, and If I understand what you want to do, you WANT Network Manager to manage your wired connection. Your /etc/NetworkManager.conf should have ifdown managed set to = true
This is what I do so I can, when needed, use nmtui. Keep in mind that there may be other things you may need to do first so read up on this link: https://wiki.debian.org/NetworkConfiguration and here: https://wiki.debian.org/NetworkManager

After setting to true you'll need to restart the services - I find it faster (and simply because I'm lazy) to just reboot after making the change.
Supercalifragilisticexpialidocious

Stemmo
Posts: 30
Joined: 2013-08-20 10:16
Location: Italy

Re: [Software] Handling IP addresses on Linaro OS

#3 Post by Stemmo »

Thanks for reply.

My doubt is: since the flag is false, why the NetworkManager is managing the addresses receiving the dynamic address?

The https://wiki.debian.org/NetworkManager page says that:
NetworkManager will only handle interfaces not declared in /etc/network/interfaces (see README file).
About nmtui: ok for the textual console, but thinking I need to achieve it from a PHP script, I cannot interact with the terminal.
My idea is to generate a nmconnection file filled with the dhcp/static parameters under [ipV4] section.
SteMMo

User avatar
cds60601
df -h | participant
df -h | participant
Posts: 750
Joined: 2017-11-25 05:58
Location: Florida
Has thanked: 138 times
Been thanked: 70 times

Re: [Software] Handling IP addresses on Linaro OS

#4 Post by cds60601 »

I seem to recall that there can't be any references to the interface to be managed by Network Manager, in /etc/networking/interfaces
Review this: https://wiki.debian.org/NetworkManager# ... _Unmanaged
Supercalifragilisticexpialidocious

Stemmo
Posts: 30
Joined: 2013-08-20 10:16
Location: Italy

Re: [Software] Handling IP addresses on Linaro OS

#5 Post by Stemmo »

Thanks!

Finally I decided to use the command:

Code: Select all

nmcli connection modify 'Wired connection 2' setting.property value
It is quite simple to use it in a shell script / PHP
SteMMo

User avatar
cds60601
df -h | participant
df -h | participant
Posts: 750
Joined: 2017-11-25 05:58
Location: Florida
Has thanked: 138 times
Been thanked: 70 times

Re: [Software] Handling IP addresses on Linaro OS

#6 Post by cds60601 »

Good deal. It sounds like you have this worked out. Mind marking this solved if it is?
Supercalifragilisticexpialidocious

Post Reply