Linux “IP” Command Tutorial

Raj Upadhyay
3 min readSep 13, 2020

--

The IP command is a Linux net-tool for system and network administrators. IP stands for Internet Protocol and as the name suggests, the tool is used for configuring network interfaces.

‘ip’ command lets you view + change network configuration.

Let’s learn how to use the “ip” command.

Syntax: ip OBJECT COMMAND

where OBJECT can be addr, link, neigh, etc. and COMMAND can be add, show, delete, etc.

Let’s first type “ip” in the terminal and see what’s we get.

IP

we can use full or abbreviated forms like “ip addr” and “ip a” will give the same results.

1. Let’s shutdown wifi interface using the ip command.

So firstly let’s check all interfaces connected to the system via the “ifconfig” command.

ifconfig

So as we can see “wlan0” is currently working.

Now let’s shut down that interface.

Syntax : ip link set interface_name down
wlan0 shut down

Now let’s turn on wlan0.

syntax : ip link set wlan0 up
wlan0 up

So this is how we can shut-down any interface or turn on them.

Now Let’s see how we can change the MAC address using the “ip” command.

“It’s a good habit to change your MAC address when you are accessing Free wifi networks like cafe’s wifi or airport wifi etc.

First, let’s check the MAC address for the eth0 interface.

ifconfig
MAC address for eth0 interface

So we can see the MAC address is 30:a9:f4:d1:00:32. Now let’s change it.

ip link set eht0 address 3a:11:11:11:11:11
changed MAC address

yay, we changed our MAC address. So this is how we can successfully change our MAC address. But remember this change will remain this way until we reboot our system (restart the system).

Let’s check all IP address of the device.

ip addr list
ip addr

Now let’s see ARP Table using the “ip” command. we can view/edit ARP table also.

ip neigh
ARP Table.

Let’s see routing table list.

ip route list
routing table

To see all routing tables use the following command.

ip route list table all

So that’s all for this tutorial. Hope you get some new information.

Thank you.

Reference:

https://wizardzines.com

--

--

Raj Upadhyay
Raj Upadhyay

Written by Raj Upadhyay

DFIR Consultant || #LoveToPlayCTF #infosec #cybersecurity #4n6

No responses yet