Exempel 3

Antag att PC1 i det inre privata LAN 10 är tillåten FTP-, SSH-, Telnet-, DNS-, HTTP- och HTTPS-trafik. Alla andra datorer i samma LAN nekas att ta sig ut till andra nätverk.

I detta exempel ska jag konfigurera två namngivna extended ACL:

  • PERMIT-PC1 – Tillåter endast PC1 använda TCP-åtkomst till internet och nekar samma åtkomst alla andra datorer i LAN 10
  • REPLY-PC1 – Tillåter enbart TCP-trafik som kommer tillbaka från Internet till PC1 och implicit neka all annan trafik.

Observera att FTP (dvs portar 20 och 21), SSH (22), Telnet (23), DNS (53), HTTP (80) och HTTPS (443) använder TCP medan DNS (53) använder både TCP och UDP.

PERMIT-PC1 ACL tillämpas som inkommande och REPLY-PC1 ACL tillämpas som utgående på R1 G0/0/0-interface.

Nätverkstopologi

Tre routrar av modellen 433 och routing med EIGRP

Konfigurationer

  • Server
  • IP address: 209.165.299.225
  • Subnet Mask: 255.255.255.252
  • Default Gateway: 209.165.200.226
  • DNS: 209.165.299.225
  • PC1
  • IP address: 192.168.10.10
  • Subnet Mask: 255.255.255.0
  • Default Gateway: 192.168.10.254
  • DNS: 209.165.299.225
  • PC2
  • IP address: 192.168.10.11
  • Subnet Mask: 255.255.255.0
  • Default Gateway: 192.168.10.254
  • DNS: 209.165.299.225
  • PC3
  • IP address: 192.168.20.10
  • Subnet Mask: 255.255.255.0
  • Default Gateway: 192.168.10.254
  • DNS: 209.165.299.225
  • PC4
  • IP address: 192.168.30.10
  • Subnet Mask: 255.255.255.0
  • Default Gateway: 192.168.10.254
  • DNS: 209.165.299.225
  • Router> enable
  • Router# configure terminal
  • Router(config)# hostname R1
  • R1(config)# no ip domain-lookup
  • R1(config)# interface Gig 0/0/0
  • R1(config-if)# description Connected to LAN 1
  • R1(config-if)# ip address 192.168.10.254 255.255.255.0
  • R1(config-if)# duplex auto
  • R1(config-if)# speed auto
  • R1(config-if)# no shutdown
  • R1(config-if)# exit
  • R1(config)# interface Gig 0/0/1
  • R1(config-if)# description Connected to LAN 2
  • R1(config-if)# ip address 192.168.20.254 255.255.255.0
  • R1(config-if)# duplex auto
  • R1(config-if)# speed auto
  • R1(config-if)# no shutdown
  • R1(config)# exit
  • R1(config-if)# interface Se0/1/0
  • R1(config-if)# description Connected to R2
  • R1(config-if)# ip address 10.1.1.1 255.255.255.252
  • R1(config-if)# no shutdown
  • R1(config-if)# exit
  • R1(config)# router eigrp 100
  • R1(config-router)# network 192.168.10.0
  • R1(config-router)# network 192.168.20.0
  • R1(config-router)# network 10.1.1.0
  • R1(config-router)# end
  • R1#
  • Router> enable
  • Router# configure terminal
  • Router(config)# hostname R2
  • R2(config)# no ip domain-lookup
  • R2(config-if)# interface Gig 0/0/0
  • R2(config-if)# description Connected to ISP
  • R2(config-if)# ip address 209.165.200.226 255.255.255.252
  • R2(config-if)# duplex auto
  • R2(config-if)# speed auto
  • R2(config-if)# no shutdown
  • R2(config-if)# exit
  • R2(config)# interface Gig 0/0/1
  • R2(config-if)# no ip address
  • R2(config-if)# duplex auto
  • R2(config-if)# speed auto
  • R2(config-if)# shutdown
  • R2(config-if)# exit
  • R2(config)# interface Se0/1/0
  • R2(config-if)# description DCE connected to R1
  • R2(config-if)# clock rate 4000000
  • R2(config-if)# ip address 10.1.1.2 255.255.255.252
  • R2(config-if)# no shutdown
  • R2(config-if)# exit
  • R2(config)# interface Se0/1/1
  • R2(config-if)# description DCE connected to R3
  • R2(config-if)# clock rate 4000000
  • R2(config-if)# ip address 10.2.2.2 255.255.255.252
  • R2(config-if)# no shutdown
  • R2(config-if)# exit
  • R2(config)# router eigrp 100
  • R2(config-router)# passive-interface Gig 0/0/1
  • R2(config-router)# network 10.1.1.0
  • R2(config-router)# network 10.2.2.0
  • R2(config-router)# network 209.165.200.224
  • R2(config-router)# end
  • R2#
  • Router> enable
  • Router# configure terminal
  • Router(config)# hostname R3
  • R3(config)# no ip domain-lookup
  • R3(config)# interface Gig 0/0/0
  • R3(config-if)# description Connected to LAN 30
  • R3(config-if)# ip address 192.168.30.254 255.255.255.0
  • R3(config-if)# duplex auto
  • R3(config-if)# speed auto
  • R3(config-if)# no shutdown
  • R3(config-if)# exit
  • R3(config)# interface Gig 0/0/1
  • R3(config-if)# no ip address
  • R3(config-if)# duplex auto
  • R3(config-if)# speed auto
  • R3(config-if)# shutdown
  • R3(config-if)# exit
  • R3(config)# interface Se0/1/1
  • R3(config-if)# description Connected to R2
  • R3(config-if)# ip address 10.2.2.1 255.255.255.252
  • R3(config-if)# no shutdown
  • R3(config-if)# exit
  • R3(config)# router eigrp 100
  • R3(config-router)# passive-interface Gig 0/0/1
  • R3(config-router)# network 10.1.1.0
  • R3(config-router)# network 192.168.30.0
  • R3(config-router)# end
  • R3#
  • R1(config)# ip access-list extended PERMIT-PC1
  • R1(config-ext-nacl)# Remark Permit PC1 TCP access to internet
  • R1(config-ext-nacl)# permit tcp host 192.168.10.10 any eq 20
  • R1(config-ext-nacl)# permit tcp host 192.168.10.10 any eq 21
  • R1(config-ext-nacl)# permit tcp host 192.168.10.10 any eq 22
  • R1(config-ext-nacl)# permit tcp host 192.168.10.10 any eq 23
  • R1(config-ext-nacl)# permit udp host 192.168.10.10 any eq 53
  • R1(config-ext-nacl)# permit tcp host 192.168.10.10 any eq 53
  • R1(config-ext-nacl)# permit tcp host 192.168.10.10 any eq 80
  • R1(config-ext-nacl)# permit tcp host 192.168.10.10 any eq 443
  • R1(config-ext-nacl)# deny ip 192.168.10.0 0.0.0.255 any
  • R1(config-ext-nacl)# exit
  • R1(config)#
  • R1(config)# ip access-list extended REPLY-PC1
  • R1(config-ext-nacl)# Remark Only permit returning traffic to PC1
  • R1(config-ext-nacl)# permit tcp any host 192.168.10.10 established
  • R1(config-ext-nacl)# exit
  • R1(config)# interface g0/0/0
  • R1(config-if)# ip access-group PERMIT-PC1 in
  • R1(config-if)# ip access-group REPLY-PC1 out
  • R1(config-if)# end
  • R1#
  • R1# show ip interface Gig 0/0/0
  • R1# show ip interface Gig 0/0/0 | include access list
  • R1# show access-lists
  • R1# show running-config | begin ip access-list