:: Re: [DNG] simple-netaid-gtk -- vers…
Startseite
Nachricht löschen
Nachricht beantworten
Autor: aitor
Datum:  
To: dng
Betreff: Re: [DNG] simple-netaid-gtk -- versions? dhcp? unbound?
Hi again,

On 27/4/24 13:18, al3xu5 via Dng wrote:

> 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.

> 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

> 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"}'

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.

The more ubus handlers, the more configurable will be "gtk.ini".

Indead, I'm considering to make optional the use of ubus as well.

Cheers,

Aitor.