WEBVTT

0:00:08.360000 --> 0:00:11.960000
 So in this video, we're going to take
 a look at another type of an access

0:00:11.960000 --> 0:00:14.560000
 list called an extended
 access list.

0:00:14.560000 --> 0:00:17.420000
 In the previous video, we looked
 at standard access lists.

0:00:17.420000 --> 0:00:21.440000
 We looked at they're pretty easy to
 configure because really, all you

0:00:21.440000 --> 0:00:25.740000
 have the ability to match on is the
 source IP address of an IP version

0:00:25.740000 --> 0:00:27.680000
 4 packet. And that's it.

0:00:27.680000 --> 0:00:32.220000
 And we saw that fundamentally, you configure
 the access list with a number.

0:00:32.220000 --> 0:00:35.940000
 Do you remember what the range of numbers
 was for a standard access list?

0:00:35.940000 --> 0:00:39.180000
 It was from 1 to 99.

0:00:39.180000 --> 0:00:41.840000
 And then there was an expanded
 range above that.

0:00:41.840000 --> 0:00:46.360000
 So you configured access to access
 list, the number, permit or deny.

0:00:46.360000 --> 0:00:50.300000
 And then all you had left after that
 was some 32-bit number to match the

0:00:50.300000 --> 0:00:55.000000
 source IP address and then a wildcard
 mask to match against that 32-bit

0:00:55.000000 --> 0:00:58.420000
 number. So now with an extended access
 list, we're going to have a much

0:00:58.420000 --> 0:01:02.080000
 broader range of things that
 we can match against.

0:01:02.080000 --> 0:01:08.520000
 So just like a standard access list,
 with an extended access list, if

0:01:08.520000 --> 0:01:12.120000
 you wanted to, you could just
 match on a source address.

0:01:12.120000 --> 0:01:14.940000
 But you've got a lot of other things
 as well, including various fields

0:01:14.940000 --> 0:01:17.700000
 in the layer 4 header as well.

0:01:17.700000 --> 0:01:23.100000
 So if you want to check on anything,
 if you want to classify or identify

0:01:23.100000 --> 0:01:27.560000
 a packet on anything other than the source
 IP address, this would be your

0:01:27.560000 --> 0:01:29.720000
 option, the extended access list.

0:01:29.720000 --> 0:01:32.540000
 And notice you can even check
 on layer 4 port numbers.

0:01:32.540000 --> 0:01:36.920000
 So if you want to match only on telnet
 traffic or web browsing traffic,

0:01:36.920000 --> 0:01:40.080000
 you've got that kind of
 flexibility with this.

0:01:40.080000 --> 0:01:44.560000
 Now with the standard access list,
 I mentioned in the last video that

0:01:44.560000 --> 0:01:48.500000
 that was ideally placed as close to
 the destination of the traffic as

0:01:48.500000 --> 0:01:51.980000
 possible. Because if you placed a standard
 access list close to the source

0:01:51.980000 --> 0:01:57.220000
 and you were trying to prevent that
 source from going somewhere, well

0:01:57.220000 --> 0:02:00.800000
 because you couldn't specify the destination,
 that would prevent that

0:02:00.800000 --> 0:02:02.860000
 source from going anywhere.

0:02:02.860000 --> 0:02:05.580000
 So if it was close to the source, the
 source wouldn't be able to get to

0:02:05.580000 --> 0:02:10.320000
 legitimate resources as well as not
 being able to get to the destination

0:02:10.320000 --> 0:02:12.740000
 that you did not want
 it to get to.

0:02:12.740000 --> 0:02:16.220000
 That's why a standard access list was
 placed as close as possible to the

0:02:16.220000 --> 0:02:20.740000
 destination device, prevent the traffic
 from getting to it just before

0:02:20.740000 --> 0:02:22.320000
 it gets to the destination.

0:02:22.320000 --> 0:02:25.380000
 That way the source can get to
 everything else it needs to.

0:02:25.380000 --> 0:02:29.140000
 Well with an extended access list,
 just the opposite is true.

0:02:29.140000 --> 0:02:33.280000
 Because we do have the flexibility of
 now specifying source and destination,

0:02:33.280000 --> 0:02:37.620000
 ideally you would implement your extended
 access list as close to the

0:02:37.620000 --> 0:02:40.400000
 source of the traffic as possible.


0:02:40.400000 --> 0:02:43.300000
 And I'll show you that on the
 whiteboard in just a moment.

0:02:43.300000 --> 0:02:48.740000
 So extended access lists are in the
 range of 100 through 199, you should

0:02:48.740000 --> 0:02:52.480000
 memorize that. And just like with standard
 access lists, there's another

0:02:52.480000 --> 0:02:57.860000
 range of numbers that Cisco iOS
 recognizes as extended ACLs.

0:02:57.860000 --> 0:03:02.120000
 This is called the expanded range
 if you run out of numbers here.

0:03:02.120000 --> 0:03:07.660000
 The expanded range is
 2000 through 2699.

0:03:07.660000 --> 0:03:14.360000
 That's 2000 through 2699.

0:03:14.360000 --> 0:03:18.740000
 And like I mentioned, extended access
 lists are capable of transport header

0:03:18.740000 --> 0:03:23.680000
 inspection. So an example, just real quickly
 here, why it would be beneficial

0:03:23.680000 --> 0:03:27.600000
 for us to put it as close
 to the source as possible.

0:03:27.600000 --> 0:03:32.340000
 Let's say we had the exact same requirement
 that we had previously where

0:03:32.340000 --> 0:03:37.780000
 we want R1 to be able to send packets
 anywhere other than here.

0:03:37.780000 --> 0:03:43.920000
 We don't want R1 to be able to send
 any IP packets to that destination,

0:03:43.920000 --> 0:03:51.840000
 2.4.2.4. Okay, well, with an extended
 access list, we very well could

0:03:51.840000 --> 0:03:53.940000
 put it right here
 on this interface.

0:03:53.940000 --> 0:03:55.360000
 We could have put it outbound.

