Finding the IPs of up interfaces in /proc

Discussion in 'Linux Networking' started by Guest, Apr 10, 2012.

  1. Guest

    Guest Guest


    I'd like to know if there is an interface in /proc that can tell me if
    an interface is up, and what IP it has.

    I'm writing an applet that uses tun0 for a VPN, and I'd like to put up
    a tooltip showing the IP given to tun0 after the VPN connected, or '-'
    if it is not connected yet.

    I have look in /proc/net/*, but I haven't found anything
    relevant. Only /proc/net/arp shows an IP, and it is my router's.

    Guest, Apr 10, 2012
    1. Advertisements

  2. Guest

    J G Miller Guest

    Try /sys/class/net instead.
    J G Miller, Apr 10, 2012
    1. Advertisements

  3. Guest

    Guest Guest

    Yes, I looked in there too, but nothing about IP addresses... I can
    get the MAC address, but that's not what I want.

    Thanks for the help though.
    Guest, Apr 10, 2012
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.