-: Ipconfig, ifconfig and ip. 2 2
In this video, we're going to cover the ipconfig, 3 3
ifconfig and ip command line tools 4 4
and how we use them in maintaining 5 5
and troubleshooting our networks. 6 6
First, we have ipconfig. 7 7
Ipconfig, or IP Configuration, is used to display 8 8
all of the current TCP IP network configuration values 9 9
and refreshes the DHCP and DNS settings 10 10
for a Windows client or server. 11 11
If you enter ipconfig at the command prompt, 12 12
you're going to get some basic information back 13 13
about the TCP IP network configuration 14 14
in use by your Windows client. 15 15
In this example, you could see my IPv6 link-local address, 16 16
my IPv4 address of 10.0.2.15, 17 17
my subnet mask of 255.255.255.0 18 18
and my default gateway of 10.0.2.2. 19 19
There isn't a whole lot of details here, 20 20
but it does give you the basics. 21 21
Now, for example, if I entered ipconfig 22 22
and my IP address was listed as 169.254.132.51, 23 23
that would indicate I have a DHCP issue, 24 24
because my computer is now assigned an APIPA address 25 25
or automatic private IP address value. 26 26
Now, if this was the case, I could try to get a new IP 27 27
by releasing and renewing my connection 28 28
or by rebooting my machine. 29 29
If that doesn't work, then I can troubleshoot 30 30
the DHCP server and ensure that it's functioning properly. 31 31
To release the current IP address, 32 32
you have to enter the ipconfig /release command 33 33
and hit ENTER. 34 34
At this point, you're going to see 35 35
your IP configuration displayed again, 36 36
this time showing you have no IPv4 address, 37 37
no subnet mask and no default gateway assigned. 38 38
To attempt to get a new DHCP address, 39 39
you're going to enter ipconfig /renew and then you press ENTER. 40 40
Now you're going to get an IPv4 address, a subnet mask 41 41
and a default gateway assigned through the DHCP DORA 42 42
or discover, offer, request and acknowledge process. 43 43
Now, you may remember that DHCP actually gives up 44 44
a bit more information though, right? 45 45
What is our DNS server's IP address? 46 46
When is my lease going to be obtained and when does it expire? 47 47
How can I find my Mac address 48 48
if I need to know the physical address 49 49
for some kind of troubleshooting of layer 2 issues? 50 50
All of these details simply aren't being displayed 51 51
when I type in ipconfig and hitting ENTER though. 52 52
So I want to enter ipconfig /all, 53 53
then I'll be able to see all these additional details 54 54
about my TCP IP configuration. 55 55
Now, here I can see my host name, MSEDGEWIN10. 56 56
I can also see a description of the model 57 57
of the network adapter 58 58
or the network interface card I have installed. 59 59
I can see the physical address 60 60
and the fact that DHCP is enabled on this machine, 61 61
as well as the auto configuration being enabled 62 62
if DHCP fails to get an IP address, 63 63
which means I can have an APIPA address assigned 64 64
if I need to. 65 65
I can also see the IP address and subnet mask, 66 66
just like I did in the summarized ipconfig version, 67 67
but now I also see my lease times of the issue 68 68
and expiration for that DHCP address. 69 69
I also see my default gateway, 70 70
my DHCP server and DNS servers' IP addresses. 71 71
That is a lot of information 72 72
and it can be really helpful to you as a network technician 73 73
during your troubleshooting efforts. 74 74
Next, we have ifconfig. 75 75
Now, ifconfig stands for interface configuration 76 76
and it's the command line tool used in Unix, 77 77
Linux and OS X systems to display IP address information 78 78
just like we did with ipconfig in Windows. 79 79
Ipconfig only works in Windows, 80 80
so if you're going to be working on a Unix, 81 81
Linux or OS X system, you have to use ifconfig. 82 82
Now, ifconfig is used to configure your network interfaces 83 83
and troubleshooting network connectivity issues. 84 84
If you enter the command, ifconfig by itself 85 85
and you press ENTER, the system is going to display 86 86
the status of the currently active interfaces. 87 87
If you only want to see a single interface though, 88 88
like en0, you can enter ifconfig en0. 89 89
Now, if you want to display 90 90
all the interfaces available on the system, 91 91
even if those interfaces are currently down, 92 92
you would enter, ifconfig -a, 93 93
which is like the /all command 94 94
that we used inside of Windows. 95 95
Now, the big difference here between ifconfig and ipconfig 96 96
is that you're going to get 97 97
the same amount of information with ifconfig 98 98
regardless of whether you're using it by itself, 99 99
with an active interface or with the -a option. 100 100
There's no brief version of it. 101 101
The only difference is the number of interfaces 102 102
that are going to be returned, 103 103
whether you're saying a single interface, 104 104
the active interfaces or all the interfaces. 105 105
Notice here, I typed in ifconfig and under en0, 106 106
you can see inet6, which list out my IPv6 address. 107 107
And I see inet, which is my IPv4 address, 108 108
which is 192.168.1.54. 109 109
All the other information I need is there too. 110 110
This includes things like my physical address 111 111
or Mac address, which is listed as ether, 112 112
my net mask or subnet mask, 113 113
which is shown in hexadecimal equivalent, 114 114
but it's still going to be equivalent to 255.255.255.0 115 115
like you're used to. 116 116
It's going to have the broadcast IP for this network 117 117
and the fact that this network is up. 118 118
As you can see by default, ifconfig has more details 119 119
than ipconfig does on a Windows client. 120 120
Now, if you need additional details, 121 121
you can enter ifconfig -v and then the interface. 122 122
The -v stands for verbose, 123 123
meaning tell me a lot about this thing. 124 124
So you can see here, I get a lot more details, 125 125
including the type of the connection, 126 126
in this case, it's WiFi, 127 127
the speed of the transmission for the uplinks and downlinks 128 128
and if the quality of service is enabled or not. 129 129
Ifconfig can also be used to control the network connection 130 130
and not simply display information about it. 131 131
If, for example, I want to turn off that connection, 132 132
I can use ifconfig down, 133 133
and this will shut down the network interface. 134 134
If I use ifconfig up, 135 135
this will activate that network interface. 136 136
If you're using static assignments on an interface, 137 137
you first need to shut down the interface 138 138
and then set the new address and subnet mask 139 139
and then you can activate the interface again 140 140
by using ifconfig up. 141 141
Remember, ifconfig down turns off 142 142
your network interface card and if you enter ifconfig up, 143 143
it'll turn that network interface card back on. 144 144
These are really important to remember, 145 145
because if you're not seeing any network connectivity 146 146
on a Linux client or server, 147 147
it could be that somebody mistakenly turned off 148 148
that network card and you just need to enter ifconfig up 149 149
to turn it back on. 150 150
Now, as of this recording, 151 151
ifconfig is considered officially deprecated, 152 152
which means it's now considered to be obsolete 153 153
in modern systems and network administrators 154 154
should instead be using the ip command, 155 155
which has replaced it. 156 156
That said, many systems still support ifconfig, 157 157
at least for now. 158 158
So you should still learn it 159 159
in case you're working on an older system. 160 160
Now, finally, we have ip. 161 161
The ip command is going to be used to assign an address 162 162
to a network interface 163 163
or configure a network interface perimeter on a Unix, 164 164
Linux or OS X operating system. 165 165
Ip is a newer tool and it was designed 166 166
as a modern replacement for ifconfig. 167 167
The ip command stands for internet protocol 168 168
and it supports all the same functions as the if command. 169 169
The ip command though can do a whole lot more. 170 170
Now, the ip command is actually an entire suite of tools 171 171
that supports not just configuring your interface address, 172 172
but also things like routing, creating tunnels 173 173
and much, much more that is way beyond the scope 174 174
of this particular course and this exam. 175 175
Now, instead I want to focus on how we can replace 176 176
the if command using what we learned 177 177
with similar features inside of the ip command suite. 178 178
Now first, if I want to display the configuration 179 179
of my interfaces, I can simply enter ip a, 180 180
instead of using ifconfig 181 181
and this is going to give me the same type of information. 182 182
The ip a stands for ip address 183 183
inside of the ip suite of tools. 184 184
Second, if I need to assign a static IP address 185 185
to an interface, I can use ip a add, 186 186
the IP address, dev, whatever device I'm using. 187 187
For example, this will set the IP address 188 188
to the device interface known as eth0 or ethernet zero 189 189
as 192.18.1.123. 190 190
Third, we can remove that static IP address 191 191
by entering ip a del, IP address, dev, device 192 192
and that will be able to take out that IP address 193 193
from that device. 194 194
Now, fourth, if we want to change our Mac address, 195 195
we can conduct Mac spoofing simply 196 196
by entering ip link set dev, the device, 197 197
in this case eth0, address, 198 198
and the Mac address we want to use. 199 199
In this case, 00:11:22:33:44:55 200 200
or whatever other Mac address you want to use. 201 201
Fifth, if you want to make your network interface card operate 202 202
in promiscuous mode, 203 203
this will allow it to listen to all the traffic on a network 204 204
and not just the traffic destined for its own Mac address. 205 205
To do this, you can enter IP link set dev, your device, 206 206
eth0 in this case, promisc on. 207 207
This is really useful if you're setting up a packet sniffer 208 208
or a packet capture on a Linux client or a server. 209 209
Finally, if you need to disable 210 210
or enable a network interface, 211 211
you can use ip link set eth0 down 212 212
to turn off eth0 213 213
or ip link set eth0 up 214 214
to turn it back on. 215 215
Now, we really only just scratched the surface 216 216
of what the ip command can do, 217 217
but if you're working heavily with Linux systems, 218 218
I recommend you spend a little time learning 219 219
more about the ip command 220 220
and all the different functions it has. 221 221
For this certification exam though, 222 222
we covered exactly what you need to know 223 223
to make sure you're successful on test day. 224 224
(upbeat music)