0:03:55.360000 --> 0:03:59.860000
 Remember, an extended access list doesn't
 do anything unless you pair

0:03:59.860000 --> 0:04:02.080000
 it up with some sort of
 feature that's using it.

0:04:02.080000 --> 0:04:06.560000
 And in the last video, we talked about
 the IP access dash group interface

0:04:06.560000 --> 0:04:11.260000
 feature. That's an interface level feature
 which acted like a crude firewall,

0:04:11.260000 --> 0:04:14.300000
 like just blocking or
 permitting traffic.

0:04:14.300000 --> 0:04:17.360000
 And the IP access group
 feature was directional.

0:04:17.360000 --> 0:04:20.200000
 You applied it on an interface and you
 had to tell it, is it for packets

0:04:20.200000 --> 0:04:24.200000
 going out the interface or is it for
 packets coming into the interface?

0:04:24.200000 --> 0:04:27.660000
 Well, certainly, we could replicate our
 exact same lab in the last video,

0:04:27.660000 --> 0:04:34.140000
 this time with an extended ACL, matching
 a source this time of that host

0:04:34.140000 --> 0:04:38.860000
 if we wanted to, 1, 1, 1, 1.

0:04:38.860000 --> 0:04:43.060000
 And this time with an extended ACL, we
 could also match on the destination,

0:04:43.060000 --> 0:04:49.020000
 which is 2, 4, 2, 4.

0:04:49.020000 --> 0:04:53.740000
 And there's nothing preventing us from
 using the IP access group feature

0:04:53.740000 --> 0:05:00.360000
 to reference that ACL and the ACL would
 say deny and then placing an outbound

0:05:00.360000 --> 0:05:02.440000
 here. And it would work.

0:05:02.440000 --> 0:05:04.260000
 Here's the downside to this.

0:05:04.260000 --> 0:05:10.440000
 The idea is, if a packet is ultimately
 going to be dropped somewhere in

0:05:10.440000 --> 0:05:14.740000
 the network due to some security restriction,
 does it really make sense

0:05:14.740000 --> 0:05:19.500000
 that we should consume bandwidth on all
 sorts of cables to transport that

0:05:19.500000 --> 0:05:24.320000
 packet, consume a little bit of processing
 time on the network, look it

0:05:24.320000 --> 0:05:29.000000
 up and forward it, if ultimately it's
 going to be destroyed anyway.

0:05:29.000000 --> 0:05:33.240000
 Because if we put our access group outbound
 here, remember only one frame

0:05:33.240000 --> 0:05:35.340000
 can go on a wire at a time.

0:05:35.340000 --> 0:05:39.600000
 So when one frame is on a wire, no
 other frames can use that wire.

0:05:39.600000 --> 0:05:43.120000
 So that's time that's lost for
 other legitimate traffic.

0:05:43.120000 --> 0:05:47.500000
 So while R1 is putting this frame right
 here, nobody else can use that

0:05:47.500000 --> 0:05:52.640000
 cable. And then when switch one processes
 it, once again, as switch one's

0:05:52.640000 --> 0:05:56.600000
 looking up that frame, he does not have
 the capability of looking up any

0:05:56.600000 --> 0:05:59.120000
 other frame. So that's
 time that's lost.

0:05:59.120000 --> 0:06:01.780000
 And then when it gets to switch to, and
 then it's using up some bandwidth

0:06:01.780000 --> 0:06:05.840000
 on this cable, when it gets to switch to,
 it's using up some of his processing

0:06:05.840000 --> 0:06:09.320000
 time. And then finally,
 it's dropped right here.

0:06:09.320000 --> 0:06:12.320000
 That's why they say it's better
 to put an extended access list.

0:06:12.320000 --> 0:06:16.620000
 It's going to be dropping or modifying
 traffic in some way as close to

0:06:16.620000 --> 0:06:18.900000
 the source. As possible.

0:06:18.900000 --> 0:06:22.160000
 So in this particular case, it would
 make more sense for us to put our

0:06:22.160000 --> 0:06:26.260000
 extended access list right here
 in the inbound direction.

0:06:26.260000 --> 0:06:29.200000
 That way any traffic that's going to
 be dropped, well yeah, it's going

0:06:29.200000 --> 0:06:31.720000
 to use up a little bit of bandwidth
 on this cable, but it's not going

0:06:31.720000 --> 0:06:33.740000
 to bother anybody else
 in the network.

0:06:33.740000 --> 0:06:37.540000
 It'll be dropped long before it consumes
 any resources anywhere else in

0:06:37.540000 --> 0:06:41.960000
 the network. That's why an extended
 ACL, if you can, is best to place

0:06:41.960000 --> 0:06:46.620000
 closest to the source.

0:06:46.620000 --> 0:06:50.380000
 Okay, so where can an extended
 access list look?

0:06:50.380000 --> 0:06:53.220000
 What types of things can you
 check with an extended ACL?

0:06:53.220000 --> 0:06:57.080000
 Well now you can certainly check the
 source and destination IP address.

0:06:57.080000 --> 0:07:00.740000
 You can check the protocol number.


0:07:00.740000 --> 0:07:05.160000
 And as a matter of fact, when you configure
 an extended ACL, you have

0:07:05.160000 --> 0:07:08.720000
 to check, you have to put something
 in the field that checks protocol.

0:07:08.720000 --> 0:07:10.820000
 Now you have some choices here.

0:07:10.820000 --> 0:07:18.380000
 So in the standard access list, if I
 go back here for a moment, we just

0:07:18.380000 --> 0:07:20.860000
 configure a little
 bit larger font.

0:07:20.860000 --> 0:07:24.800000
 So we just typed, so I'll
 just say standard ACL.

0:07:24.800000 --> 0:07:30.840000
 You just typed access dash list, and then
 you gave it some number, typically

0:07:30.840000 --> 0:07:35.820000
 from 1 to 99, and that's
 what you put right here.

