ipconfig not working

Solution 1:

The Ubuntu/Linux equivalent of ipconfig in Windows is ifconfig.

Try typing sudo ifconfig.

The result will look something like this:

eth0      Link encap:Ethernet  HWaddr 00:0c:29:94:37:b6  
          inet addr:192.168.1.231  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe94:37b6/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:519374 errors:0 dropped:0 overruns:0 frame:0
          TX packets:110611 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:332864737 (332.8 MB)  TX bytes:11113451 (11.1 MB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:33651 errors:0 dropped:0 overruns:0 frame:0
          TX packets:33651 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:2951078 (2.9 MB)  TX bytes:2951078 (2.9 MB)

Solution 2:

ipconfig is a Windows program - the closest for linux is ifconfig, but contrary to what others (including the accepted "answer") are saying, it is not the same, and does not give the same output at all.

One of the key missing pieces of information in ifconfig is the DNS addresses; they are not there, and there's not an easy way to find that out. On my system, I have an alias to show some information like that:

nmcli dev list iface eth0 | grep IP4

This will list most of the information I usually want to see. On my system, it shows:

$ nmcli dev list iface eth0 | grep IP4
IP4-SETTINGS.ADDRESS:                   192.168.1.110
IP4-SETTINGS.PREFIX:                    24 (255.255.255.0)
IP4-SETTINGS.GATEWAY:                   192.168.1.1
IP4-DNS1.DNS:                           8.8.8.8
IP4-DNS2.DNS:                           8.8.4.4

Note that you may need to use a different designation for the network, such as eth1, eth2, etc. If you get an error about a device not found, try changing this.

Also note the accepted "answer" is also incorrect in that you do not need to use "sudo" for this command.

Solution 3:

If that's the case, use ifconfig. It'll give you the same output that ipconfig will on Windows. But ifconfig is now ip a.

ifconfig

is equivalent to

ip addr show

and, because the object argument can be abbreviated and command defaults to show, also to

ip a