1
00:00:02,520 --> 00:00:06,687
(electricity crackling over pulsing tones)

2
00:00:08,890 --> 00:00:11,790
- In this video I'd like to
talk about a classification

3
00:00:11,790 --> 00:00:15,937
feature of Cisco IOS called Access-Lists.

4
00:00:15,937 --> 00:00:17,367
Now you might be wondering,

5
00:00:17,367 --> 00:00:19,531
what do you mean by
classification feature?

6
00:00:19,531 --> 00:00:23,259
That's what I'm going to talk about.

7
00:00:23,259 --> 00:00:27,186
So there are many
features within Cisco IOS

8
00:00:27,186 --> 00:00:31,232
that allow you to look for certain things.

9
00:00:31,232 --> 00:00:33,915
Look for certain things in
data that's passing through

10
00:00:33,915 --> 00:00:36,507
your switch or through your router.

11
00:00:36,507 --> 00:00:40,530
Because you want to identify
something and then based on

12
00:00:40,530 --> 00:00:43,135
if what you're looking for is matching,

13
00:00:43,135 --> 00:00:46,792
you wanna do something to
that frame or that packet

14
00:00:46,792 --> 00:00:49,248
that matches what you're looking for.

15
00:00:49,248 --> 00:00:52,836
So a lot of times in Cisco
IOS, features are divided

16
00:00:52,836 --> 00:00:55,075
into two separate sections.

17
00:00:55,075 --> 00:00:57,111
You've got a feature that you configure

18
00:00:57,111 --> 00:00:59,542
to say this is what I'm looking for.

19
00:00:59,542 --> 00:01:02,935
Like I'm looking for this
particular destination IP address,

20
00:01:02,935 --> 00:01:05,751
or I'm looking for this
particular MAC address,

21
00:01:05,751 --> 00:01:09,061
or I'm looking for a packet
that's a certain size,

22
00:01:09,061 --> 00:01:10,998
or a whole variety of things.

23
00:01:10,998 --> 00:01:13,148
So there's features that say
this is what I'm looking for,

24
00:01:13,148 --> 00:01:16,113
and you program those, you type those in.

25
00:01:16,113 --> 00:01:19,095
And then there's other
features that refer to

26
00:01:19,095 --> 00:01:22,743
those identification or those
classification features.

27
00:01:22,743 --> 00:01:25,930
And those other features say
okay, if you find a packet

28
00:01:25,930 --> 00:01:27,528
that matches what you're looking for,

29
00:01:27,528 --> 00:01:30,062
tell me and I'm gonna do something to it.

30
00:01:30,062 --> 00:01:32,433
And maybe one feature will
say I'm going to encrypt

31
00:01:32,433 --> 00:01:35,792
that packet and we'll take the
data and sort of garble it up

32
00:01:35,792 --> 00:01:39,177
so that if anybody happens to
see it while it's in transit

33
00:01:39,177 --> 00:01:41,480
they won't be able to tell
what's in the payload,

34
00:01:41,480 --> 00:01:42,637
what's in the data.

35
00:01:42,637 --> 00:01:43,911
There are other features that say:

36
00:01:43,911 --> 00:01:47,415
okay I'm a security feature,
if a packet matches you

37
00:01:47,415 --> 00:01:50,448
classification tool, tell
me and then I'll make sure

38
00:01:50,448 --> 00:01:52,999
it gets dropped or I'll
make sure it gets forwarded

39
00:01:52,999 --> 00:01:55,269
and there's a lot of other
things like that as well.

40
00:01:55,269 --> 00:01:58,174
So a lot of times in Cisco
IOS we have this separation

41
00:01:58,174 --> 00:02:01,791
between various tools you can
use to identify or classify

42
00:02:01,791 --> 00:02:04,510
things and then you can
associate those tools

43
00:02:04,510 --> 00:02:07,184
with other tools that
actually do something,

44
00:02:07,184 --> 00:02:10,341
that take some action on
what has been identified.

45
00:02:10,341 --> 00:02:13,423
And an access list is one
example of those tools

46
00:02:13,423 --> 00:02:15,756
that are for classification.

47
00:02:17,359 --> 00:02:20,733
So Access-Lists are
specifically designed to look

48
00:02:20,733 --> 00:02:23,733
for Layer 3 and Layer 4 information.

49
00:02:26,159 --> 00:02:28,376
There actually are MAC Access-Lists

50
00:02:28,376 --> 00:02:31,000
that you can also configure to
look for Layer 2 information

51
00:02:31,000 --> 00:02:35,167
but we don't really go into
those at all at the CCNA level.

52
00:02:37,177 --> 00:02:41,349
So when you create an Access-List,
think of an Access-List

53
00:02:41,349 --> 00:02:45,496
as being like a container of
several different statements.

54
00:02:45,496 --> 00:02:48,046
Maybe one statement is
I'm looking for a packet

55
00:02:48,046 --> 00:02:49,884
with this specific destination.

