What is the equivalent terminal command to ipconfig /all?

Solution 1:

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.

Solution 2:

ipconfig shows things like hostname, DNS servers, those are in a different place than just IP addresses in linux, so you will need a couple of commands.

hostname
ifconfig -a
cat /etc/resolv.conf

That shows what I want to see 99% of the time, but ipconfig /all also shows things like DHCP lease times and servers.

cat /var/lib/dhcp/dhclient.leases

Solution 3:

Was looking at few links and finally found the below working:

nmcli dev list | grep IP4

The output is:

IP4.ADDRESS[1]:                         ip = 195.168.0.107/24, gw = 192.168.0.1
IP4.DNS[1]:                             192.168.0.1
IP4.DOMAIN[1]:                          local

Also all the network related details can be found using putting simply:

nmcli dev list eth0

ubuntu chromium