Hey guys and welcome back. Now so far throughout this skill we have been using these deprecated
and outdated commands. The commands we saw so far were IF config as well as the ARP
and lastly we just saw the root command. Now all of these commands ultimately are now replaced
with the IP command. So really in modern terms if you want to make changes to your interfaces,
display or update your ARP cache or to display or update your routing table you really aren't going
to be using any of these tools unless you happen to be on a fairly older distribution. And the IP
command does not just replace the functionality of these three commands it can also do a whole bunch
more. So why don't we go and explore this command and see how we can actually begin to use it then.
So what I will do is I will clear my screen. Now you will recall we used the IF config command and
we can see things such as the IP address. Now like I say we can pull out the same information
using the IP command. Now the IP command has a lot of options. If we want to get IP address
information the command is going to be IP adder. So if we say IP adder show and hit enter we actually
get the same information albeit it is presented a little differently. So we can see here from the
IF config we actually can tell the interface and then the inet command or rather the inet keyword
tells us the IP address. In this case here it is presented a little bit differently but we can still
see the interface in this case the ethernet interface and all the related information and
within this information we can still see our inet address. One of the main differences is that the
address here happens to use what is called sidernotation that is your slash 24 mask whereas IF config
actually tells you the network mask using the format of 255.255.255.0 but ultimately we can get
the same information we can tell which interface has which IP address just like we could with the
IF config command and again here the look back is the same. Here is this interface with the IP
address again with sidernotation slash 8 mask. Now remember we could use the IF config command to
actually make modifications with respect to our interface configuration like I say we can do the
same thing with the IP command. This time when we want to make a change say for example to an IP
address we would say sudo ip and we'll say adder because you want to modify an address and now
I'll use the keyword add and from this point here I can just add in my new IP address I'll say 192.168.0.50
as we did before as opposed to using the notation of 255.255.255.0 I will use the sidernotation
to slash 24 and I'll specify the interface that I want to target so I will say dev enp0 s3 and if
I hit enter so now if I do my ip adder show notice here is that on this interface we still have our
original IP address but we also have a global secondary IP address and that IP address is 192.168.0.50
just as we specified so one big difference to note is that when we happen to update our IP
address using the if config command the IP address ultimately deletes and replaces the old
configuration whereas when we're using the ip adder command by adding an IP address we have just
added a secondary IP address and didn't actually delete this one so if I wanted to delete this IP
address I could just add a whip and I will use the keyword del and hit enter if I now do ip adder
show suddenly that IP address has been removed once again so realistically if I wanted to change
this IP address to 50 I would add it as 50 and then I would delete my IP address of .65 now again
once I do this I will drop my connection so I'll hit enter and my connection drops because
I'm connecting over ssh so I'll just go back to my virtual machine itself open this I will log in
go to terminal emulator I'll say ip adder show and lo and behold this interface has effectively
replaced the old IP address with this new IP address and notice this is no longer a secondary
global IP address so I'll just quickly change this back so I'll add this type in my password
open I've mistyped this that should be en okay and I will delete my .50 we do an ip adder show
and the ip address is back to the way it was before now if I wanted to make a change to the
interface such as maybe setting the promiscuous flag as we saw before remember with the if
config outputs within the particular flags we could effectively change this to add the promisc
flag we can do the same thing with the ip command this time we will use ip link I'll say sudo ip
link and then I want to set and then specify my interface that I'm targeting so enp0 s3
and I will say promisc on so the effect here is if I happen to use the deprecated command
if config we can now see we've actually modified this to be promiscuous but alternatively we could
say ip link show and within here we can see the interface and the promisc flag is indeed set and
once again if you want to reverse this we could just say promisc off and to enter ip link show
the promisc flag has now been removed again now if I want to be able to view my routing table as
opposed to just using the root command what I can say is say ip root show and within here we are
seeing our routing table we can see the default route is via 192.1680.1 that is my home router
and we can see my local network of 192.1680.0 slash 24 and if I wanted to find out some
ARP information let's maybe say the MAC address of my gateway here as opposed to using the ARP
command I could say ip ne show ne for neighbor so if I actually hit enter here we can see here
this is the ip address and we can see the layer 2 address i.e the MAC address is this one right
here so we can identify this directly via the ip ne show command now if I wanted to delete a particular
entry I could say ip ne del for delete and then I would specify a particular entry let's say 192.1680.51
and then specify the device which is dev enp0 s3 that is the interface we're targeting enp0 s3 if I
hit enter oh of course have to do a sudo to make a change and I do ip ne show notice now the ARP entry
has actually been removed from the ARP cache now similarly if we want to actually add a new root
to our routing table manually via the ip command we can see sudo ip root and we will add and I'll
just add 192.168.50.0 and make it a slash 24 mask and I will use the keyword via to be able to specify
how do we actually get to this remote network well we know the way we get to a remote network
from our local network is via the default gateway so what is the ip address of the default gateway
it's 192.168.0.1 so if I hit enter now and I say ip root show we can see here we have added a new
entry into our routing table and again if you want to delete this I could just change this
keyword from add to del we will now be updated ip root show and suddenly that root has been removed
once again so as we can see here a lot of what we learned with respect to if config the ARP command
and the root command all of it is very very relevant with respect to the ip command this command gives us
a whole suite of tools to control these different features and functionalities but like I say the
ip command gives us even more than all those three prior tools together so that is us for the ip
command I hope this has been informative for you and I'd like to thank you for viewing