56
00:02:49,884 --> 00:02:52,173
Maybe another statement is,
I'm looking for a packet

57
00:02:52,173 --> 00:02:55,643
with this particular source
and then that grouping

58
00:02:55,643 --> 00:02:59,908
of entries, we give it
some sort of identifier.

59
00:02:59,908 --> 00:03:03,490
So with Access-List, that
identifier could be a number.

60
00:03:03,490 --> 00:03:07,203
For example, I could say
I have Access-List 101

61
00:03:07,203 --> 00:03:11,627
and Access-List 101 has
15 or 20 entries in it.

62
00:03:11,627 --> 00:03:14,201
What we call Access-Control Entries.

63
00:03:14,201 --> 00:03:17,401
So Access-List 101, look
for the source address,

64
00:03:17,401 --> 00:03:19,626
Access-List 101 the next line down,

65
00:03:19,626 --> 00:03:21,281
look for this destination

66
00:03:21,281 --> 00:03:24,012
Access-List 101 the third
line down, look at this

67
00:03:24,012 --> 00:03:26,446
combination of source and destination.

68
00:03:26,446 --> 00:03:31,180
So all of that together would
be considered Access-List 101.

69
00:03:31,180 --> 00:03:34,211
I'm identifying it by that
number 101, every single line

70
00:03:34,211 --> 00:03:38,378
has that 101 in it, but each
entry is unique and different.

71
00:03:40,081 --> 00:03:42,922
Or another option you have
available to you is naming

72
00:03:42,922 --> 00:03:45,331
your Access-List and we'll look
at that a little bit later,

73
00:03:45,331 --> 00:03:48,066
about maybe it's more,
maybe if you're looking at

74
00:03:48,066 --> 00:03:50,957
your running config it's
more meaningful to you

75
00:03:50,957 --> 00:03:52,565
if the name is there.

76
00:03:52,565 --> 00:03:56,981
For example Access-List:
deny engineering to payroll

77
00:03:56,981 --> 00:04:00,694
or Access-List: permit marketing,
or something like that.

78
00:04:00,694 --> 00:04:02,900
And then once again you'd
have a bunch of entries

79
00:04:02,900 --> 00:04:05,341
beneath that grouping.

80
00:04:05,341 --> 00:04:07,921
So an Access-List is gonna have

81
00:04:07,921 --> 00:04:11,340
one or more Access-Control Entries in it.

82
00:04:11,340 --> 00:04:13,501
How many Access-Control Entries are really

83
00:04:13,501 --> 00:04:15,092
completely up to you.

84
00:04:15,092 --> 00:04:18,025
How specific you wanna get,
how many different things

85
00:04:18,025 --> 00:04:19,965
you wanna match.

86
00:04:19,965 --> 00:04:23,892
Now one key thing to remember
is that, whether you configure

87
00:04:23,892 --> 00:04:27,539
an Access-List with just
one Access-Control Entry

88
00:04:27,539 --> 00:04:31,993
or 500 Access-Control
Entries at the very bottom

89
00:04:31,993 --> 00:04:35,141
it's actually gonna put in an
entry that you can't even see

90
00:04:35,141 --> 00:04:36,612
in the running config.

91
00:04:36,612 --> 00:04:39,914
It's sort of invisible and
I frequently call it the

92
00:04:39,914 --> 00:04:43,497
deny all entry, or the
implicit-deny entry.

93
00:04:44,742 --> 00:04:48,914
Now what these entries do is
just looking for something,

94
00:04:48,914 --> 00:04:50,572
just matching on something.

95
00:04:50,572 --> 00:04:52,810
You don't know, if I show
you an Access-List that says

96
00:04:52,810 --> 00:04:55,536
permit this, deny this,
you can't tell me what's

97
00:04:55,536 --> 00:04:58,002
gonna happen to a packet if it matches

98
00:04:58,002 --> 00:05:01,069
this permit statement or if it
matches this deny statement.

99
00:05:01,069 --> 00:05:03,447
It really depends on, what is the feature

100
00:05:03,447 --> 00:05:05,686
that's using this Access-List.

101
00:05:05,686 --> 00:05:08,609
Perhaps that packet, if it
says deny in the Access-List,

102
00:05:08,609 --> 00:05:11,077
will be dropped because we're referencing

103
00:05:11,077 --> 00:05:13,145
a security-related feature.

104
00:05:13,145 --> 00:05:15,660
Or maybe that packet, if it
says deny in the Access-List,

105
00:05:15,660 --> 00:05:19,108
will mean let it go through,
just don't encrypt it

106
00:05:19,108 --> 00:05:21,708
because the encryption feature
says okay, I'm only gonna

107
00:05:21,708 --> 00:05:23,983
encrypt stuff that says
permit in the Access-List.

108
00:05:23,983 --> 00:05:26,043
Or maybe it says, if it's a deny it means,

109
00:05:26,043 --> 00:05:28,106
don't change it in some way.

