banner



How To Find Ip Address Of Linux Machine

Another day, some other control line tutorial. Today, let's talk about a vital networking command in Linux, ip. This command is handy to fish out network parameters of the Linux figurer.

It works on all Linux distributions including Ubuntu, Arch Linux, Debian, Fedora, etc..

ip command

ip control is a highly powerful command that replaced the now-depreciated ifconfig control which was a role of the net-tools bundle. The full general syntax of the command is as follows:

ip xx

Where xx must be replaced with i of the following to become the desired output.

-V to display ip utility version

-due south to display more data about the command

ip command usage in Ubuntu 17.10
ip command usage in Ubuntu 17.10

Finding the IP address of the Linux System

Launch 'Terminal' and enter the post-obit command to list all the IP address.

ip route list
ip route list command usage in Ubuntu 17.10
ip route list control usage in Ubuntu 17.ten

It should display all available IP accost including device names. If you are only interested in the default IP address that connects to the internet, use a grep parameter to list that one.

ip route list | grep default

Alternatively, you tin can also use device name in particular too, only you should know the names of network devices for that. Use ip addr show command:

ip addr show

Sample Output:

ane: 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.ane/viii telescopic host lo  valid_lft forever preferred_lft forever  inet6 ::1/128 telescopic host   valid_lft forever preferred_lft forever 2: enp1s0: <NO-CARRIER,Broadcast,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen chiliad  link/ether xxxxxxxxxxxxxxxxxxxx iii: wlp2s0: <Circulate,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq land UP group default qlen 1000  link/ether yyyyyyyyyyyyyyyyyyyy  inet 12121212121/24 brd 192.168.1.255 scope global dynamic wlp2s0  valid_lft 61791sec preferred_lft 61791sec  inet6 AB:AD:AK:AI/64 scope global temporary dynamic   valid_lft 548176sec preferred_lft 61403sec  inet6 one:2:00:33:333/64 scope global mngtmpaddr noprefixroute dynamic   valid_lft 548176sec preferred_lft 548176sec  inet6 3:22:33:333/64 telescopic link   valid_lft forever preferred_lft forever

Typically, eth0 is for Ethernet connection, and wlp2s0 for Wireless connexion.

For case, use eth0 :

ip addr show eth0

Finding the MAC Address of the Linux System

MAC address is another critical parameter of a network device, including your PC's hardware or a server. Every PC's network device should have a unique MAC accost.

Launch Concluding and enter the ip link command:

ip link show

Example Output:

1: lo: <LOOPBACK,Up,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN way DEFAULT group default qlen k  link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 ii: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast country Upwards mode DEFAULT grouping default qlen 1000  link/ether XXXXXXXXXXXX brd ff:ff:ff:ff:ff:ff 3: wlp2s0: <Circulate,MULTICAST> mtu 1500 qdisc mq country DOWN mode DEFAULT grouping default qlen m  link/ether YYYYYYYYYYYY brd ff:ff:ff:ff:ff:ff

The ip utility should list several parameters of the device. For each device, 2 lines should summarize the link state and characteristics. The first line summarizes the electric current name of the device, the flags fix on the device, the maximum transmission unit (MTU) and so on.

The second line should always indicate the blazon of link layer in apply and the current hardware address (MAC Address). In the above example, XXXXXXXXXXXX and YYYYYYYYYYY are the MAC Address of the two LAN connections in use.

Source: https://www.fosslinux.com/3027/how-to-find-ip-and-mac-address-by-command-line-in-linux.htm

Posted by: keenanmaked1947.blogspot.com

0 Response to "How To Find Ip Address Of Linux Machine"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel