ifconfig missing in Ubuntu 18.04

Command ‘ifconfig’ not found in Ubuntu 18.04

ifconfig utility has been deprecated and completely removed in Ubuntu 18.04

If you try to run ifconfig you will get error:

administrator@ubuntu:~$ ifconfig
Command 'ifconfig' not found, but can be installed with:
sudo apt install net-tools

You may install ifconfig utility by running sudo apt install net-tools or you may opt to use the new ip command. It is recommended to use ip utility which has a lot of options to provide you all necessary information about your network configuration. Now we are going to see how to use some of its options.

 

How to find my ip address using “ip” command?

The most common usage of “ip” utility is ip a which is the short form of ip address. This command displays your IP address and MAC address:

administrator@ubu1:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:0c:29:76:ef:8b brd ff:ff:ff:ff:ff:ff
    inet 192.168.37.82/24 brd 192.168.37.255 scope global dynamic noprefixroute ens160
       valid_lft 55564sec preferred_lft 55564sec
    inet6 fe80::bd41:6b08:40da:15d2/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever

You can use -br option to get a brief output. The command will look like this ip -br a:

administrator@ubu1:~$ip -br a
lo               UNKNOWN        127.0.0.1/8 ::1/128 
ens160           UP             192.168.37.82/24 fe80::bd41:6b08:40da:15d2/64

You can also use -c option for colored output ip -c a.

 

How to display routing table in Ubuntu 18.04?

ip utility can also display information about your routes. The command looks like this ip route:

administrator@ubu1:~$ip route
default via 192.168.37.1 dev ens160 proto dhcp metric 100 
169.254.0.0/16 dev ens160 scope link metric 1000 
192.168.37.0/24 dev ens160 proto kernel scope link src 192.168.37.82 metric 100

 

Tags:

Add a Comment