0:07:35.820000 --> 0:07:43.800000
 And then after that, you just simply
 said permit or deny, and that applied

0:07:43.800000 --> 0:07:45.660000
 against any kind of IP traffic.

0:07:45.660000 --> 0:07:47.100000
 It didn't matter what it was.

0:07:47.100000 --> 0:07:50.960000
 TCP, UDP, all IP traffic
 would match against this.

0:07:50.960000 --> 0:07:54.520000
 And then you had your source, and I'll
 just put underneath here, because

0:07:54.520000 --> 0:08:00.120000
 I sort of run out of room,
 your wildcard mask.

0:08:00.120000 --> 0:08:04.680000
 Now, with an extended access list, I'm
 going to abbreviate it here a little

0:08:04.680000 --> 0:08:14.400000
 bit. So with an extended ACL, you're
 still going to start with access

0:08:14.400000 --> 0:08:17.060000
 dash list, and then a number.

0:08:17.060000 --> 0:08:20.360000
 So both of these are considered
 numbered access lists.

0:08:20.360000 --> 0:08:27.620000
 In this case, it's probably going to
 be 100 through 199, is most likely

0:08:27.620000 --> 0:08:29.980000
 the range that you're going
 to put right here.

0:08:29.980000 --> 0:08:36.760000
 And you're still going to say right
 after that, either permit or deny.

0:08:36.760000 --> 0:08:40.980000
 But now there's a new field you have
 to put in before you put in your

0:08:40.980000 --> 0:08:46.300000
 source and your wildcard.

0:08:46.300000 --> 0:08:53.120000
 This, right here, you have a choice
 of a variety of things.

0:08:53.120000 --> 0:08:58.180000
 Basically what goes right there is,
 imagine, well, it's actually, it's

0:08:58.180000 --> 0:09:01.140000
 just better to show it to you than
 try to describe it, because I'm not

0:09:01.140000 --> 0:09:04.320000
 exactly sure what logic they
 used there for that.

0:09:04.320000 --> 0:09:08.100000
 But let me just demonstrate
 it real quick.

0:09:08.100000 --> 0:09:12.880000
 Access dash list 101,
 deny question mark.

0:09:12.880000 --> 0:09:18.280000
 Okay, so you can deny all IP packets
 if that's still your desire.

0:09:18.280000 --> 0:09:20.140000
 So you've got to put
 something here.

0:09:20.140000 --> 0:09:22.060000
 You could deny IP.

0:09:22.060000 --> 0:09:27.280000
 Or you could select a protocol
 that IP carries.

0:09:27.280000 --> 0:09:36.080000
 For example, TCP, that's protocol number
 six in the IP header field, UDP,

0:09:36.080000 --> 0:09:37.720000
 right? That's protocol number 17.

0:09:37.720000 --> 0:09:43.260000
 So by selecting one of these two things,
 you are now having it match on

0:09:43.260000 --> 0:09:45.560000
 this field right here.

0:09:45.560000 --> 0:09:49.360000
 By selecting IP, you're
 ignoring that field.

0:09:49.360000 --> 0:09:51.660000
 And you're just saying
 all IP packets.

0:09:51.660000 --> 0:09:57.800000
 So all of these other things here,
 other than IP, all this other stuff

0:09:57.800000 --> 0:10:02.740000
 are match up with various numbers that
 go into this protocol field right

0:10:02.740000 --> 0:10:06.200000
 here. And there's a lot more things
 that go in here than just what you

0:10:06.200000 --> 0:10:09.280000
 see. So if there's a particular protocol
 that you know of that's not in

0:10:09.280000 --> 0:10:13.140000
 this list, but you do know the number
 of the protocol, you can just select

0:10:13.140000 --> 0:10:15.680000
 the number instead.

0:10:15.680000 --> 0:10:18.460000
 And then once you select that and you
 have to put something there, then

0:10:18.460000 --> 0:10:20.700000
 you can put your source
 in your wildcard.

0:10:20.700000 --> 0:10:23.140000
 And once again, maybe you say, well,
 I don't care about the source.

0:10:23.140000 --> 0:10:26.760000
 All I really want to match on is
 where these packets are going.

0:10:26.760000 --> 0:10:29.560000
 Okay, well, if you don't care about
 the source, just put the keyword,

0:10:29.560000 --> 0:10:34.400000
 any. And then after the source and
 the wildcard, I'm going to go ahead

0:10:34.400000 --> 0:10:35.500000
 and continue on here.

0:10:35.500000 --> 0:10:38.240000
 I'm just going to wrap
 the line around.

0:10:38.240000 --> 0:10:42.740000
 Then optionally, so I'll put that in
 brackets since it's optional, source

0:10:42.740000 --> 0:10:46.420000
 layer four port.

0:10:46.420000 --> 0:10:54.100000
 And then you would have the
 destination IP and wildcard.

0:10:54.100000 --> 0:11:00.640000
 So the source layer four port, that,
 depending on the direction of the

0:11:00.640000 --> 0:11:03.500000
 traffic, that could be
 difficult to match on.

0:11:03.500000 --> 0:11:07.960000
 But let me show you a use case where
 you might decide you want to do that.

0:11:07.960000 --> 0:11:10.920000
 So let's say we had this
 topology right here.

0:11:10.920000 --> 0:11:12.320000
 I'll just make it real simple.

0:11:12.320000 --> 0:11:16.900000
 Here's a PC, here's a server,
 here's a router in the middle.

0:11:16.900000 --> 0:11:19.400000
 We'll just put a line
 through them.

0:11:19.400000 --> 0:11:23.180000
 And let's say this PC is 1.1.1.1.

0:11:23.180000 --> 0:11:26.580000
 And this server is 2.2.2.2.

0:11:26.580000 --> 0:11:33.480000
 Okay, so, and let's say that this PC
 is trying to issue some sort of,

0:11:33.480000 --> 0:11:37.080000
 you know, sort of maybe
 web browsing connection.

0:11:37.080000 --> 0:11:40.800000
 So HTTP session to the server.