110
00:05:28,106 --> 00:05:32,040
So just by looking at ACL
you don't know what each line

111
00:05:32,040 --> 00:05:36,207
is ultimately going to do if
it matches a packet or not.

112
00:05:38,008 --> 00:05:40,144
So when you look at the
running configuration

113
00:05:40,144 --> 00:05:42,458
and you see one or more
lines of an Access-List,

114
00:05:42,458 --> 00:05:44,304
they'll be in some sort of an order

115
00:05:44,304 --> 00:05:46,826
and the way you see it
in the running config

116
00:05:46,826 --> 00:05:49,320
is actually the way it will be processed.

117
00:05:49,320 --> 00:05:53,011
So when a packet comes
in and some feature says:

118
00:05:53,011 --> 00:05:56,728
- ope- hold on, I gotta have
the Access-List check you out

119
00:05:56,728 --> 00:05:59,678
and then tell me if I
should do something to you.

120
00:05:59,678 --> 00:06:02,151
Then it's gonna start by
looking at the top line

121
00:06:02,151 --> 00:06:05,247
of the access list and then
proceed in sequential order.

122
00:06:05,247 --> 00:06:07,032
Do I match the first line?
No.

123
00:06:07,032 --> 00:06:08,714
Do I match the second line?
No.

124
00:06:08,714 --> 00:06:10,725
Do I match the third line?
Yes.

125
00:06:10,725 --> 00:06:11,865
We're done.

126
00:06:11,865 --> 00:06:13,676
Now that's an important point, look at

127
00:06:13,676 --> 00:06:15,096
that last bullet point there.

128
00:06:15,096 --> 00:06:17,489
ACEs are processed in a sequential order

129
00:06:17,489 --> 00:06:19,608
until a match is found.

130
00:06:19,608 --> 00:06:22,803
So if I showed you an
Access-List that has ten entries

131
00:06:22,803 --> 00:06:25,110
and I gave you a packet and
I said here's the source

132
00:06:25,110 --> 00:06:26,843
and destination of a packet.

133
00:06:26,843 --> 00:06:28,493
And you looked at these
ten entries and you said:

134
00:06:28,493 --> 00:06:31,055
oh well that packet would
match entry number three,

135
00:06:31,055 --> 00:06:33,955
entry number seven and entry number ten.

136
00:06:33,955 --> 00:06:36,547
Entries seven and ten are irrelevant.

137
00:06:36,547 --> 00:06:39,706
The fact that it matched
entry number three, it's done.

138
00:06:39,706 --> 00:06:42,855
Whatever entry number three
says to do, permit or deny,

139
00:06:42,855 --> 00:06:47,316
that's gonna be what
happens to that packet.

140
00:06:47,316 --> 00:06:50,560
Now if a packet comes in
and it goes line-by-line

141
00:06:50,560 --> 00:06:52,836
says there's no match, no match, no match

142
00:06:52,836 --> 00:06:55,466
and it goes all the way to
the end and finds no match.

143
00:06:55,466 --> 00:06:58,093
It will always match that invisible

144
00:06:58,093 --> 00:07:01,549
deny any statement at the very end.

145
00:07:01,549 --> 00:07:04,013
Now once again, what does that mean?

146
00:07:04,013 --> 00:07:06,284
We don't know unless we
know what the Access-List

147
00:07:06,284 --> 00:07:09,918
is referring to as far as
what feature is using it.

148
00:07:09,918 --> 00:07:13,668
Now from the CCNA level,
you use Access-Lists

149
00:07:14,915 --> 00:07:17,212
for a couple of different things.

150
00:07:17,212 --> 00:07:19,604
The very first thing we're
gonna learn about Access-List

151
00:07:19,604 --> 00:07:21,927
is pairing it up with a security feature

152
00:07:21,927 --> 00:07:24,375
called an access group feature.

153
00:07:24,375 --> 00:07:26,515
The access group feature is sorta like

154
00:07:26,515 --> 00:07:28,324
a real basic firewall.

155
00:07:28,324 --> 00:07:31,700
It says either, it says
either let the packet

156
00:07:31,700 --> 00:07:34,201
go through or drop the packet.

157
00:07:34,201 --> 00:07:37,730
So in that context when you're
looking at an Access-List,

158
00:07:37,730 --> 00:07:41,635
it says permit something,
if a packet comes in

159
00:07:41,635 --> 00:07:44,218
and it matches that permit statement

160
00:07:44,218 --> 00:07:47,730
and we're referencing an
access group security feature,

161
00:07:47,730 --> 00:07:51,355
that means permit the packet
through, let it be forwarded.

162
00:07:51,355 --> 00:07:53,009
If a packet comes in and it matches

163
00:07:53,009 --> 00:07:55,521
a deny statement in an Access-List,

164
00:07:55,521 --> 00:07:58,152
but it's matching an access
group security feature,

165
00:07:58,152 --> 00:08:01,535
that means deny the packet, drop it.

