EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Free Courses
  • Certification Courses
  • 600+ Courses All in One Bundle
  • Login

IP Command in Linux

By Priya PedamkarPriya Pedamkar

Home » Software Development » Software Development Tutorials » Linux Tutorial » IP Command in Linux

IP Command in Linux

Introduction to IP Command in Linux

The following article provides you an outline for the various IP Commands in Linux. IP stands for Internet Protocol. It is a numerical value to indicate a device location and its identification in a network.

The ip command is used on Linux operating systems to assign an address to a network interface and/or to configure parameters of the network interface. This command replaces the old great and now outdated command of ifconfig on modern Linux distributions. The ip command is a powerful tool that any Linux system administrator should know about configuring network interfaces. It can be used to upload or down interfaces, assign and remove ARP cache addresses and routes, and much more.

Start Your Free Software Development Course

Web development, programming languages, Software testing & others

Networking Commands

Let us first go through some basic Networking Commands

1. For getting information about host,

  • hostname: It will display a machine hostname.
  • hostname -i: It will display the IP address for the current machine.

2. For knowing the connection to and fro with the host,

  • netstat -g: It will display all the multicast network subscribed by this network.
  • netstat -l: will display all listening ports.
  • netstat -t: will display all TCP connections.

3. To check connections with hosts and IP address if that is alive of not by sending packets,

ping www.google.co.in

IP Command in Linux ping

Here, we saw 0% packet loss, which means that the connection is established and working properly.

4. To know current network configurations:

ifconfig -a: view all configuration and settings.

5. To discover the hostname and IP address:

nslookup www.google.co.in

IP Command in Linux nslookup

6. To know the number of hops and response time to get to a remote system or website:

Popular Course in this category
Linux Training Program (16 Courses, 3+ Projects)16 Online Courses | 3 Hands-on Projects | 160+ Hours | Verifiable Certificate of Completion | Lifetime Access
4.5 (6,013 ratings)
Course Price

View Course

Related Courses
Kali Linux Training (3 Courses, 3+ Projects)Red Hat Linux Training Program (4 Courses, 1+ Projects)

traceroute www.google.co.in

Now coming to IP (Internet protocols), it is of two types:

  • IPV4: Internet Protocol version 4 has a storage capacity of a 32-bit number. The growth of internet and security concerns depleted IPV4 so IPV6 came into the picture.
  • IPV6: Internet Protocol version 6 uses a 128-bit number as storage capacity.

So generally, An IP uniquely identifies a host or device on a network. IP ranges are divided into A, B, C, D, E classes which I am surely not going into details as it is mostly theoretical. For example, the dotted-decimal private IP address of C class 192.168.123.132 is (in binary notation) the 32-bit number 110000000101000111101110000100. This number will be hard to make sense of, so divide it into four parts of eight binary digits. The first part of this IP address is used as a network address, the last part as a host address. If you take example 192.168.123.132 and divide it into these two parts you get the following:

192.168.123.0 is a network address. 0.0.0.132 is a host address.

Important IP Command in Linux

Using IP command we can know the device addresses and the network in which our devices reside.

Syntax:

IP OBJECT or IP AbbreviatedForm

So, below are the command list that we can use for the above syntax:

 Object  Abbreviated form  Purpose
 link  l  Network devise in network
 address  a  IPv4 or IPv6 address on a device.
 addr
 addrlabel  addrl  Label configuration for protocol address selection.
 neighbor  n  ARP or NDISC cache entry.
 neigh
 route  r  Routing table entry.
 rule  ru  Rule in routing policy database.
 maddress  m  Multicast address.
 maddr
 mroute  mr  Multicast routing cache

For example, when we run below command:

IP Address or IP Addr

Additionally, You can use “man ip” which will list down the options available for IP command.

Uses of IP

There are many protocols that use IP addresses. They are:

SSH

This protocol is used to connect a remote computer securely. This might require a password and private key file(.PEM).

Code:

$ssh -i xyz.pem username@ip-address

Now you can normal Unix commands like ls (to list the directory), cd (to change the directory) and other commands

FTP

