In this video, we're going to cover
the ipconfig, ifconfig, and ip command line tools
and how we use them in maintaining and troubleshooting
our networks.
First, we have ipconfig.
ipconfig, or IP configuration is used to display
all of the current TCP/IP network configuration values
and refreshes the DHCP and DNS settings
for a Windows client or server.
If you enter ipconfig at the command prompt,
you're going to get some basic information back
about the TCP/IP network configuration
in use by your Windows client.
In this example, you can see my IPv6 link local address,
my IPv4 address of 10.0.2.15,
my subnet mask of 255.255.255.0,
and my default gateway of 10.0.2.2.
There isn't a whole lot of details here,
but it does give you the basics.
Now, for example, if I entered ipconfig
and my IP address was listed as 169.254.132.51,
that would indicate I have a DHCP issue
because my computer is now assigned an APIPA address
or Automatic Private IP Address value.
Now, if this was the case, I could try to get a new IP
by releasing and renewing my connection
or by rebooting my machine.
If that doesn't work,
then I can troubleshoot the DHCP server
and ensure that it's functioning properly.
To release the current IP address,
you have to enter the ipconfig /release command
and hit enter.
At this point, you're going to see
your IP configuration displayed again,
this time showing you have no IPv4 address, no subnet mask,
and no default gateway assigned.
To attempt to get a new DHCP address,
you're going to enter ipconfig /renew,
and then you press enter.
Now you're going to get an IPv4 address, a subnet mask,
and a default gateway assigned through the DHCP DORA
or Discover, Offer, Request, and Acknowledge process.
Now, you may remember that DHCP actually gives up
a bit more information though, right?
What is our DNS servers IP address?
When is my lease going to be obtained and when does it expire?
How can I find my Mac address
if I need to know the physical address
for some kind of troubleshooting of Layer 2 issues?
All of these details simply aren't being displayed
when I type in ipconfig and hitting enter though,
so I want to enter ipconfig /all.
Then I'll be able to see all these additional details
about my TCP/IP configuration.
Now here I can see my host name, MSEDGEWIN10,
I can also see a description
of the model of the network adapter,
or the network interface part I have installed.
I can see the physical address
and the fact that DHCP is enabled on this machine,
as well as the autoconfiguration being enabled
if DHCP fails to get an IP address,
which means I can have an APIPA address assigned
if I need to.
I can also see the IP address and subnet mask
just like I did in the summarized ipconfig version,
but now I also see my lease times
of the issue and expiration for that DHCP address.
I also see my default gateway,
my DHCP server and DNS servers IP addresses.
That is a lot of information
and it can be really helpful to you as a network technician
during your troubleshooting efforts.
Next, we have ifconfig.
Now ifconfig stands for interface configuration,
and it's the command line tool used in Unix, Linux,
and OS X systems to display IP address information
just like we did with ipconfig in Windows.
ipconfig only works in Windows,
so if you're going to be working
on a Unix, Linux, or OSX system, you have to use ifconfig.
Now, ifconfig is used to configure your network interfaces
and troubleshoot network connectivity issues.
If you enter the command ifconfig by itself
and you press enter, the system is going to display
the status of the currently active interfaces.
If you only want to see a single interface though, like en0,
you can enter ifconfig en0.
Now, if you want to display
all the interfaces available on a system,
even if those interfaces are currently down,
you would enter ifconfig -a,
which is like the slash all command
that we used inside of Windows.
Now, the big difference here between ifconfig and ipconfig
is that you're going to get
the same amount of information with ifconfig,
regardless of whether you're using it by itself,
with an active interface, or with the dash-a option.
There's no brief version of it, the only difference
is the number of interfaces that are going to be returned,
whether you're saying a single interface,
the active interfaces, or all the interfaces.
Notice here I typed in ifconfig,
and under en0 you can see inet6,
which lists out my IPv6 address.
And I see inet, which is my IPv4 address,
which is 192.168.1.54.
All the other information I need is there too.
This includes things like my physical address
or Mac address, which is listed as ether,
my net mask or subnet mask,
which is shown in hexadecimal equivalent,
but it's still going to be equivalent to 255.255.255.0
like you're used to.
It's going to have the broadcast IP for this network
and the fact that this network is up.
As you can see, by default,
ifconfig has more details than ipconfig does
on a Windows client.
Now, if you need additional details,
you can enter ifconfig dash-v and then the interface.
The dash-v stands for verbose,
meaning tell me a lot about this thing.
So you can see here I get a lot more details
including the type of the connection,
in this case, it's wifi,
the speed of the transmission for the uplinks and downlinks,
and if the quality of service is enabled or not.
ifconfig can also be used to control the network connection
and not simply display information about it.
If, for example, I want to turn off that connection,
I can use ifconfig down,
and this will shut down the network interface.
If I use ifconfig up,
this will activate that network interface.
If you're using static assignments on an interface,
you first need to shut down that interface
and then set the new address and subnet mask,
and then you can activate the interface again
by using ifconfig up.
Remember, ifconfig down
turns off your network interface card,
and if you enter ifconfig up,
it'll turn that network interface card back on.
These are really important to remember
because if you're not seeing any network connectivity
on a Linux client or server,
it could be that somebody mistakenly turned off
that network card
and you just need to enter ifconfig up to turn it back on.
Now, as of this recording,
ifconfig is considered officially deprecated,
which means it's now considered to be
obsolete in modern systems,
and network administrators should instead be using
the ip command, which has replaced it.
That said, many systems still support ifconfig,
at least for now, so you should still learn it
in case you're working on an older system.
Now, finally, we have ip.
The ip command is going to be used to assign an address
to a network interface
or configure a network interface parameter
on a Unix, Linux, or OSX operating system.
ip is a newer tool
and it was designed as a modern replacement for ifconfig.
The ip command stands for internet protocol
and it supports all the same functions as the if command.
The ip command though can do a whole lot more.
Now the ip command is actually an entire suite of tools
that supports not just configuring your interface address,
but also things like routing, creating tunnels,
and much, much more that is way beyond the scope
of this particular course and this exam.
Now, instead, I want to focus
on how we can replace the if command using what we learned
with similar features inside of the ip command suite.
Now first, if I want to display
the configuration of my interfaces,
I can simply enter ip space a instead of using ifconfig,
and this is going to gimme the same type of information.
The ip space a stands for ip space address
inside of the ip suite of tools.
Second, if I need to assign
a static IP address to an interface,
I can use ip space a space add the IP address space dev
space whatever device I'm using.
For example, this will set the IP address
to the device interface known as eth0 or ethernet zero,
as 192.168.1.123.
Third, we can remove that static ip address
by entering ip space a space del space ip address
space dev space device,
and that will be able to take out that ip address
from that device.
Now fourth, if we want to change our Mac address,
we can conduct Mac spoofing simply by entering
ip space link space set space dev space the device,
in this case eth0, space address space,
and the Mac address you want to use,
in this case 00:11:22:33:44:55
or whatever other Mac address you want to use.
Fifth, if you want to make your network interface card
operate in promiscuous mode,
this will allow it to listen to all the traffic on a network
and not just the traffic destined for its own Mac address.
To do this, you can enter ip space link space set space dev
space your device, eth0 in this case,
space promisc space on.
This is really useful if you're setting up a packet sniffer
or a packet capture on a Linux client or a server.
Finally, if you need to disable
or enable a network interface,
you can use ip space link space set space eth0 space down
to turn off eth0,
or ip link set eth0 up to turn it back on.
Now we really only just scratched the surface
of what the ip command can do,
but if you're working heavily with Linux systems,
I recommend you spend a little time
learning more about the ip command
and all the different functions it has.
For this certification exam, though,
we covered exactly what you need to know
to make sure you're successful on test day.