166
00:08:01,535 --> 00:08:03,419
And then later on we'll
see some other videos

167
00:08:03,419 --> 00:08:06,586
about a different type
of feature called NAT,

168
00:08:06,586 --> 00:08:09,229
Network Address Translation that says

169
00:08:09,229 --> 00:08:11,062
if a packet comes in and it matches

170
00:08:11,062 --> 00:08:13,540
a permit, we're gonna
change the IP address

171
00:08:13,540 --> 00:08:16,024
in some way and then let it go through.

172
00:08:16,024 --> 00:08:18,247
If a packet comes in and
it matches an access list

173
00:08:18,247 --> 00:08:20,886
that says deny, that means
we're not gonna change it

174
00:08:20,886 --> 00:08:22,322
in any way whatsoever.

175
00:08:22,322 --> 00:08:23,942
NAT will not get involved, we'll just

176
00:08:23,942 --> 00:08:26,025
let it through unchanged.

177
00:08:26,883 --> 00:08:29,717
So what can be matched by Access-Lists?

178
00:08:29,717 --> 00:08:32,196
Well it really depends on
what kind of Access-List

179
00:08:32,196 --> 00:08:34,704
you are using and we will talk about that.

180
00:08:34,704 --> 00:08:36,838
But theoretically within your Layer 3

181
00:08:36,838 --> 00:08:39,726
or your Layer 4 headers these
are all the various things

182
00:08:39,726 --> 00:08:41,559
that could be matched.

183
00:08:42,460 --> 00:08:46,485
Some fields have to be matched entirely.

184
00:08:46,485 --> 00:08:51,360
For example if your Access-List
is looking at port numbers

185
00:08:51,360 --> 00:08:55,527
or TCP flags or within the
IP Header if it's matching

186
00:08:56,730 --> 00:09:00,864
on the TOS byte or the Protocol
field, you have to match

187
00:09:00,864 --> 00:09:03,281
the entire field bit for bit.

188
00:09:04,312 --> 00:09:05,972
Sort of like how switches have to match

189
00:09:05,972 --> 00:09:07,854
an entire MAC address, it's either

190
00:09:07,854 --> 00:09:10,945
an entire 48-bit match or it's nothing.

191
00:09:10,945 --> 00:09:14,277
Other fields, you have a
choice of partially matching

192
00:09:14,277 --> 00:09:16,714
those fields and that's when
we're looking at the address,

193
00:09:16,714 --> 00:09:19,351
the source and destination IP address.

194
00:09:19,351 --> 00:09:21,405
You have a choice, you
can say I want to match

195
00:09:21,405 --> 00:09:24,564
that entire source address, all 32-bits.

196
00:09:24,564 --> 00:09:27,605
I want to match a specific post.

197
00:09:27,605 --> 00:09:30,332
Or you could say, well I only wanna match

198
00:09:30,332 --> 00:09:34,046
a certain, a certain few bits within that.

199
00:09:34,046 --> 00:09:36,043
Maybe I'll only want a
match on packets coming

200
00:09:36,043 --> 00:09:37,769
from a particular network.

201
00:09:37,769 --> 00:09:40,609
So any host within the
ten network, I only care

202
00:09:40,609 --> 00:09:43,340
about matching on that
first byte, the number ten.

203
00:09:43,340 --> 00:09:45,932
I don't care about what
their host identifier is.

204
00:09:45,932 --> 00:09:50,099
So you can do that, that's a
partial match is supported.

205
00:09:51,026 --> 00:09:53,853
So when we are looking at these fields

206
00:09:53,853 --> 00:09:56,921
of the address specifically
and we are looking

207
00:09:56,921 --> 00:09:59,730
at the potential of
matching the entire thing

208
00:09:59,730 --> 00:10:02,819
or matching just part of
it, well then that means

209
00:10:02,819 --> 00:10:05,202
we have to have something
that goes along with

210
00:10:05,202 --> 00:10:09,852
that field that tells exactly
how much am I gonna match.

211
00:10:09,852 --> 00:10:11,819
This sounds sort of familiar doesn't it?

212
00:10:11,819 --> 00:10:15,228
When you put an IP
address on an interface,

213
00:10:15,228 --> 00:10:18,128
something else goes with
that IP address doesn't it?

214
00:10:18,128 --> 00:10:19,605
A Subnet Mask.

215
00:10:19,605 --> 00:10:21,842
And what does a Subnet Mask do?

216
00:10:21,842 --> 00:10:24,488
In the context of an IP
address and a Subnet Mask,

217
00:10:24,488 --> 00:10:27,232
it tells the system
where that IP address is.

218
00:10:27,232 --> 00:10:30,318
It provides the boundary line between

219
00:10:30,318 --> 00:10:32,550
these are the networking
bits, if you're looking

220
00:10:32,550 --> 00:10:34,510
for the network these are the bits

221
00:10:34,510 --> 00:10:36,022
that are important for you.

