1
00:00:00,000 --> 00:00:19,440
Hey guys and welcome back. Now so far throughout this skill we have been using these deprecated

2
00:00:19,440 --> 00:00:27,199
and outdated commands. The commands we saw so far were IF config as well as the ARP

3
00:00:28,000 --> 00:00:35,920
and lastly we just saw the root command. Now all of these commands ultimately are now replaced

4
00:00:35,920 --> 00:00:42,799
with the IP command. So really in modern terms if you want to make changes to your interfaces,

5
00:00:42,799 --> 00:00:48,640
display or update your ARP cache or to display or update your routing table you really aren't going

6
00:00:48,640 --> 00:00:54,960
to be using any of these tools unless you happen to be on a fairly older distribution. And the IP

7
00:00:54,960 --> 00:01:01,520
command does not just replace the functionality of these three commands it can also do a whole bunch

8
00:01:01,520 --> 00:01:07,120
more. So why don't we go and explore this command and see how we can actually begin to use it then.

9
00:01:07,120 --> 00:01:12,719
So what I will do is I will clear my screen. Now you will recall we used the IF config command and

10
00:01:12,719 --> 00:01:19,200
we can see things such as the IP address. Now like I say we can pull out the same information

11
00:01:19,200 --> 00:01:25,840
using the IP command. Now the IP command has a lot of options. If we want to get IP address

12
00:01:25,840 --> 00:01:33,840
information the command is going to be IP adder. So if we say IP adder show and hit enter we actually

13
00:01:33,840 --> 00:01:39,760
get the same information albeit it is presented a little differently. So we can see here from the

14
00:01:39,760 --> 00:01:46,400
IF config we actually can tell the interface and then the inet command or rather the inet keyword

15
00:01:46,400 --> 00:01:52,400
tells us the IP address. In this case here it is presented a little bit differently but we can still

16
00:01:52,400 --> 00:01:57,920
see the interface in this case the ethernet interface and all the related information and

17
00:01:57,920 --> 00:02:04,320
within this information we can still see our inet address. One of the main differences is that the

18
00:02:04,320 --> 00:02:12,240
address here happens to use what is called sidernotation that is your slash 24 mask whereas IF config

19
00:02:12,320 --> 00:02:21,200
actually tells you the network mask using the format of 255.255.255.0 but ultimately we can get

20
00:02:21,200 --> 00:02:27,280
the same information we can tell which interface has which IP address just like we could with the

21
00:02:27,280 --> 00:02:33,120
IF config command and again here the look back is the same. Here is this interface with the IP

22
00:02:33,120 --> 00:02:39,600
address again with sidernotation slash 8 mask. Now remember we could use the IF config command to

23
00:02:39,599 --> 00:02:45,120
actually make modifications with respect to our interface configuration like I say we can do the

24
00:02:45,120 --> 00:02:51,439
same thing with the IP command. This time when we want to make a change say for example to an IP

25
00:02:51,439 --> 00:02:57,680
address we would say sudo ip and we'll say adder because you want to modify an address and now

26
00:02:57,680 --> 00:03:06,479
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

27
00:03:06,479 --> 00:03:14,319
as we did before as opposed to using the notation of 255.255.255.0 I will use the sidernotation

28
00:03:14,319 --> 00:03:24,079
to slash 24 and I'll specify the interface that I want to target so I will say dev enp0 s3 and if

29
00:03:24,079 --> 00:03:33,120
I hit enter so now if I do my ip adder show notice here is that on this interface we still have our

30
00:03:33,120 --> 00:03:42,400
original IP address but we also have a global secondary IP address and that IP address is 192.168.0.50

31
00:03:42,400 --> 00:03:48,080
just as we specified so one big difference to note is that when we happen to update our IP

32
00:03:48,080 --> 00:03:54,960
address using the if config command the IP address ultimately deletes and replaces the old

33
00:03:54,960 --> 00:04:01,280
configuration whereas when we're using the ip adder command by adding an IP address we have just

34
00:04:01,280 --> 00:04:08,319
added a secondary IP address and didn't actually delete this one so if I wanted to delete this IP

35
00:04:08,319 --> 00:04:15,439
address I could just add a whip and I will use the keyword del and hit enter if I now do ip adder

36
00:04:15,439 --> 00:04:22,480
show suddenly that IP address has been removed once again so realistically if I wanted to change

37
00:04:22,560 --> 00:04:31,840
this IP address to 50 I would add it as 50 and then I would delete my IP address of .65 now again

38
00:04:31,840 --> 00:04:37,200
once I do this I will drop my connection so I'll hit enter and my connection drops because