0:11:40.800000 --> 0:11:45.220000
 Okay, so we know that in this direction,
 if we look at the traffic in

0:11:45.220000 --> 0:11:49.200000
 that direction, source
 IP will be 1.1.1.1.

0:11:49.200000 --> 0:11:52.400000
 Destination IP will be 2.2.2.2.

0:11:52.400000 --> 0:11:59.280000
 Layer four protocol will equal TCP
 because we're talking about HTTP.

0:11:59.280000 --> 0:12:08.800000
 And then down here, the source TCP port
 number will be, we have no idea.

0:12:08.800000 --> 0:12:15.000000
 And then the destination TCP port
 number will be 80 for HTTP.

0:12:15.000000 --> 0:12:20.220000
 So notice that when traffic is being
 initiated from whoever's starting

0:12:20.220000 --> 0:12:24.820000
 the conversation, remember that the
 layer four source port number, most

0:12:24.820000 --> 0:12:28.780000
 of the time, not always, is what
 we call an ephemeral port number.

0:12:28.780000 --> 0:12:32.020000
 We have no idea what it's
 going to be at layer four.

0:12:32.020000 --> 0:12:36.360000
 This device says, okay, I've got a
 tab open and Internet Explorer or a

0:12:36.360000 --> 0:12:38.220000
 tab open in Google Chrome.

0:12:38.220000 --> 0:12:43.440000
 And so in order to keep track of this
 as an individual unique TCP session,

0:12:43.440000 --> 0:12:46.320000
 I'll just come up with some
 random port number.

0:12:46.320000 --> 0:12:49.720000
 And then if I open up another tab in Google
 Chrome or another tab in Internet

0:12:49.720000 --> 0:12:53.780000
 Explorer, well, the destination port number
 will be the same because they're

0:12:53.780000 --> 0:12:55.180000
 both going to HTTP.

0:12:55.180000 --> 0:13:00.000000
 So I need to come up with another
 unique random port number.

0:13:00.000000 --> 0:13:03.860000
 So if you were trying to match on this
 traffic going from left to right,

0:13:03.860000 --> 0:13:08.320000
 and you were trying to match on the
 source TCP port number in this field

0:13:08.320000 --> 0:13:12.800000
 right here, that would be next to impossible
 because there's really no

0:13:12.800000 --> 0:13:15.340000
 way you could predict
 what it would be.

0:13:15.340000 --> 0:13:20.020000
 But we're matching on the source port
 number would be possible is in the

0:13:20.020000 --> 0:13:23.500000
 return traffic. Because if we think
 about when that server is responding

0:13:23.500000 --> 0:13:29.400000
 back in that HTTP response, now the
 source will be two, two, two, two

0:13:29.400000 --> 0:13:33.120000
 destinations going
 back to that host.

0:13:33.120000 --> 0:13:40.640000
 Layer four protocol is still TCP, but
 get this, the source TCP port is

0:13:40.640000 --> 0:13:44.820000
 now 80 because it was going to 80.


0:13:44.820000 --> 0:13:47.380000
 And now 80 is responding back.

0:13:47.380000 --> 0:13:53.240000
 And the destination TCP port is whatever
 that random port number was.

0:13:53.240000 --> 0:13:57.580000
 So technically if you said, well, I
 want to block telnet sessions from

0:13:57.580000 --> 0:14:00.060000
 this host to this PC.

0:14:00.060000 --> 0:14:03.940000
 Most of the time people, the way people
 would do that is they would create

0:14:03.940000 --> 0:14:05.760000
 their extended access list.

0:14:05.760000 --> 0:14:10.100000
 They would apply it inbound right
 there on that interface.

0:14:10.100000 --> 0:14:14.580000
 And what they would be blocking would be
 the IP information and the destination

0:14:14.580000 --> 0:14:18.520000
 TCP port of 80 because
 we can match on that.

0:14:18.520000 --> 0:14:22.940000
 But theoretically, if you wanted to,
 you could still kill this connection,

0:14:22.940000 --> 0:14:30.200000
 prevent it from completing by instead
 putting the access group command

0:14:30.200000 --> 0:14:37.020000
 on this interface in the inbound direction
 and then matching on this and

0:14:37.020000 --> 0:14:40.340000
 matching on a source port of 80.

0:14:40.340000 --> 0:14:43.900000
 Now you might think to yourself, well,
 why would I want to do that?

0:14:43.900000 --> 0:14:46.100000
 Well, here's a particular reason.

0:14:46.100000 --> 0:14:50.140000
 Let's say that I'm the person who's
 in charge of this server.

0:14:50.140000 --> 0:14:55.300000
 And I say, well, this particular web server
 is only for people in my payroll

0:14:55.300000 --> 0:14:59.240000
 department. Nobody else in my company
 should even be trying to get to

0:14:59.240000 --> 0:14:59.960000
 this web server.

0:14:59.960000 --> 0:15:02.720000
 As a matter of fact, they shouldn't
 even know that it exists.

0:15:02.720000 --> 0:15:07.760000
 So anybody who's not in payroll, I want
 to block them if they try to get

0:15:07.760000 --> 0:15:09.920000
 to this web server.

0:15:09.920000 --> 0:15:10.960000
 Now here's the thing.

0:15:10.960000 --> 0:15:16.320000
 I want to know if anybody in the company
 is trying to get to the web server.

0:15:16.320000 --> 0:15:18.840000
 I want to keep some
 statistics on that.

0:15:18.840000 --> 0:15:23.080000
 So I actually, on the web server, want
 to have some program running that's

0:15:23.080000 --> 0:15:27.300000
 tracking all incoming HTTP requests,
 regardless of where they're coming

0:15:27.300000 --> 0:15:31.500000
 from. Now if they're not coming from
 payroll, I want to kill them.

0:15:31.500000 --> 0:15:36.540000
 So when the web server goes to reply to
 those requests from HR or marketing

0:15:36.540000 --> 0:15:39.500000
 or engineering, I want the
 router to stop that.

0:15:39.500000 --> 0:15:40.180000
 I want them stopped.

0:15:40.180000 --> 0:15:44.780000
 But I do want them to get to the server
 so my software program can track

0:15:44.780000 --> 0:15:46.020000
 that information.

0:15:46.020000 --> 0:15:49.560000
 And so I can say, hey, Joe over there
 marketing keeps trying to bring

0:15:49.560000 --> 0:15:51.240000
 up this payroll website.

0:15:51.240000 --> 0:15:53.560000
 He's not even supposed
 to know that it exists.

0:15:53.560000 --> 0:15:55.400000
 Why is he trying to do that?

0:15:55.400000 --> 0:15:57.840000
 And now I can do some
 investigation.

0:15:57.840000 --> 0:16:01.300000
 But if I had blocked that traffic inbound
 on the router, the server never

0:16:01.300000 --> 0:16:02.800000
 even would have received it.

0:16:02.800000 --> 0:16:06.520000
 There would be no way of me tracking statistics
 or accountability or anything

0:16:06.520000 --> 0:16:10.620000
 like that. So that might be one reason
 why you might want the traffic

0:16:10.620000 --> 0:16:14.740000
 to get to the destination and
 kill it on the return path.

0:16:14.740000 --> 0:16:16.160000
 So just an idea.

0:16:16.160000 --> 0:16:18.860000
 I don't know if anybody out there in
 the actual real world does that.

0:16:18.860000 --> 0:16:21.260000
 But that was an idea I had.

0:16:21.260000 --> 0:16:27.240000
 So you can see you can also match on
 the source and destination TCP or

0:16:27.240000 --> 0:16:28.580000
 UDP port numbers.

0:16:28.580000 --> 0:16:35.860000
 You can even match on
 the TCP control flags.

0:16:35.860000 --> 0:16:38.540000
 And example of matching on
 the TCP control flags.

0:16:38.540000 --> 0:16:42.420000
 And this is going a little bit more
 higher than the CCNA level.

0:16:42.420000 --> 0:16:46.680000
 But I like to explain why they
 made these things like this.

0:16:46.680000 --> 0:16:52.180000
 So we know that in every TCP session,
 before any TCP data is transferred,

0:16:52.180000 --> 0:16:55.400000
 the endpoints have to verify
 their existence.

0:16:55.400000 --> 0:16:59.300000
 And there's something that happens at
 the beginning of every TCP session.

0:16:59.300000 --> 0:17:01.780000
 What do we call that process?

0:17:01.780000 --> 0:17:04.960000
 That's called the TCP
 three way handshake.

0:17:04.960000 --> 0:17:07.660000
 So the initiator sends a TCP sin.

0:17:07.660000 --> 0:17:11.020000
 We get a sin plus an
 ACK and then an ACK.

0:17:11.020000 --> 0:17:15.100000
 Now at that point, all the other TCP
 traffic that goes back and forth

0:17:15.100000 --> 0:17:17.880000
 is always going to have
 the ACK bit set.

0:17:17.880000 --> 0:17:20.620000
 Everything in either direction because
 they're both going to be acknowledging

0:17:20.620000 --> 0:17:25.220000
 each other on every single TCP segment
 that flies back and forth.

0:17:25.220000 --> 0:17:32.500000
 So sometimes what people do is they
 say, well, I only want to allow TCP

0:17:32.500000 --> 0:17:37.720000
 sessions. Maybe you say, okay, this
 part of my network is the safe and

0:17:37.720000 --> 0:17:39.300000
 secure part of my network.

0:17:39.300000 --> 0:17:43.200000
 This is the part of the network that
 should be initiating TCP sessions.

0:17:43.200000 --> 0:17:45.720000
 They should always be
 starting this way.

0:17:45.720000 --> 0:17:48.940000
 So if traffic is always starting this
 way and I don't want this side to

0:17:48.940000 --> 0:17:52.640000
 initiate, this side is maybe the public
 internet and I don't want traffic

0:17:52.640000 --> 0:17:56.520000
 coming in from the public internet if it's
 being initiated from the internet.

0:17:56.520000 --> 0:17:59.760000
 It should just be in response
 to something in my company.

0:17:59.760000 --> 0:18:03.760000
 Well, if it's always being initiated
 here, that means every single TCP

0:18:03.760000 --> 0:18:08.240000
 segment coming from this direction will
 always have the ACK bit set, won't

0:18:08.240000 --> 0:18:10.660000
 it? This will be the only frame.

0:18:10.660000 --> 0:18:13.840000
 The very first TCP segment
 will have the sin bit set.

0:18:13.840000 --> 0:18:18.140000
 After that, everything else
 will have the ACK bit set.

0:18:18.140000 --> 0:18:22.220000
 So I could say, okay, I'm going to
 apply my access list inbound right

0:18:22.220000 --> 0:18:27.180000
 here and I'm only going to allow TCP
 segments that have the ACK bit set.

0:18:27.180000 --> 0:18:31.740000
 If the ACK bit is set, that means these
 guys are responding to something

0:18:31.740000 --> 0:18:33.300000
 that was initiated here.

0:18:33.300000 --> 0:18:37.960000
 If they try to initiate something with
 a sin, that will be dropped because

0:18:37.960000 --> 0:18:40.360000
 the ACK bit won't be
 turned on there.

0:18:40.360000 --> 0:18:42.360000
 And that's called an
 established session.

0:18:42.360000 --> 0:18:45.880000
 A TCP established session is
 one that has the ACK bit set.

0:18:45.880000 --> 0:18:48.180000
 So that's how sometimes people
 use those control flags.

0:18:48.180000 --> 0:18:53.700000
 They say match an any TCP session as
 long as the ACK bit is turned on.

0:18:53.700000 --> 0:18:57.080000
 And that's one way of enforcing
 that kind of thing.

0:18:57.080000 --> 0:19:03.020000
 Okay, and so we've already looked
 a little bit at configuring this.

0:19:03.020000 --> 0:19:07.480000
 So let's just do a
 quick lab on this.

0:19:07.480000 --> 0:19:10.280000
 I'm going to use the exact same topology
 that we used in the previous

0:19:10.280000 --> 0:19:12.980000
 lab for the standard access list.

0:19:12.980000 --> 0:19:16.680000
 And like I said, whenever you're working
 up a lab for yourself, at the

0:19:16.680000 --> 0:19:20.700000
 very beginning, you should always identify
 what your objective is, what

0:19:20.700000 --> 0:19:21.540000
 you're trying to accomplish.

0:19:21.540000 --> 0:19:29.220000
 With this lab. So in my objective
 is going to write it up here.

0:19:29.220000 --> 0:19:32.080000
 Objective. Test.

0:19:32.080000 --> 0:19:35.700000
 Extended. ACL functionality.

0:19:35.700000 --> 0:19:50.140000
 By denying any telnet traffic sourced
 from the 1.1.1.1.x.24 subnet.

0:19:50.140000 --> 0:19:59.840000
 Destined for the 2.4.2.0 subnet and
 allowing all other traffic types.

0:19:59.840000 --> 0:20:01.220000
 So that's what I'm
 going to try to do.

0:20:01.220000 --> 0:20:03.980000
 That's going to be my objective.

0:20:03.980000 --> 0:20:08.540000
 Alright, so let's
 think about this.

0:20:08.540000 --> 0:20:10.920000
 First of all, let's go ahead and create
 what the access list is going

0:20:10.920000 --> 0:20:13.760000
 to look like. And then we'll figure
 out where we want to apply it.

0:20:13.760000 --> 0:20:19.080000
 So we'll say access dash list and typically,
 I'll just use the first number

0:20:19.080000 --> 0:20:22.900000
 there. 100. And I want to deny.

0:20:22.900000 --> 0:20:24.860000
 And I'm talking about
 telnet traffic.

0:20:24.860000 --> 0:20:27.020000
 Now remember, I have to put
 something right here.

0:20:27.020000 --> 0:20:28.660000
 Either I put IP.

0:20:28.660000 --> 0:20:32.040000
 Now if I put IP, that's going
 to deny everything.

0:20:32.040000 --> 0:20:36.000000
 If you put IP in this field, at that
 point you've lost the ability to

0:20:36.000000 --> 0:20:38.660000
 match on any layer
 for information.

0:20:38.660000 --> 0:20:43.360000
 Once you put IP right here, Cisco iOS
 at that point won't give you any

0:20:43.360000 --> 0:20:46.360000
 ability to match on
 any layer for stuff.

0:20:46.360000 --> 0:20:49.660000
 So if I want to match on layer for information,
 I have to figure out what's

0:20:49.660000 --> 0:20:50.900000
 the layer for protocol.

0:20:50.900000 --> 0:20:54.720000
 Well in this case it would be TCP
 because telnet is carried in TCP.

0:20:54.720000 --> 0:20:58.580000
 And then in my source, I will put the
 subnet and I have to put a wildcard

0:20:58.580000 --> 0:21:00.980000
 mask that matches that.

0:21:00.980000 --> 0:21:05.920000
 And then I put the destination
 and the wildcard mask.

0:21:05.920000 --> 0:21:16.940000
 And then here, I could put EQ 23
 because telnet is TCP port 23.

0:21:16.940000 --> 0:21:22.000000
 Now if I just leave it like that, wherever
 I apply this, everything will

0:21:22.000000 --> 0:21:25.280000
 be dropped because remember at the end
 of every access list is that implicit

0:21:25.280000 --> 0:21:27.160000
 deny all that you can't see.

0:21:27.160000 --> 0:21:31.600000
 So now I need to create one more line
 that will permit everything else.

0:21:31.600000 --> 0:21:35.960000
 IP from any source
 to any destination.

0:21:35.960000 --> 0:21:38.380000
 So that's how my access
 list could be created.

0:21:38.380000 --> 0:21:41.940000
 Now we said the best way to do this is
 to place it as close to the source

0:21:41.940000 --> 0:21:49.180000
 as possible. So I think we should place
 that access list inbound right

0:21:49.180000 --> 0:21:52.320000
 on this interface.

0:21:52.320000 --> 0:21:58.040000
 So I'll say access
-group 100 inbound.

0:21:58.040000 --> 0:21:59.800000
 And that's where I'm
 going to put it.

0:21:59.800000 --> 0:22:03.800000
 It's actually IP access group
 to be technically precise.

0:22:03.800000 --> 0:22:06.400000
 So that's what I'm going to do.

0:22:06.400000 --> 0:22:10.520000
 So in order to test this to begin with,
 I need to enable a couple of these

0:22:10.520000 --> 0:22:15.600000
 routers, R4 and maybe one other device
 for telnet, which means I have

0:22:15.600000 --> 0:22:17.860000
 to go into my BTY lines and
 configure some passwords.

0:22:17.860000 --> 0:22:24.620000
 So let me do that on R3 and R4.

0:22:24.620000 --> 0:22:30.540000
 Line BTY04. And we'll
 just say password INE.

0:22:30.540000 --> 0:22:34.100000
 I'll type in the full
 command for you.

0:22:34.100000 --> 0:22:37.160000
 Okay, now if I try to tell them to the
 device, I'll have to supply a password

0:22:37.160000 --> 0:22:47.080000
 of INE. And in router 4, I'll
 do the exact same thing.

0:22:47.080000 --> 0:22:53.460000
 Okay, now I will go to router 1 and
 verify that I can ping and telnet

0:22:53.460000 --> 0:22:58.480000
 both devices. So let's try
 router 3 first, 2, 3, 2, 3.

0:22:58.480000 --> 0:23:03.100000
 PING, 2.3.2.3. Yes, I can ping it.


0:23:03.100000 --> 0:23:05.940000
 Let's see if I can initiate
 a telnet session to it.

0:23:05.940000 --> 0:23:11.140000
 Yes, I can. Okay, now let's verify I
 can do the same thing to router 4.