222
00:10:36,022 --> 00:10:40,189
So 10.10.10.10/8 says if
you're looking for the network,

223
00:10:41,314 --> 00:10:44,699
only the first eight bits matter.

224
00:10:44,699 --> 00:10:46,652
The rest of it are host bits.

225
00:10:46,652 --> 00:10:49,251
(coughs) Excuse me.

226
00:10:49,251 --> 00:10:51,825
So when we're talking
about an Access-List,

227
00:10:51,825 --> 00:10:54,093
the same thing is gonna apply.

228
00:10:54,093 --> 00:10:56,003
There's gonna be a portion of
the Access-List where we can

229
00:10:56,003 --> 00:10:59,856
plug in our source or our
destination address or both

230
00:10:59,856 --> 00:11:02,624
and then we're gonna apply
something against that says:

231
00:11:02,624 --> 00:11:06,573
okay of this 32-bit source,
or of this 32-bit destination,

232
00:11:06,573 --> 00:11:09,562
here's how many of the
bits I'm interested in.

233
00:11:09,562 --> 00:11:12,066
Now you might be thinking:
oh okay, well then you put

234
00:11:12,066 --> 00:11:13,855
a Subnet Mask in there right?

235
00:11:13,855 --> 00:11:17,060
No, actually with
Access-List it's something

236
00:11:17,060 --> 00:11:19,477
that we call a Wildcard mask.

237
00:11:20,631 --> 00:11:23,448
An easy way to think of a
Wildcard mask, is think of it

238
00:11:23,448 --> 00:11:27,615
as being sort of like just
the inverse of a Subnet Mask.

239
00:11:29,973 --> 00:11:31,134
It's a what?

240
00:11:31,134 --> 00:11:34,437
Okay let me whiteboard
this for you, for a moment.

241
00:11:34,437 --> 00:11:38,520
Let's say I was to give
you just one single byte.

242
00:11:39,683 --> 00:11:44,291
So not an entire IP
address, just a single byte.

243
00:11:44,291 --> 00:11:46,374
Let's say 00110001, okay.

244
00:11:51,926 --> 00:11:56,477
Now if I said, I want
you to use a Subnet Mask

245
00:11:56,477 --> 00:12:00,310
and using that Subnet
Mask, I want you to tell

246
00:12:01,310 --> 00:12:03,810
whatever feature is gonna
be looking at this byte

247
00:12:03,810 --> 00:12:06,227
to match the first five bits.

248
00:12:07,663 --> 00:12:11,073
Well with a Subnet Mask,
ones are important,

249
00:12:11,073 --> 00:12:13,745
zeros mean we don't care.

250
00:12:13,745 --> 00:12:15,995
So you would say: 11111000.

251
00:12:18,930 --> 00:12:22,864
So if this number was paired
up with a Subnet Mask,

252
00:12:22,864 --> 00:12:25,621
the ones here in the Subnet
Mask would say I only want

253
00:12:25,621 --> 00:12:29,309
you to match against this
five-bit pattern: 00110

254
00:12:29,309 --> 00:12:31,792
and I don't care about anything else.

255
00:12:31,792 --> 00:12:36,096
Well a Wildcard mask is
just the opposite of that.

256
00:12:36,096 --> 00:12:38,848
So I'll put the Wildcard mask below it.

257
00:12:38,848 --> 00:12:42,798
In a Wildcard mask zeros
mean match that bit,

258
00:12:42,798 --> 00:12:44,787
one, two, three, four, five

259
00:12:44,787 --> 00:12:47,037
and ones mean I don't care.

260
00:12:49,169 --> 00:12:51,419
So this is a Wildcard mask.

261
00:12:54,103 --> 00:12:56,894
Where you're saying the
zeros have to match up

262
00:12:56,894 --> 00:12:59,070
and that's what I'm interested in

263
00:12:59,070 --> 00:13:01,320
and the ones, I don't care.

264
00:13:04,146 --> 00:13:06,766
So this can be pretty easy,
since you're already used

265
00:13:06,766 --> 00:13:08,609
to creating Subnet Masks.

266
00:13:08,609 --> 00:13:11,184
If you can create a
Subnet Mask in your head,

267
00:13:11,184 --> 00:13:14,009
if you can imagine what
that Subnet Mask looks like

268
00:13:14,009 --> 00:13:18,509
in binary and then flip it,
you've got a Wildcard Mask.

269
00:13:18,509 --> 00:13:21,982
So let's do that a couple of times.

270
00:13:21,982 --> 00:13:24,732
Let's say for example, that I had

271
00:13:29,302 --> 00:13:32,219
an IP address of 10.10.10.anything.

272
00:13:35,933 --> 00:13:38,795
So all I care to match on
are the first three bytes

273
00:13:38,795 --> 00:13:39,962
and that's it.

274
00:13:40,901 --> 00:13:42,880
Well if we were talking
about a Subnet Mask,

275
00:13:42,880 --> 00:13:45,297
it'd be 255.255.255.0, right?

276
00:13:47,320 --> 00:13:50,411
And in binary one, two, three,
four, five, six, seven, eight

277
00:13:50,411 --> 00:13:52,064
one, two, three, four,
five, six, seven, eight,

278
00:13:52,064 --> 00:13:53,998
one, two, three, four,
five, six, seven, eight,

279
00:13:53,998 --> 00:13:55,944
one, two, three, four,
five, six, seven, eight.

280
00:13:55,944 --> 00:13:58,467
That's what our Subnet
Mask would look like.

281
00:13:58,467 --> 00:13:59,608
Okay.

282
00:13:59,608 --> 00:14:03,761
Well if a Wildcard Mask is
just the opposite of that,

283
00:14:03,761 --> 00:14:07,816
imagine turning all these ones to zeros

284
00:14:07,816 --> 00:14:10,149
and all these zeros to ones.

285
00:14:15,430 --> 00:14:16,682
And so if we convert that back

286
00:14:16,682 --> 00:14:20,599
in a dotted decimal, what
do we have: 0.0.0.255

287
00:14:30,022 --> 00:14:34,019
So if the feature I'm
using needs an access list

288
00:14:34,019 --> 00:14:36,598
as it's classification mechanism,

289
00:14:36,598 --> 00:14:38,894
an Access-List matches bits based on

290
00:14:38,894 --> 00:14:41,561
Wildcard Masks not Subnet Masks.

291
00:14:44,379 --> 00:14:46,879
Let's do another one of these.

292
00:14:48,375 --> 00:14:50,625
If I gave you this address:

293
00:14:52,955 --> 00:14:54,788
10.40.32.0 and I said:

294
00:15:00,782 --> 00:15:03,365
use a Wildcard Mask to match...

295
00:15:07,223 --> 00:15:09,140
only the first 19-bits.

296
00:15:14,052 --> 00:15:17,365
Okay, well there's a couple of
ways we could approach this.

297
00:15:17,365 --> 00:15:19,633
We could sort of envision it binary:

298
00:15:19,633 --> 00:15:21,686
one, two, three, four,
five, six, seven, eight,

299
00:15:21,686 --> 00:15:23,738
one, two, three, four,
five, six, seven, eight,

300
00:15:23,738 --> 00:15:26,743
one, two, three, okay
that's the first 19-bits.

301
00:15:26,743 --> 00:15:28,372
One, two, three, four, five,

302
00:15:28,372 --> 00:15:31,145
one, two, three, four, five,
six, seven, eight, okay.

303
00:15:31,145 --> 00:15:34,566
So we could do that, which ends up being:

304
00:15:34,566 --> 00:15:36,566
0.0. what's that number?

305
00:15:41,341 --> 00:15:43,295
Remember the quick way to do this?

306
00:15:43,295 --> 00:15:44,950
If you don't wanna add up all those ones,

307
00:15:44,950 --> 00:15:48,498
ask yourself what's the
value of that right there?

308
00:15:48,498 --> 00:15:50,458
Isn't that the 32-bit?

309
00:15:50,458 --> 00:15:54,458
So if that's the 32-bit,
this is one less than that.

310
00:15:54,458 --> 00:15:55,625
That's 31.255.

311
00:16:01,835 --> 00:16:03,796
So if I'm creating an access list saying

312
00:16:03,796 --> 00:16:06,901
of this 32-bit number right
here, I only want you to match

313
00:16:06,901 --> 00:16:10,424
on the first 19-bits, if you
find a packet that matches

314
00:16:10,424 --> 00:16:12,581
the first 19-bits that looks like this,

315
00:16:12,581 --> 00:16:14,887
that's a hit, that's a match.

316
00:16:14,887 --> 00:16:18,387
Then my Wildcard Mask would be 0.0.31.255.

317
00:16:21,455 --> 00:16:22,951
Here's another way of doing it.

318
00:16:22,951 --> 00:16:25,350
This is a shortcut.

319
00:16:25,350 --> 00:16:28,423
For those of you that are
really good at coming up with

320
00:16:28,423 --> 00:16:31,033
Subnet Masks because you've
had a lot of practice

321
00:16:31,033 --> 00:16:34,554
with that now, what
would the Subnet Mask be

322
00:16:34,554 --> 00:16:36,554
in this particular case?

323
00:16:38,944 --> 00:16:42,194
The Subnet Mask would be 255.255.224.0.

324
00:16:51,068 --> 00:16:53,104
Here's one way that you can come up with,

325
00:16:53,104 --> 00:16:55,495
if this is easier for you I don't know,

326
00:16:55,495 --> 00:16:57,515
but this is one way you
could, some people use,

327
00:16:57,515 --> 00:16:59,151
to come up with a Wildcard Mask.

328
00:16:59,151 --> 00:17:02,030
Once you know what the Subnet Mask is,

329
00:17:02,030 --> 00:17:04,363
put 255 above each number...

