How To Determine an IP Address of My Linux Server

ht‮w//:spt‬ww.lautturi.com
How To Determine an IP Address of My Linux Server

To determine the IP address of your Linux server, you can use the ip command or the ifconfig command.

To use the ip command, you can run the following command:

$ ip a

This will display information about the network interfaces on your server, including the IP address. The output will look something like this:

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
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 08:00:27:9f:b5:5b brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.100/24 brd 192.168.1.255 scope global enp0s3
       valid_lft forever preferred_lft forever

In this example, the IP address of the server is "192.168.1.100".

To use the ifconfig command, you can run the following command:

$ ifconfig

This will display similar information to the ip command. The output will look something like this:

enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.100  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::a00:27ff:fe9f:b55b  prefixlen 64
Created Time:2017-10-28 21:38:50  Author:lautturi