39
00:04:37,200 --> 00:04:43,600
I'm connecting over ssh so I'll just go back to my virtual machine itself open this I will log in

40
00:04:43,600 --> 00:04:51,920
go to terminal emulator I'll say ip adder show and lo and behold this interface has effectively

41
00:04:51,920 --> 00:04:58,080
replaced the old IP address with this new IP address and notice this is no longer a secondary

42
00:04:58,080 --> 00:05:03,759
global IP address so I'll just quickly change this back so I'll add this type in my password

43
00:05:03,759 --> 00:05:11,680
open I've mistyped this that should be en okay and I will delete my .50 we do an ip adder show

44
00:05:11,680 --> 00:05:16,879
and the ip address is back to the way it was before now if I wanted to make a change to the

45
00:05:16,959 --> 00:05:22,719
interface such as maybe setting the promiscuous flag as we saw before remember with the if

46
00:05:22,719 --> 00:05:28,719
config outputs within the particular flags we could effectively change this to add the promisc

47
00:05:28,719 --> 00:05:36,000
flag we can do the same thing with the ip command this time we will use ip link I'll say sudo ip

48
00:05:36,000 --> 00:05:43,040
link and then I want to set and then specify my interface that I'm targeting so enp0 s3

49
00:05:43,040 --> 00:05:48,879
and I will say promisc on so the effect here is if I happen to use the deprecated command

50
00:05:48,879 --> 00:05:54,960
if config we can now see we've actually modified this to be promiscuous but alternatively we could

51
00:05:54,960 --> 00:06:03,439
say ip link show and within here we can see the interface and the promisc flag is indeed set and

52
00:06:03,439 --> 00:06:09,600
once again if you want to reverse this we could just say promisc off and to enter ip link show

53
00:06:09,600 --> 00:06:16,080
the promisc flag has now been removed again now if I want to be able to view my routing table as

54
00:06:16,080 --> 00:06:22,240
opposed to just using the root command what I can say is say ip root show and within here we are

55
00:06:22,240 --> 00:06:29,439
seeing our routing table we can see the default route is via 192.1680.1 that is my home router

56
00:06:29,439 --> 00:06:36,800
and we can see my local network of 192.1680.0 slash 24 and if I wanted to find out some

57
00:06:36,800 --> 00:06:43,360
ARP information let's maybe say the MAC address of my gateway here as opposed to using the ARP

58
00:06:43,360 --> 00:06:51,759
command I could say ip ne show ne for neighbor so if I actually hit enter here we can see here

59
00:06:51,759 --> 00:06:58,800
this is the ip address and we can see the layer 2 address i.e the MAC address is this one right

60
00:06:58,800 --> 00:07:05,439
here so we can identify this directly via the ip ne show command now if I wanted to delete a particular

61
00:07:05,439 --> 00:07:16,560
entry I could say ip ne del for delete and then I would specify a particular entry let's say 192.1680.51

62
00:07:16,560 --> 00:07:26,159
and then specify the device which is dev enp0 s3 that is the interface we're targeting enp0 s3 if I

63
00:07:26,159 --> 00:07:33,920
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

64
00:07:33,920 --> 00:07:40,319
has actually been removed from the ARP cache now similarly if we want to actually add a new root

65
00:07:40,319 --> 00:07:47,439
to our routing table manually via the ip command we can see sudo ip root and we will add and I'll

66
00:07:47,439 --> 00:07:57,040
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

67
00:07:57,040 --> 00:08:03,120
how do we actually get to this remote network well we know the way we get to a remote network

68
00:08:03,120 --> 00:08:08,480
from our local network is via the default gateway so what is the ip address of the default gateway

69
00:08:08,480 --> 00:08:17,040
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

70
00:08:17,040 --> 00:08:22,639
entry into our routing table and again if you want to delete this I could just change this

71
00:08:22,639 --> 00:08:30,480
keyword from add to del we will now be updated ip root show and suddenly that root has been removed

72
00:08:30,480 --> 00:08:36,240
once again so as we can see here a lot of what we learned with respect to if config the ARP command

73
00:08:36,240 --> 00:08:42,879
and the root command all of it is very very relevant with respect to the ip command this command gives us

74
00:08:42,879 --> 00:08:48,320
a whole suite of tools to control these different features and functionalities but like I say the

75
00:08:48,320 --> 00:08:55,600
ip command gives us even more than all those three prior tools together so that is us for the ip

76
00:08:55,600 --> 00:09:02,720
command I hope this has been informative for you and I'd like to thank you for viewing

