ecki / net-tools

Linux base networking tools

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ifconfig: get specific parameter value.

skrab-sah opened this issue · comments

In ifconfig:
We can use parameters to print values instead of printing usage msg.

eg:
-> ifconfig enp4s0 mtu
prints usage msg.

Change to:
-> ifconfig enp4s0 mtu
1500.

commented

I think ip command already has some query/scripting support?

May Be. I have not seen.

Would certainly be an option (especially with things like JSONPath filtering) but I doubt it’s worth to implement it in the legacy net-toole.

If ifconfig is not outdated, we can fill the extra space by extra features.
Extra features will help our users.

commented

Ifconfig is outdated, we probably first would need more essential features like multi address support (and maybe netdev then), but sure if you think script support can be helpful, maybe somebody wants to contribute a patch.

i would probably prefer something like

„ifconfig -S eth0“ returning a sourceable Shell representation (-S for scripting maybe)
IFCONFIG_MTU=1500
IFCONFIG_ADDRESS=10.0.0.1
Etc

this way a single call can get all parameters for one interface. Btw Will sent a pointer to this discussion to the mailing list. Feel free to reopen here with merge requests (I don’t want to keep todos here in my fork)