Linux “IP” Command Tutorial
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.
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.
So as we can see “wlan0” is currently working.
Now let’s shut down that interface.
Syntax : ip link set interface_name down
Now let’s turn on wlan0.
syntax : ip link set 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
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
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
Now let’s see ARP Table using the “ip” command. we can view/edit ARP table also.
ip neigh
Let’s see routing table list.
ip route list
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: