Cover | Table of Contents | Colophon
Policy Set #1: IP address 192.168.30.1
Policy Set #1: IP address 192.168.33.5
Policy Set #1: No other IP addresses
access-list 1 permit 192.168.30.1 access-list 1 permit 192.168.33.5 access-list 1 deny 0.0.0.0 255.255.255.255
access-list keyword is the access
list number, so in this example, we define access list 1. The number
also specifies what kind of access list it is. Different types of
access lists for different network protocols use different ranges of
access list numbers (e.g., IP uses 1-99 for standard access lists and
100-199 for extended access lists; IPX uses 800-899 for its standard
access lists, while DECnet uses 300-399). The first two entries use
the keyword 1 in a access list wildcard mask is a
wildcard, meaning that the corresponding bit in the IP address is a
match no matter what the value is in the IP address being compared. A
0 indicates that the corresponding bit must match
the IP address exactly.1's in the last
portion of a mask to match all the hosts in that network, like this:192.168.30.0 0.0.0.255
1's
in a mask were on the right while the 0's
were on the left, but we can mask on other portions of an IP address
to consolidate access list entries, as we'll see here.
Let's include four networks in a policy set: 192.168.32.0/24,
192.168.33.0/24, 192.168.34.0/24, and 192.168.35.0/24. The following
access list entries accomplish this:access-list 1 permit 192.168.32.0 access-list 1 permit 192.168.33.0 access-list 1 permit 192.168.34.0 access-list 1 permit 192.168.35.0
|
Third octet decimal value
|
Binary equivalent
|
|---|---|
|
32
|
RouterA# conf term RouterA(config)# access-list 1 permit 192.168.30.1 RouterA(config)# access-list 1 permit 192.168.33.5
access-list 1 permit 192.168.30.1 access-list 1 permit 192.168.33.5
RouterA# conf term RouterA(config)# access-list 1 permit 192.168.30.2 RouterA(config)# access-list 1 deny 192.168.30.1
access-list 1 permit 192.168.30.1 access-list 1 permit 192.168.33.5 access-list 1 permit 192.168.30.2 access-list 1 deny 192.168.30.1
permit 192.168.30.1. The deny
entry does not "cancel" the permit
entry; it only makes the access list bigger. Moreover, it is never
even evaluated. As I mentioned earlier in the chapter, access lists
are evaluated sequentially. The permit entry for
host 192.168.30.1 is always evaluated before the
network-admin-hosts used to restrict router
logins:line vty 0 4 access-class network-admin-hosts in
incoming-web-traffic used for packet filtering:interface Ethernet0 Ip access-group incoming-web-traffic in
RouterA# conf terminal RouterA(config)# ip access-list standard network-admin-hosts RouterA(config-std-nacl)# permit 192.168.30.1 RouterA(config-std-nacl)# permit 192.168.33.5
access-list 101 permit tcp any host 192.168.35.1 eq www access-list 101 permit tcp any host 192.168.35.1 eq 443
ip route 192.168.29.0 255.255.255.0 null0
ip route 192.168.29.1 255.255.255.255 null0
offset-list statements to alter routing metrics
and altering route administrative distances based on the sources of
routing updates.
Only traffic to and from 172.18.0.0/16 should go through Router 1
Only the hosts at IP addresses 192.168.30.1 and 192.168.33.5 may telnet into the router
access-list 1 permit 192.168.30.1 access-list 1 permit 192.168.33.5
line vty 0 4 access-class 1 in
Only the hosts at IP addresses 192.168.30.1 and 192.168.33.5 may telnet into the router
access-list 1 permit 192.168.30.1 access-list 1 permit 192.168.33.5
line vty 0 4 access-class 1 in
Serial 0 is up, line protocol is up Internet address is 192.168.1.2/24 Broadcast address is 192.168.1.255 Address determined by non-volatile memory MTU is 1500 bytes Helper address is not set Directed broadcast forwarding is enabled Outbound access list is 102 Inbound access list is 101 Proxy ARP is enabled Security level is default Split horizon is enabled ICMP redirects are always sent ICMP unreachables are always sent ICMP mask replies are never sent IP fast switching is enabled IP fast switching on the same interface is enabled IP Optimum switching is disabled IP Flow switching is enabled IP CEF switching is enabled IP Distributed switching is enabled IP LES Flow switching turbo vector IP Flow CEF switching turbo vector IP multicast fast switching is disabled IP multicast distributed fast switching is disabled Router Discovery is disabled IP output packet accounting is enabled IP access violation accounting is disabled TCP/IP header compression is disabled Probe proxy name replies are disabled Gateway Discovery is disabled Policy routing is disabled Web Cache Redirect is disabled BGP Policy Mapping is enabled (source ip-prec-map)
access-list 1 permit 19.0.0.0 router eigrp 1000 network 192.168.3.0 distribute-list 1 in serial 1
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
U - per-user static route, o - ODR
Gateway of last resort is 172.28.1.5 to network 172.28.0.0
D EX 19.0.0.0/8 [170/2202624] via 192.168.3.2, 3w5d, Serial1
D EX 10.0.0.0/8 [170/2239232] via 172.28.1.5, 3w5d, FastEthernet0/0
D EX 192.168.4.0/24 [100/2174464] via 172.28.1.5, 3w5d, FastEthernet0/0
D EX 198.175.107.0/24 [100/2239232] via 143.183.152.251, 3w5d, FastEthernet1/0
C 192.168.1.0/24 is directly connected, Serial1
172.28.0.0/16 is variably subnetted, 226 subnets, 4 masks
C 172.28.1.0/26 is directly connected, FastEthernet1/0access-list 1 permit 172.28.0.0 0.0.0.0.0 access-list 1 deny 172.28.0.0 0.0.0.0.255
route-map route-map-name {permit|deny} {sequence number}
match clauses
policy settings