330
00:17:08,149 --> 00:17:11,732
and then subtract the
lower number from it.

331
00:17:12,855 --> 00:17:14,938
So 255 minus 255 is zero,

332
00:17:16,255 --> 00:17:18,506
255 minus 255 is zero,

333
00:17:18,506 --> 00:17:20,923
two five, 255 minus 224 is 31

334
00:17:23,175 --> 00:17:25,342
and 255 minus zero is 255.

335
00:17:27,792 --> 00:17:30,535
It's your choice, however
you wanna approach it.

336
00:17:30,535 --> 00:17:32,210
Some people find this method easier

337
00:17:32,210 --> 00:17:35,593
because they are used to
coming up with Subnet Masks

338
00:17:35,593 --> 00:17:37,918
and then from a Subnet
Mask you can just subtract

339
00:17:37,918 --> 00:17:42,085
the Subnet Mask from 255,
255, 255, 255 and whatever

340
00:17:42,997 --> 00:17:46,247
you're left with is your Wildcard Mask.

341
00:17:47,780 --> 00:17:49,363
What if I had this?

342
00:17:51,388 --> 00:17:55,055
When a packet arrives,
we must do something,

343
00:17:58,183 --> 00:18:01,922
we don't know what the
feature is, to it only

344
00:18:01,922 --> 00:18:04,589
if the packet exactly matches...

345
00:18:08,249 --> 00:18:09,916
5.5.5.5 all 32-bits.

346
00:18:14,493 --> 00:18:17,160
So only if it matches that host.

347
00:18:18,093 --> 00:18:21,010
What Wildcard Mask would we select?

348
00:18:23,234 --> 00:18:27,330
Well if zeros in binary
mean match that bit,

349
00:18:27,330 --> 00:18:30,989
and we're saying I wanna
match all the bits,

350
00:18:30,989 --> 00:18:34,489
that would be my Wildcard Mask: all zeros.

351
00:18:36,604 --> 00:18:39,638
Actually when we create an Access-List

352
00:18:39,638 --> 00:18:43,178
and in the next section, in
the next video we'll start

353
00:18:43,178 --> 00:18:45,969
showing you the commands to do that.

354
00:18:45,969 --> 00:18:50,136
In this case, you can
actually shorten that to this.

355
00:18:51,079 --> 00:18:53,493
So in the Access-List, I'll
show you a quick preview here

356
00:18:53,493 --> 00:18:56,228
of a simple Access-List.

357
00:18:56,228 --> 00:19:00,145
I could say: access-list
1 permit and then what

358
00:19:02,323 --> 00:19:03,740
am I looking for?

359
00:19:05,697 --> 00:19:09,864
I could say that or since
I'm matching all 32-bits.

360
00:19:12,473 --> 00:19:14,824
Typically when you're matching
all 32-bits it's because

361
00:19:14,824 --> 00:19:17,041
you're matching a host
address, you're matching

362
00:19:17,041 --> 00:19:21,208
on packet coming from or
going to a particular host.

363
00:19:22,510 --> 00:19:24,508
So a short-hand way of
doing it is like this,

364
00:19:24,508 --> 00:19:26,675
access-list 1 permit host.

365
00:19:29,495 --> 00:19:33,662
I'm assuming this is a host,
so match all 32-bits of this.

366
00:19:36,605 --> 00:19:38,901
So that's a keyword you'll
see a lot in Access-List

367
00:19:38,901 --> 00:19:42,068
and notice that when you
use the shorthand of host

368
00:19:42,068 --> 00:19:44,154
instead of Wildcard Mask, it actually goes

369
00:19:44,154 --> 00:19:47,973
in front of what you're
matching, not behind.

370
00:19:47,973 --> 00:19:51,095
So if you're using a Wildcard
Mask, which you might have to,

371
00:19:51,095 --> 00:19:53,487
the Wildcard Mask goes
behind the value, just like

372
00:19:53,487 --> 00:19:54,611
in an IP address, right?

373
00:19:54,611 --> 00:19:58,778
In an IP address the Subnet
Mask went behind the IP address.

374
00:19:59,770 --> 00:20:02,136
But in this particular case,
if you use the keyword of host,

375
00:20:02,136 --> 00:20:04,430
that goes in front of.

376
00:20:04,430 --> 00:20:06,887
And there's one other
shortcut I wanna show you,

377
00:20:06,887 --> 00:20:10,220
that you will see a lot in Access-Lists.

378
00:20:13,054 --> 00:20:14,471
Match any packet,

379
00:20:18,736 --> 00:20:21,903
I don't care what bit sequence it has.

380
00:20:26,240 --> 00:20:29,323
Okay, so what would my Wildcard Mask,

381
00:20:32,292 --> 00:20:35,042
what Wildcard Mask would you use?

382
00:20:38,601 --> 00:20:41,878
Well in a Wildcard Mask in
binary, what binary bits

