:: Re: [DNG] simple-netaid-gtk -- vers…
Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: al3xu5
Fecha:  
A: dng
Asunto: Re: [DNG] simple-netaid-gtk -- versions? dhcp? unbound?
Hi aitor


Tue, 30 Apr 2024 02:12:59 +0200 - aitor <aitor_czr@???>:

> > Nice... but... How should be the content of /etc/network/interfaces?
>
> It's suggested in the README.md of libnetaid. Something like this will work:
>
> iface eth0 inet dhcp
> iface wlan0 inet dhcp
>
> It's up to you to add other stanzas like allow-hotplug, auto, etc.
>
>
> > I have some problems here (I suppose probably related to ifdown).
> >
> > What if I want /etc/network/interfaces define only the loopback interface
> > (this, for example, to handle dhcp for eth0 directly by dhcpcd)?
>
> If you only add stanzas for the loopback interface "lo", ifupdown will do
> nothing.


Yes... I had /etc/network/interfaces with:

auto eth0
allow-hotplug eth0
iface eth0 inet dhcp

But dhcpcd refuse to start with this error:

Not running dhcpcd because /etc/network/interfaces ... failed!
defines some interfaces that will use a DHCP client ... failed!

So I have this problem: if /etc/network/interfaces is empty (without eth0)
then dhcpcd works, and if I set `iface eth0 inet dhcp` then dhcpcd doesn't
start and simple-netaid (ifdown) cannot manage the eth0 interface...

I wouldn't know how to handle it...

Maybe I should disable the dhcpcd service? What else?


> > Simple-netaid-gtk says 'Connected to eth0', but I cannot bring down eth0
> > (the message is: 'ifdown: unknown interface eth0)...
>
> Exactly. This is because you only have the loopback interface in your
> /etc/network/interfaces


Indeed (see above)...

> > and running:
> > $ sudo ubus call ering.netaid ifdown '{ "ifname": "eth0" , "tty": 2 }'
> > apparently do noting (eth0 say up)...
>
> For the same reason. On the other hand, using sudo in the ubus calls makes
> no sense because they provide granted privileges without the need of root
> permissions, just as dbus does.
>
> If you are root, run commands like:
>
> # ip link set eth0 up
> # ifup eth0
>
> However, if you aren't root then you want to run commands like:
>
> $ ubus call ering.netaid interface_up '{ "ifname": "eth0"}'
> $ ubus call ering.netaid ifup '{ "ifname": "eth0"}'


Oh yes of course... I didn't know what else to invent... :)


> The variable "tty" is optional. I use it to redirect the output to the vte
> terminal of the GUI.
>
>
> > Maybe bringing interfaces up/down with the more portable ifconfig
> > (ifconfig <interface> up|down) instead of ifup ifdown could be a
> > solution?
>
> It might be another option, although I think ifconfig is deprecated.


You are right. A better option could be `ip`, which sould provide:
ip link set <interface> down
ip link set <interface> up

Thank you a lot

alexus


--
The only way humans have learned to survive brings them to extinction.
______________________________________________________________________
Public GPG/PGP key: 8FC2 3121 2803 86E9 F7D8 B624 DA50 835B 2624 A36B