File transfer protocol is used for establishing a connection with the remote hosts by login and transfer files. You will be prompted to give a password.

Code:

$ ftp 19.168.123.32

You can use the “get” command to get files and put command to “put” files on the remote host. FTP is also used to browse the content of directories. Then, you can press the exit if you are finished with transferring of files. Below are lists of useful commands related to FTP.

FTP

TELNET

This protocol is used to remotely control a host and administer them. It is similar to Remote desktop found in window machines. Compared to SSH, TELNET is less secured.

Code:

$telnet <ip-address/my_host.com>

Attempts to open a connection to the remote host my_host.com. If a connection is established, then the host will prompt for a login name and password.

Code:

$telnet -l my_username my_host.com 5555

Attempts to open a connection to the remote host my_host.com on port 5555, using the login name my_username. If successful, the host will prompt my_username’s password. Opens a local telnet> prompt, where you may enter any of the commands listed above. For example, entering the below command at the prompt:

Code:

telnet>  open my_host.com

..will attempt to open a connection to my_host.com, as in our first example. Once authenticated, you may execute commands just like you have done so far, using the Terminal. The only difference is, if you were connected to a remote host, the commands will be executed on the remote machine, and not your local machine. You can exit the telnet connection by entering the command ‘logout’.

Telnet uses at least HOME, SHELL, DISPLAY, and TERM environment variables. Other environment variables may be propagated to the other side via the TELNET ENVIRON option.

NOTE: The minimum requirements to create a network of communications between two machines.
  • Two hosts must be on the same Ethernet/LAN to Communicate Using IP.
  • Each host must have a good connection with the Ethernet. Verify a good connection to the Ethernet using
  • various tools like mii-tool.
  • Each host should have the same network address, netmask, and broadcast address.
  • Each host must have a unique IP address.
  • Neither of the hosts must block the other’s IP packets.

Important Usage of IP Command

Here are some  important usage of IP command in Linux listed below:

  •  It is used to find which interfaces are configured on the system and query the status of an IP interface.
  •  Configure Ethernet, local loop-back and other IP interfaces.
  •  Modify default and also configure static routing.
  •  It is used to set up a tunnel over IP and list down ARP cache entry.
  •  Used to delete, assign and setup routes, subnet, IP address, and other IP info to IP interfaces.
  •  It is used to display IP and its property.
  •  Display all status of network and multicast IP addresses information.
  •  Also, It is used to display neighbor object and manage ARP cache information
  •  Delete and manage the routing entry.

Recommended Articles

This is a guide to IP Command in Linux. Here we discuss the syntax, uses, and important IP command in Linux along with its important usage. You may also look at the following articles to learn more –

  1. Types of Shells in Linux
  2. Top Commands in Linux
  3. GCC Command in Linux
  4. Linux Route Command

Linux Training Program (16 Courses, 3+ Projects)

16 Online Courses

3 Hands-on Projects

160+ Hours

Verifiable Certificate of Completion

Lifetime Access

Learn More

