Monday, May 13, 2024
29
rated 0 times [  29] [ 0]  / answers: 1 / hits: 418934  / 2 Years ago, sat, september 17, 2022, 11:26:42

In windows I can use ipconfig /all and this displays all the info about my connection.



In terminal using ifconfig does not and only supplies limited info. I can use network manager, but it would be useful to know the command line alternative.



So my question is: what is the command line to supply ip address, gateway, subnet mask, DNS the same way ipconfig /all supplies in Windows.



Thanks all


More From » command-line

 Answers
4

The only thing missing from ifconfig are the gateway and DNS servers.



15.04 and newer



To get the DNS and Gateway info just type:



nmcli dev show eth0


The output lists some device parameters including some IP4.DNS[x] entries, which show the DNS servers and a IP4.ADDRESS[1] line which lists the IP and Gateway used (look for the gw = ???.???.???.??? part at the end of the line up to 15.10). On 16.04 and newer versions there is a IP4.GATEWAY line which is pretty self explanatory.



Replace eth0 with the actual device name you're using, which may not be the same. To get a list of devices and their status type:



nmcli dev status


Up to and including 14.10



You can get these with nm-tool (in Ubuntu versions prior to 15.04) which BTW is the command line version of network manager.



To run it just type in a terminal:



nm-tool


If you're using Ubuntu 15.04 or newer the nm-tool has been replaced by the nmcli command which is different. Check the section called "15.04 and newer" above this one in this case.


[#42084] Sunday, September 18, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
uquelighted

Total Points: 242
Total Questions: 110
Total Answers: 106

Location: Cyprus
Member since Tue, Sep 22, 2020
4 Years ago
uquelighted questions
;