0:23:11.140000 --> 0:23:16.260000
 2, 4, 2, 4. I can...ah!

0:23:16.260000 --> 0:23:19.740000
 We still have our access list from
 the previous lab on the switch.

0:23:19.740000 --> 0:23:22.300000
 That's why that is not working.

0:23:22.300000 --> 0:23:25.160000
 So I need to go to switch to...

0:23:25.160000 --> 0:23:26.740000
 Review question.

0:23:26.740000 --> 0:23:28.420000
 What is the command I type?

0:23:28.420000 --> 0:23:31.440000
 I want to delete this access list, but
 I don't remember what the number

0:23:31.440000 --> 0:23:32.980000
 was that I configured.

0:23:32.980000 --> 0:23:35.540000
 Other than doing show run, we
 could always do show run.

0:23:35.540000 --> 0:23:39.520000
 What other command could I type into
 view what access lists are currently

0:23:39.520000 --> 0:23:41.320000
 configured on this box?

0:23:41.320000 --> 0:23:46.900000
 Well, hopefully you said
 show IP access-list.

0:23:46.900000 --> 0:23:50.460000
 Okay, so it's access list 1.

0:23:50.460000 --> 0:23:52.580000
 Now another thing I
 want to figure out.

0:23:52.580000 --> 0:23:58.380000
 Clearly this access list is being used
 by the IP access-group command,

0:23:58.380000 --> 0:24:03.660000
 which is on some interface, and
 that's why my ping failed.

0:24:03.660000 --> 0:24:10.380000
 But this does not show me which interface
 has that IP access-group command.

0:24:10.380000 --> 0:24:14.520000
 Any ideas as to what show command
 I could issue to see that?

0:24:14.520000 --> 0:24:19.580000
 Well, what I would start by doing
 is looking at my topology diagram.

0:24:19.580000 --> 0:24:24.460000
 Clearly, wherever it is, it's not on this
 interface, because this interface

0:24:24.460000 --> 0:24:25.420000
 would be irrelevant.

0:24:25.420000 --> 0:24:26.880000
 That would never prevent
 the traffic.

0:24:26.880000 --> 0:24:31.660000
 So it's either got to be on fast-ethan
 at 0.10 or fast-ethan at 0.4, one

0:24:31.660000 --> 0:24:34.680000
 of those two. So I'm
 going to check those.

0:24:34.680000 --> 0:24:42.340000
 You can do the show IP interface
 and then fast-ethan at 0.0.10.

0:24:42.340000 --> 0:24:46.760000
 And what you're looking for
 in here is this section.

0:24:46.760000 --> 0:24:51.140000
 So this says that on this interface,
 there are no access lists applied.

0:24:51.140000 --> 0:24:53.660000
 So let's take a look at
 the other interface.

0:24:53.660000 --> 0:24:56.480000
 And there we go.

0:24:56.480000 --> 0:25:00.300000
 Outgoing access list is 1.

0:25:00.300000 --> 0:25:03.920000
 So technically, I don't have
 to delete access list 1.

0:25:03.920000 --> 0:25:08.040000
 All I really have to delete is the access
 group command that's actually

0:25:08.040000 --> 0:25:08.940000
 on this interface.

0:25:08.940000 --> 0:25:13.080000
 Because once I remove that, the access
 list won't even be used by anything.

0:25:13.080000 --> 0:25:20.800000
 So interface fast-ethan at 0.4, no
 IP access-group 1, and it says it's

0:25:20.800000 --> 0:25:24.220000
 outgoing, so it would be out.

0:25:24.220000 --> 0:25:27.720000
 Now I'm going to go ahead and
 delete the access list.

0:25:27.720000 --> 0:25:31.740000
 Let me show you one other very important
 point about access lists.

0:25:31.740000 --> 0:25:35.720000
 First of all, let's take a look
 at the current access list.

0:25:35.720000 --> 0:25:36.780000
 I think it's pretty short.

0:25:36.780000 --> 0:25:39.380000
 I think it's only got
 like two lines in it.

0:25:39.380000 --> 0:25:41.540000
 Okay, yeah. So it's got two lines.


0:25:41.540000 --> 0:25:46.160000
 Let me just add two random lines so I can
 show you what I'm about to demonstrate

0:25:46.160000 --> 0:25:51.800000
 here. I'm just going
 to make something up.

0:25:51.800000 --> 0:25:54.980000
 And that's good enough.

0:25:54.980000 --> 0:25:57.440000
 Okay, so let's take a look
 at my access list.

0:25:57.440000 --> 0:26:01.100000
 Okay, there it is.

0:26:01.100000 --> 0:26:04.720000
 Now let's say I said, oh,
 this line was a mistake.

0:26:04.720000 --> 0:26:06.180000
 I didn't mean to put
 that in there.

0:26:06.180000 --> 0:26:07.700000
 I want to get rid of that line.

0:26:07.700000 --> 0:26:10.300000
 All right, so let's
 get rid of it here.

0:26:10.300000 --> 0:26:12.240000
 All right, that should do it.

0:26:12.240000 --> 0:26:16.240000
 Enter. Okay, now remember
 where the access list was?

0:26:16.240000 --> 0:26:18.740000
 It was sort of right below
 my RIP stuff, right?

0:26:18.740000 --> 0:26:20.600000
 Let's look at my access list now.

0:26:20.600000 --> 0:26:25.520000
 All right, so it's right below the RIP
 configuration right around there.

0:26:25.520000 --> 0:26:29.380000
 Let's see, and where is it?

0:26:29.380000 --> 0:26:33.400000
 It's gone. That is the
 point I wanted to make.

0:26:33.400000 --> 0:26:39.020000
 With a numbered access list, when you
 delete any of the lines, it deletes

0:26:39.020000 --> 0:26:41.940000
 all of them all at once.

0:26:41.940000 --> 0:26:43.720000
 Very important point.

0:26:43.720000 --> 0:26:48.060000
 So in hindsight, what I should have
 done is if I really want to delete

