The 2025 Wheel Reinvention Jam just concluded. See the results.
Networking information, in a readable format, for Linux

About ipconfig


This project aims to bring the default behavior of Windows' ipconfig command to Linux.

Stretch Goals

  • Implement /all
  • Windows support (for cross-platform app practice)
Read more
Filters

Recent Activity

&ipconfig I've got a busy day tomorrow, so I'm calling it a jam. I had a lot of fun making this, even though some information proved a lot more difficult to acquire than I had anticipated. In addition to being a handy networking info tool, this also turned into my second attempt at a string library. I've spent more time than I'd care to admit chasing down bugs in said library, but I'm almost certain issues are still lurking, so if you see something weird let me know.

Overall, I was really surprised by the Linux APIs. Sometimes they were very straightforward, and other times they were downright strange. It's definitely radically different than Win32, but overall, not a bad experience (though if I continue down this path, I'm really going to need more robust file parsing).

I also have to give a shoutout to CLion. It has to be the best piece of software I've ever used on Linux, I was completely blown away! Still not as plug and play as Visual Studio, but very impressive and easy to use (aside from CMake, ugh).

The code and a compiled binary can be found in the github repo: https://github.com/errorsuccessdev/ipconfig

View original message on Discord

&ipconfig I don't have any good screenshots for you, because the program looks exactly the same as it did yesterday! The difference is, it's now using my own attempt at a string library. Since I can't make text posts in this channel, I'll leave you all with a screenshot of how that's going 🙂

View original message on Discord

&ipconfig I now have all of the information I need to gather for each adapter. It's taken several days and a lot of string parsing to get here, so I'm very pleased to have everything displaying properly.

Getting the IPv6 address in particular gave me some trouble. getifaddrs lists IPv6 addresses as separate interfaces, so I settled on going over the interface list a second time to find the IPv6 version of the interface, and adding that address to the adapter struct. There may be a better approach, but this works for now.

Windows does list adapters that don't have an IPv4 address, but in my first major departure from ipconfig's formatting, I've decided to omit these since I don't find that information useful.

The other departure from Windows' formatting is the DNS suffix. Getting this on Linux has likewise proven difficult. I've settled on parsing /etc/resolv.conf for now, but this is a global DNS suffix, and there may be more than one, hence the slight naming difference.

View original message on Discord

&ipconfig So far, I have the following functionality built out:

  • Interface name: This is included in the ifaddrs struct
  • Whether the network is wired or wireless: Believe it or not, the easiest way to do this is checking for the existence of a directory (/sys/class/net/interface_name/wireless). Figuring out how that works is definitely on the to do list.
  • The IPv4 address: There are functions available to extract this from the ifa_addr member of the ifaddrs struct (specifically, inet_ntoa()). I think rolling my own version if this function would be a good exercise.
  • The DNS suffixes: This was a little less obvious, because unlike in Windows, there are many different things that could be managing DNS in Linux. I decided the best way to do this in a universal fashion was to manually enumerate /etc/resolv.conf. This isn't the cleanest approach, but it does work on my test systems.
View original message on Discord