HowTo: Determine an IP Address My Linux Server

I am a new Linux system user. How do I find out the IP address of Linux server? How do I determine the IP address of Linux server using command line options?

You can use any one of the following command to find the IP address on Linux operating systems using command line based options:

ADVERTISEMENTS

Tutorial details
DifficultyEasy (rss)
Root privilegesNo
RequirementsNone
Time1m
a) ip command – show / manipulate routing, devices, policy routing and tunnels.

b) ifconfig command – configure a network interface.

Determine ip address using ifconfig command

In this example, find the ip address of the server using the following ifconfig command:
$ ifconfig
$ ifconfig eth0

Sample outputs:

Fig.01: ifconfig in action

Fig.01: ifconfig in action

Determine ip address using ip command

In this example, find the ip address of the server using the following ifconfig command:
$ ip a list
$ ip a list eth0

Sample outputs:

Fig.02 ip command in action

Fig.02 ip command in action

🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
FirewallCentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNCentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS
0 comments… add one

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.