2 Shares
Share
Tweet
Share
Primary Sidebar
Linux Tutorial
  • Advanced
    • Install VMware
    • Install GRUB
    • Chown Command in Linux
    • Linux Network Command
    • Configuring Linux Network Environment
    • DNS Configuration in Linux
    • Linux Users
    • Create User in Linux
    • DHCP Server in Linux
    • FTP Server in Linux
    • Linux Regular Expression
    • IP Command in Linux
    • Set IP Address in Linux
    • Tar Command in Linux
    • Dynamic Host Configuration Protocol
    • Linux Kill Signals
    • Linux File Permissions
    • Linux File System
    • Linux Create File
    • Linux Concatenate Files
    • Linux Join
    • Linux Process Management
    • Linux Proxy Server
    • Linux System Commands
    • Linux System Logging
    • NFS in Linux
    • Linux LVM
    • Linux Repository
    • Samba Server in Linux
    • Top Commands in Linux
    • Types of Shells in Linux
    • Shell Script Types For Linux
    • GCC Command in Linux
    • Monolithic Kernel
    • YARN Package Manager
    • Linux Sed Replace
    • Linux List Groups
    • Linux Container
    • Linux Find File by Name
    • Create Folder in Linux
    • Linux Move Folder
    • Linux Error Codes
    • Linux Automount
    • Linux HugePages
  • Basic
    • Introduction to Linux
    • What is Linux
    • Careers in Linux
    • How to Install Linux
    • How to Install Ubuntu
    • How to Install Ubuntu Server
    • How To Install Debian
    • Advantage Of Linux
    • What is Raid in Linux
    • What is Raid 5?
    • Raid 5 vs Raid 6
    • Careers in Linux Administration
    • What is Shell in Linux?
    • Bash Shell in Linux
    • Linux Emulator
    • Linux Operators
    • Linux Apps
    • Linux Keyboard Shortcuts
    • Linux Crontab
    • What is Raid Storage
    • What is Vmware
    • What is RedHat
    • What is Debian
    • Uses of Ubuntu
    • Career In RedHat
    • Linux Distributions
    • Linux From Scratch
    • Linux Format
    • Cheat Sheet Linux
  • Linux Commands
    • CAT Command in Linux
    • PS command in Linux
    • Mkdir Command in Linux
    • rmdir command in Linux
    • mv command in Linux
    • Linux rm Command
    • CHMOD Command in Linux
    • Zip Command in Linux
    • Linux Route Command
    • SCP Command in Linux
    • du Command in Linux
    • Less Command in Linux
    • Copy Command in Linux
    • Head Command in Linux
    • Help Command in Linux
    • Linux History Command
    • hostname Command in Linux
    • GREP Command in Linux
    • Linux Curl Command
    • Linux List Users
    • Linux List Directories
    • Linux Directory Permissions
    • Find Directory Linux
    • Linux User Permission
    • Linux Add User
    • Linux Delete User
    • Linux uniq
    • Linux Filter Commands
    • Linux sort Command
    • Linux Sort by Size
    • Remove dir Linux
    • Linux tr Command
    • Linux Touch Command
    • Linux More Command
    • Linux Cal Command
    • Linux OD
    • Linux Zcat
    • Linux tracepath
    • Linux Sleep
    • Linux bg Command
    • Linux WC
    • Linux Read
    • Linux Write
    • Linux Rename Command
    • Linux Free Command
    • Linux tac
    • Linux Shred
    • Linux wget
    • Linux Date
    • Linux Untar
    • Linux JQ
    • Linux Xargs
    • Linux Mount Command
    • Linux mdadm
    • Linux comm
    • Linux tee Command
    • Tail Command in Linux
    • Linux gzip
    • Linux Directory Structure
    • Linux Alias Command
    • Linux Inode
    • Linux Ping
    • Linux Watch Command
    • Linux Split Command
    • Linux Size
    • Linux Network Stack
    • Linux Diff Command
    • Vim Command in Linux
    • Linux nslookup
  • Kali Linux
    • Install Kali Linux
    • Kali Linux Uses
    • Kali Linux Commands
    • Kali Linux Repository
    • Kali Linux Packages
    • Kali Linux root password
    • Kali Linux Alternative
  • Interview Questions
    • Linux Interview Questions
    • Linux System Administration Interview
    • Red Hat Interview Questions

Related Courses

Kali Linux Training

Linux Training Course

Red Hat Training Course

Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Java Tutorials
  • Python Tutorials
  • All Tutorials
Certification Courses
  • All Courses
  • Software Development Course - All in One Bundle
  • Become a Python Developer
  • Java Course
  • Become a Selenium Automation Tester
  • Become an IoT Developer
  • ASP.NET Course
  • VB.NET Course
  • PHP Course

© 2020 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA Login

Forgot Password?

EDUCBA
Free Software Development Course

Web development, programming languages, Software testing & others

*Please provide your correct email id. Login details for this Free course will be emailed to you
Book Your One Instructor : One Learner Free Class

Let’s Get Started

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA
Free Software Development Course

Web development, programming languages, Software testing & others

*Please provide your correct email id. Login details for this Free course will be emailed to you

Special Offer - Linux Training Program (16 Courses, 3+ Projects) Learn More