Welcome to this lecture.
Now let's see how Kansas sends the mascot races.
So first of all what you need to do is again open that bison that we did in the previous lecture so
you could see we just see how we can get the Mac got into mascot ADDRESS OF THIS MUST from this court.
But now what we need to do is change the mascot.
So before that you could see this code looks like you basically are in the single line and basically
this doesn't define the perfect chord because it is not inside a sorting block.
That means this look a bunch of very dirty coding.
So first of all we will make the funds and that is going to do this for us.
So I'll just make this cut into Mac funds and and this funds and is going through this written us this
MAC addresses.
So let me just copy again everything.
And let me just paste it down here in this current Mac and instead of just printing it over here you
can also print.
OK we will just print here.
So this is basically our current Mac that we did in the previous lecture but for now we have to now
see how we can things the macro risks and this is very important.
So first of all let me just go back to the documentation and ability so I knew before that if you want
to execute any command on this start I mean a lot of skill you have to use these saw process module.
So we have already seen the x and that is take output the method already seen that how this execute
the command and returned output which was our mac address.
Now we're going to use another method and this is very very very important method which is this call
method.
So let's see what this tell us about.
So first of all it is saying it will run the command.
Okay described by the arguments.
Okay.
We are just splicing the arguments and do this run that command based on that argument and it will wait
for command to complete and then return the return chord attribute.
That means if we just see and go back what we did before so we are thus out of this terminal.
So that means going again.
So if we see what we did in the previous lecture was first of all we just sat there something like I
have config and I will land zero down.
So basically this was the command in order to get our interface down before actually changing the MAC
addresses.
So if you see any fuses analyze this command this command used to be the first command in our list of
commands that was used to turn the MAC addresses.
So if you see here if we just do something like before it before actually just writing this down this
statement if you just start there just actually using this Mac sensor or any other maybe this command
I have config and if you want do this since the W land 0 and the you know maybe the ether apart what
I'm doing so it part and your MAC address is maybe this zero.
If you do this before actually this making your interface down and then this is not going to work.
So that means the sequence of this operation is very important in order to work with the Mac Tens.
So first of all you have to always down your network card.
After that you will just change your MAC address and after that you'll just make your network interface
again running.
So that is the sequence of the operation that should be executed.
And this call method is just saying us is that so before actually just jumping on the intruder argument
or another come on it will wait for that command to complete.
And after that is executed if we just get the return call that means the first command is executed it
will just go to the second command and it will just run that command.
Let's see how this works and how this is basically going to give us the new mac addresses.
So first of all this define the method to do that and others say it sends a Mac.
SO THIS GAME INTERFACE over here.
And next thing I want to give is a new Mac.
So what we just did here is before that I have to this input something from the user.
That is your interface and your new Mac.
So all the same input and I have to give the masses to the user into your interface or network interface
so this will be the information they will just give the information.
Let me just strip this because we don't want any blank spaces.
And basically this will just give us the perfect interface ops not input from the user.
And I was certain one.
The new mac addresses that is imputed by the user.
So I want into the new mac address.
You One two things OK.
This will be also in the string because we know anything that is from this input method it will be in
a string.
I want to strip this to
so we have now interface and new make while calling this since Mac will just pass this interface a new
Mac in the port is not argument of this interface a new Mac.
So let's go over here and let's run our Linux command since the Mac.
So you know how to just sit on this command.
Now we're not going to use these Scimitar which is tech output.
Now we are going to run the next command which will be called command.
So in this call command you have to just give this list of arguments that is in the form of list.
So I say I have config and the next part will be your interface.
So let me just convert to a string and allow the same interface that is parsed in this Mac and after
users pass the interface.
Let me run the first command.
We are going to get.
So that command will be down command.
So first of all you have to run this down command.
And that's to run in the cell.
That means that this is the cells would be true.
So this will be the first command that will be executed and you can clearly see over here if you see
the combination this is going to give us.
Let me let me just come in.
These are real quick here.
So this is going to give us I have config OK what I'm writing here.
I have config and basically this space is to denote this space.
So next will be your interface because this is not going to give any spaces that means we have to this
assigned explicitly the spaces between these commands and the next one after that is going to the interface.
So interface will be double and zero if I just enter from here.
And after that interface this is also given the explicitly spaces because we want these spaces between
this double and zero and down command.
And after that we just into the down.
So this is the command that is from this sub process.
And after this is executed we have to this call and not propose this again and that is your thought
process are basically changing the main MAC addresses of this gone into Mac.
So I'll also say I can fake
and give this space again is useful and add the interface which will be typecast it to this string let's
say interface.
And after that you know what to do we have done this many times before.
So now I have to give you space again because I won this eater attribute of the argument Louboutins
to the MAC address.
So I'll just say again this would be sends to the macro risks that we just input.
So I'll just say A.
And here as this parse new Mac and let me just give one space again over here.
So this will be end of this is statement again.
And after you despise this Come on you have to say that this is sale and if should be true.
So we have command here that is executed in order to change our mac addresses MAC address physical.
So next one would be to make your I O basically invert the interface up and running so in order to do
that you know what to call that d d up method.
So instead of just writing again let me just copy this because the chains between this statement and
the statement we're writing is only the up to down a critical down to size the.
So you can see we have now since the MAC addresses and now we have got these new mac addresses into
from the user will just saying these two things Mac and we'll see things in the MAC address.
So what I'm going to do is now I have to call this it sends Mac and that should be done over here as
the space the interface in the place of interface has this past the new Mac in the place of a new Mac
to have done this.
So let's see if this works or not.
So before that let me say current Mac.
So this was the current makeover here and I'll just put that in the second Mac and turn this.
So before current Mac let me just say that first of all this will be all Mac is.
And let me just format this with this current Mac
let me just close this.
So now we have this MAC address cams saying address all mac addresses the format rule here will this
see that the current Mac and Apple that will this thing that current Mac so before that I have to this
see the way it is called OK.
It is super is current Mac it's called an apple that we have called that's in the microwave.
That is fine.
So let's run this mechanism and let's see what is a social network interface.
I want to change these w Lanzarote so into the new mac address you want buttons.
OK I want to change to this MAC address.
Let's go with another MAC addresses two things.
And let me just run this one more time so let me the space to run again and let me say the interface
will be again the land zero which is my wireless card into the new mac address.
Let me say one two three three four five.
9 2 9 3 2 2.
Let me see.
OK.
It is six part.
It is having the six part.
Let me see it into and let's see if this is working or not so it is perfectly working now.
Let's go and now let's only take for the current Mac.
So let's remove calling this one and let's see if this works or not so let's see if we have sense from
this MAC addresses which was this current all Mac to this.
So obviously we have done this.
But let me just.
So so Katie's again axing but it does it doesn't matter.
We've done that
run this again.
Now we do so you the MAC addresses that is the new mac address is we just assigned from this content
or basically from these teen's Mac.
So we just found that we just execute this command on this cell and we just change the current Mac to
the MAC addresses that we just entered from here.
So this is the perfect example of how to change the MAC addresses but you can see here this MAC addresses
was intel from the user.
What if we want a random MAC addresses.
So we will just implement that random MAC addresses assignment in the next lecture which will be also
the interesting lecture.
So see you in the next one.