Exempel 3

ACL listor filtrerar vanligtvis nätverkstrafik in i routern och ut från routern, det vill säga inkommande eller utgående trafik på routers interface. En ACL kan dock också användas för att säkra åtkomst till nätverksenheter över ett nätverk med syfte att administrera dem. Åtkomsten på avstånd görs via virtuella terminaler som kallas vty linjer.

Flera olika protokoll kan används för att hantera nätverksenheter på avstånd och i detta exempel behandlas Secure Shell eller SSH. Protokollet kan kryptera inloggning och nätverkstrafik och därför bör det användas i produktionsmiljöer. I detta exempel ska först skapas användaren admin som enbart från datorn PC1 får starta SSH-trafik. Därefter ska SSH aktiveras och konfigureras så att VTY linjerna kan säkras med hjälp av en ACL.  Jag kommer att använda en namngiven ACL.

Följande bör beaktas när du konfigurerar åtkomstlistor på vty-linjer:

  • Minst en användare bör finnas i routerns lokala databasen för autentisering.
  • SSH aktivering kräver hostname, domain-name och SRA krypteringsnycklar.
  • Både namngivna och numrerade ACL kan tillämpas på vty-linjer.
  • Identiska begränsningar bör ställas in på alla vty-linjer, eftersom en användare kan försöka ansluta till någon av dem.

Nätverkstopologi

Konfigurationer

  • 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.2.2.0
  • R3(config-router)# network 192.168.30.0
  • R3(config-router)# end
  • R3#
  • Router> enable
  • Router# configure terminal
  • Router(config)# hostname R2
  • R2(config)# no ip domain-lookup
  • R2(config)# interface Gig 0/0/0
  • 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 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)# network 10.1.1.0
  • R2(config-router)# network 10.2.2.0
  • network 209.165.200.224
  • R2(config-router)# end
  • R2#
  • 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 10
  • 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 20
  • 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-if)# exit
  • R1(config)# interface Gig 0/0/2
  • R1(config-if)# no ip address
  • R1(config-if)# duplex auto
  • R1(config-if)# speed auto
  • R1(config-if)# shutdown
  • R1(config-if)# exit
  • R1(config)# interface Se0/0/0
  • R1(config-if)# no ip address
  • R1(config-if)# duplex auto
  • R1(config-if)# speed auto
  • R1(config-if)# shutdown
  • R1(config-if)# exit
  • R1(config)# 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)# exit
  • R1(config)#
  • R1(config)# enable secret ensecP@55
  • R1(config)# username admin secret adminP@55
  • R1(config)# ip domain-name diginto.se
  • R1(config)# line vty 0 4
  • R1(config-line)# login local
  • R1(config-line)# logging synchronous
  • R1(config-line)# exec-timeout 5
  • R1(config-line)# transport input ssh
  • R1(config-line)# exit
  • R1(config)# crypto key generate rsa general-keys modulus 1024
  • R1(config)# ip ssh version 2
  • R1(config)# end
  • R1#
  • R1(config)# ip access-list standard ADMIN-HOST
  • R1(config-std-nacl)# remark This ACL secures incoming vty lines
  • R1(config-std-nacl)# permit 192.168.10.10
  • R1(config-std-nacl)# deny any
  • R1(config-std-nacl)# exit
  • R1(config)# line vty 0 4
  • R1(config-line)# access-class ADMIN-HOST in
  • R1(config-line)# 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