GithubHelp home page GithubHelp logo

treer / ip4 Goto Github PK

View Code? Open in Web Editor NEW
11.0 3.0 1.0 95 KB

Windows command to compactly list the IP address of every network adapter, as well as the external IP address if the Internet is accessible.

License: MIT License

C# 100.00%
dos-command cmd ip-addresses windows

ip4's Introduction

ip4

A Windows command line utility to list the IP address of every network adapter, as well as the external IP address if the Internet is accessible.

Saves hunting through pages of noise from ipconfig /all

Usage:

    ip4 [options]

Most useful options:
    
    -o      Optimizes the order of external-IP URLs based on response
            times. It is recommended that you run ip4 with this option
            at least once. The optimized order is saved and will be 
            used each time ip4 is run.

    -s      Skip the external-IP lookup. When the external IP address 
            doesn't matter, execution time and service bandwidth can  
            be saved by skipping unnecessary lookups.
          
    -s:on   Persists the -s option so that external-IP lookups are 
            always skipped when ip4 is run (until ip4 is run with the 
            -s:off option)

            
All options:
  
    -o  Optimizes the order of external-IP services based on response.
    -s  Skip the external-IP lookup. Shows only adapter IP addresses.
    -q  Quiet. Returns only IP addresses. 
    -v  Verbose. Full details are returned.        
    -c  Creates a new .ini file with default values (overwrites old 
        one if it exists).
    -p  Lists the URLs used for external-IP lookup in the order they 
        are tried, and the regular expression applied to each URL.
    -k  Keep URL. Adds an external-IP lookup service to the URL list.
        Use -w:<webpage> to specify the URL and -e:<regularExpression> 
        to specify the regular expression for the URL.
    -fp Format-Plain. No colour will be used in the output.

        
    -p:<positionIndex>        Perform the external-IP lookup using the 
                              URL at the specific position (for random 
                              page use 0).
   
    -w:<webPage>              Web page url. Works with -e switch, and 
                              -k switch.
    -t:<miliseconds>          Download timeout. Default value is 10000
    -e:<regularExpression>    Regular expression. Works with -w 
                              switch, and -k switch.
    -s:on                     Makes -s the default behaviour.
    -s:off                    Makes external-IP lookup the default 
                              behaviour.

For more details, see the content of the .ini file located with the ip4 executable, or sometimes located in %appdata%\ip4\ if the executable's directory isn't writable.

Output:

By default, six columns of information are displayed for each IPv4 interface. Quiet (-q) and verbose (-v) options can adjust how much of each column is shown.

  • IP address
  • Mask
  • Status - this consists of one of the following:
    • Up - The interface can transmit data packets. (When the interface is "Up" the output text for the interface is colored green)
    • Down - The interface cannot transmit data packets.
    • Testing - The interface is running tests.
    • Unknown - The network interface status is not known.
    • Dormant - The interface is not in a condition to transmit data packets, it is waiting for an external event.
    • Missing - The network interface is unable to transmit data packets because of a missing component, typically a hardware component.
    • LayerDown - The network interface is unable to transmit data packets because it runs on top of one or more other interfaces, and at least one of these "lower layer" interfaces is down.
  • "via DHCP" - this column is used to indicate which interfaces have had their IP addresses assigned to them by a DHCP server. When an IP address is marked as "via DHCP", it means the interface is configured to obtain its IP address using DHCP, and the current IP address is not a "fallback" IP address such as would be used when DHCP failed (aka Automatic Private IP Addresses). Note: There may be edge cases where both of these conditions are satisfied while the current IP address did not come from a DHCP server.
  • Network adapter name
  • Network adapter description

Credits:

ip4 is free and open source. It uses routines from outerIP, a command-line utility by [email protected] which provides more functions related to the external IP addresses, such as launching a script if the external IP address changes.

ip4's People

Contributors

treer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

maybelaterornot

ip4's Issues

Automatically Discarded by Browsers

Hello,

I actually admire your work on such a tool and I'd like to use it probably all the time because I am a network engineer, and it's really beneficial. Yet, it gets discarded all the time on all browsers I regularly use.

Chrome
Version: Version 87.0.4280.141 (Official Build) (64-bit)
Firefox
Version: 84.0.2 (64-bit)
Microsoft Edge
Version: Version 87.0.664.75 (Official build) (64-bit)

I know I can bypass the discard message I get. But tbh, I don't like downloading suspicious files from the internet to keep my laptop as clean as possible. Can you please check and solve this issue?

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.