383
00:20:41,878 --> 00:20:44,028
indicate I don't care?

384
00:20:44,028 --> 00:20:46,791
This could be anything to me.

385
00:20:46,791 --> 00:20:48,541
Isn't it the one bit?

386
00:20:50,112 --> 00:20:54,279
So that Wildcard Mask applied
against anything means

387
00:20:58,706 --> 00:21:00,937
don't even bother matching
this bit sequence.

388
00:21:00,937 --> 00:21:03,127
I had to put some bit
sequence in here because

389
00:21:03,127 --> 00:21:06,113
I'm forced to, I had to
put something in this field

390
00:21:06,113 --> 00:21:10,649
but the Wildcard Mask of
255.255.255.255 says ignore

391
00:21:10,649 --> 00:21:14,816
that field, you don't even
have to match on it at all.

392
00:21:16,762 --> 00:21:20,762
So I could do it like
this: access-list 1 permit

393
00:21:23,976 --> 00:21:28,143
and I could put anything
right there if I input this.

394
00:21:29,054 --> 00:21:32,276
It really doesn't matter,
I could put 7.7.7.7.

395
00:21:32,276 --> 00:21:35,693
I could put 1.2.3.4, I could put 10.3.3.3

396
00:21:36,992 --> 00:21:38,945
because this Wildcard Mask
is saying this pattern

397
00:21:38,945 --> 00:21:40,889
doesn't mean anything.

398
00:21:40,889 --> 00:21:44,453
Doesn't, you don't have to
match any of the bits here.

399
00:21:44,453 --> 00:21:46,397
So usually the shorthand
way that people do

400
00:21:46,397 --> 00:21:49,564
for this, is access-list 1 permit any.

401
00:21:54,540 --> 00:21:56,276
Now you don't have to,
now all you have to do

402
00:21:56,276 --> 00:21:57,977
is the word any.

403
00:21:57,977 --> 00:22:00,551
Cause that's exactly what
this Wildcard Mask means,

404
00:22:00,551 --> 00:22:04,800
I don't care what the bit
pattern is, it all matches.

405
00:22:04,800 --> 00:22:07,383
There's nothing I am excluding.

406
00:22:09,791 --> 00:22:13,613
So with IP version four
Access-Lists, you can have

407
00:22:13,613 --> 00:22:15,537
a standard Access-List, you can have

408
00:22:15,537 --> 00:22:17,436
an Extended Access-List and both of these

409
00:22:17,436 --> 00:22:20,144
are considered numbered Access-Lists.

410
00:22:20,144 --> 00:22:21,827
So for example, my whiteboard here where

411
00:22:21,827 --> 00:22:23,249
I was putting a number.

412
00:22:23,249 --> 00:22:25,169
And then a lot of times
in my verbal explanations,

413
00:22:25,169 --> 00:22:28,344
I was saying Access-List 101.

414
00:22:28,344 --> 00:22:31,007
Those are numbered Access-Lists
and a numbered Access-List

415
00:22:31,007 --> 00:22:35,463
can take the form of a Standard
ACL or an Extended ACL.

416
00:22:35,463 --> 00:22:36,837
And we'll get into what
the differences are

417
00:22:36,837 --> 00:22:39,027
between those coming up.

418
00:22:39,027 --> 00:22:41,958
Or like I said, if you
wanted to you create

419
00:22:41,958 --> 00:22:43,625
a named Access-List.

420
00:22:44,730 --> 00:22:47,342
Now a named Access-List is something

421
00:22:47,342 --> 00:22:51,781
we will get into a bit later,
but a named Access-List,

422
00:22:51,781 --> 00:22:53,433
you still have to identify whether

423
00:22:53,433 --> 00:22:55,683
it is standard or extended.

424
00:22:57,073 --> 00:23:00,490
Standard or extended tells Cisco IOS what

425
00:23:01,587 --> 00:23:04,325
my limitations are as
far as what I can match.

426
00:23:04,325 --> 00:23:06,474
With a standard Access-List
there's not a lot of things

427
00:23:06,474 --> 00:23:09,220
I can match, but maybe that's fine.

428
00:23:09,220 --> 00:23:11,561
Maybe I don't need to match a whole lot.

429
00:23:11,561 --> 00:23:13,817
But if I need to match a
lot of those other fields,

430
00:23:13,817 --> 00:23:17,182
like the TCP port
numbers or the TCP flags,

431
00:23:17,182 --> 00:23:19,417
then I need more options and that's where

432
00:23:19,417 --> 00:23:22,287
an Extended Access-List would help me.

433
00:23:22,287 --> 00:23:24,310
So that concludes this particular video

434
00:23:24,310 --> 00:23:26,578
and in the next video we'll
start looking at standard

435
00:23:26,578 --> 00:23:28,443
Access-Lists, what they can match against

436
00:23:28,443 --> 00:23:30,466
and how we configure them.

437
00:23:30,466 --> 00:23:34,633
(electricity crackling over pulsing tones)