0:26:48.060000 --> 0:26:52.180000
 just this one line, I should have copied
 this entire access list into

0:26:52.180000 --> 0:26:57.120000
 a text editor, like WordPad or Notepad
 or something, deleted the line

0:26:57.120000 --> 0:27:03.020000
 there, and then when I knew that nobody
 was on my network, because I'm

0:27:03.020000 --> 0:27:06.160000
 going to have a temporary security
 hole here by doing this for like a

0:27:06.160000 --> 0:27:09.120000
 second or two. So at like 6 a.m.

0:27:09.120000 --> 0:27:10.580000
 in the morning or 3 a.m.

0:27:10.580000 --> 0:27:15.000000
 in the morning, log into this device,
 delete the entire access list, because

0:27:15.000000 --> 0:27:16.740000
 that's the only way you can do it.


0:27:16.740000 --> 0:27:20.540000
 And then very quickly copy and
 paste in the revised version.

0:27:20.540000 --> 0:27:22.760000
 That would be the
 only way to do it.

0:27:22.760000 --> 0:27:25.000000
 I shouldn't say that's
 the only way to do it.

0:27:25.000000 --> 0:27:29.620000
 There are more complicated ways, but
 at the CCNA level, that's what they

0:27:29.620000 --> 0:27:32.380000
 want you to take away from this.

0:27:32.380000 --> 0:27:37.300000
 Okay, so now that I've done that,
 let's go back to router one.

0:27:37.300000 --> 0:27:40.020000
 He should now be able to do
 his ping to router four.

0:27:40.020000 --> 0:27:44.500000
 He can. He should now be able to do
 his telnet to router four, and he

0:27:44.500000 --> 0:27:51.360000
 can. All right, so now let's go ahead
 and implement this access list.

0:27:51.360000 --> 0:27:55.020000
 And I'm going to do it inbound on switch
 one on his fast ethernet zero

0:27:55.020000 --> 0:27:59.300000
 slash one interface.

0:27:59.300000 --> 0:28:09.820000
 Okay, so access dash list 100 denied
 TCP, the source subnet of where the

0:28:09.820000 --> 0:28:12.360000
 traffic is going to come from.

0:28:12.360000 --> 0:28:17.300000
 The destination subnet of where
 the traffic is going.

0:28:17.300000 --> 0:28:22.060000
 And you can see here if I do a question
 mark, there's actually quite a

0:28:22.060000 --> 0:28:23.640000
 few things here I could do.

0:28:23.640000 --> 0:28:27.900000
 You can even do a time range, but you
 could say, I want to match on any

0:28:27.900000 --> 0:28:31.820000
 port numbers that are greater than
 a certain port number, or less than

0:28:31.820000 --> 0:28:33.360000
 a certain port number.

0:28:33.360000 --> 0:28:36.920000
 But in this particular case, I want
 to match on a specific port number,

0:28:36.920000 --> 0:28:38.680000
 port number 23, which is telnet.

0:28:38.680000 --> 0:28:43.660000
 So I'm going to say equal match only
 packets on this given port number.

0:28:43.660000 --> 0:28:47.980000
 So I'll say EQ, and then if I do the
 question mark, actually you can see

0:28:47.980000 --> 0:28:49.100000
 it already is aware.

0:28:49.100000 --> 0:28:51.020000
 I could type EQ telnet.

0:28:51.020000 --> 0:28:53.020000
 That would work.

0:28:53.020000 --> 0:28:54.640000
 Little hint though.

0:28:54.640000 --> 0:29:00.380000
 When you take the CCNA exam, they will
 expect you to know a lot of these

0:29:00.380000 --> 0:29:01.840000
 port numbers, not all of them.

0:29:01.840000 --> 0:29:04.060000
 This is a monstrous list here.

0:29:04.060000 --> 0:29:06.860000
 Let me tell you what some of the port
 numbers are that you should have

0:29:06.860000 --> 0:29:08.360000
 memorized going into the exam.

0:29:08.360000 --> 0:29:10.440000
 At least as far as
 TCP is concerned.

0:29:10.440000 --> 0:29:13.180000
 You want to know that BGP is 179.

0:29:13.180000 --> 0:29:19.240000
 You want to know that
 FTP uses 20 and 21.

0:29:19.240000 --> 0:29:21.760000
 Those are important.

0:29:21.760000 --> 0:29:28.340000
 You want to know that
 SMTP is port 25.

0:29:28.340000 --> 0:29:33.140000
 You want to know that
 telnet is port 23.

0:29:33.140000 --> 0:29:39.560000
 And you want to memorize that web
 browsing or HTTP is port 80.

0:29:39.560000 --> 0:29:43.260000
 Definitely want to make some flashcards
 for yourself and memorize those

0:29:43.260000 --> 0:29:45.500000
 TCP port numbers.

0:29:45.500000 --> 0:29:50.160000
 And now I'm just going to create my
 second line permitting everything

0:29:50.160000 --> 0:29:52.860000
 else. Okay, great.

0:29:52.860000 --> 0:29:54.760000
 And now I need to apply
 the access list.

0:29:54.760000 --> 0:30:00.600000
 So I will go onto my fast ethernet 0 slash
 1 and apply that with the access

0:30:00.600000 --> 0:30:04.060000
 group command in the
 inbound direction.

0:30:04.060000 --> 0:30:09.960000
 IP access dash group 100 in.

0:30:09.960000 --> 0:30:14.640000
 Okay, so the test is now router 1 should
 still be able to telnet and ping

0:30:14.640000 --> 0:30:22.600000
 to router 3. 2, 3, 2, 3.

0:30:22.600000 --> 0:30:30.240000
 And he can. He should still be able
 to ping router 4 to 4 to 4.

0:30:30.240000 --> 0:30:37.400000
 And he can, but he should no longer
 be able to telnet to router 4.

0:30:37.400000 --> 0:30:39.360000
 And he cannot. Destination
 unreachable.

