Forgalomirányítók Haladó Beállításai

Hozzáférési listák (ACL)

! Normál ACL (szám: 1-99)
R1(config)# access-list 1 permit 193.225.10.0 0.0.0.255 ! Hálózat engedélyezése
R1(config)# access-list 1 deny host 195.140.100.5 ! Egy gép tiltása

! Kiterjesztett ACL (szám: 100-199)
R1(config)# access-list 101 deny tcp 195.220.0.0 0.0.255.255 any eq 80 ! HTTP tiltása
! Operátorok: eq (egyenlő), ne (nem egyenlő), lt (kisebb), gt (nagyobb), range (tartomány)

! Nevesített ACL
R1(config)# ip access-list standard ACL-IN
R1(config)# ip access-list extended ACL-OUT
R1(config-ext-nacl)# permit icmp any any

! Interfészhez rendelés és leírás
R1(config-if)# ip access-group 1 out ! 'in' vagy 'out' irány
R1(config)# access-list 1 remark ez tilt mindent

! Web szerver elérés
R1(config)# ip http server
R1(config)# ip http secure-server
R1(config)# ip http authentication local

Címfordítás (NAT, DNAT, PAT)

R1(config-if)# ip nat inside ! Belső interfész megjelölése
R1(config-if)# ip nat outside ! Külső interfész megjelölése

! Statikus NAT
R1(config)# ip nat inside source static 10.10.10.1 209.21.34.11

! Statikus DNAT (Destination NAT / Port Forward)
R1(config)# ip nat inside source static tcp 192.168.1.10 80 209.21.34.11 80 ! Belső webszerver közzététele
R1(config)# ip nat inside source static tcp 192.168.1.20 22 209.21.34.11 2222 ! SSH port forward

! Dinamikus NAT
R1(config)# ip nat pool public_access 209.165.200.242 209.165.200.253 netmask 255.255.255.224
R1(config)# access-list 1 permit 192.168.123.0 0.0.0.255
R1(config)# ip nat inside source list 1 pool public_access

! PAT (Overload)
R1(config)# ip nat inside source list 1 interface Serial 0/0/0 overload

R1(config)# ip route 0.0.0.0 0.0.0.0 ser 0/0/0 ! Alapértelmezett út a netre

! Ellenőrzés:
R1# show ip nat translations ! Aktív NAT fordítások
R1# show ip nat statistics ! NAT statisztikák
R1# clear ip nat translation * ! NAT tábla törlése

Naplózás (Syslog, Konzol, Memória)

R1(config)# logging on
R1(config)# logging host 192.168.1.10 ! Távoli szerver
R1(config)# logging trap information ! Szint beállítása
R1(config)# logging facility local7
R1(config)# service timestamps log datetime localtime show-timezone msec

R1(config)# logging console information ! Konzolra
R1(config)# logging buffered 16000 information ! RAM-ba
R1(config)# logging monitor information ! Terminálra (VTY)
R1# terminal monitor ! EXEC módban engedélyezni kell

R1(config)# logging userinfo ! Privilégizált mód belépés naplózása
R1(config)# login on-failure log
R1(config)# login on-success log
R1(config)# security authentication failure rate 8 log
R1# show logging

Idő protokoll (NTP)

R1# show clock detail
R1(config)# clock timezone GMT+1
R1(config)# clock summer-time GMT recurring
R1# clock set 10:50:00 26 Oct 2011

R1(config)# ntp server 10.10.10.1 ! Időszerver megadása
R1(config)# ntp update-calendar
R1(config)# ntp broadcast client
R1(config)# ntp master ! Kiszolgáló szerep

! NTP Hitelesítés
R1(config)# ntp authentication-key 1 md5 cisco
R1(config)# ntp trusted-key 1
R1(config)# ntp authenticate

Hálózatmenedzsment (SNMPv2/v3)

! SNMPv2
R1(config)# snmp-server community public ro ! Csak olvasható
R1(config)# snmp-server community topsecret rw ! Írható
R1(config)# snmp-server location ceg.hu
R1(config)# snmp-server contact admin

! SNMPv3
R1(config)# snmp-server view VIEW_NEV iso included
R1(config)# snmp-server group CSOPORT v3 priv read VIEW_NEV
R1(config)# snmp-server user USER CSOPORT v3 auth sha JELSZO priv aes 128 PRIV_JELSZO

CDP és AAA Biztonság

! CDP (Cisco Discovery Protocol)
R1(config)# cdp run ! Globális engedélyezés
R1(config-if)# cdp enable ! Interfészen
R1# show cdp neighbors detail

! AAA Konfiguráció
R1(config)# aaa new-model ! AAA aktiválása
R1(config)# aaa authentication login default local ! Helyi adatbázis
R1(config)# aaa local authentication attempts max-fail 10 ! Tiltás 10 hiba után

! Külső szerverek
R1(config)# tacacs server SERVER-T
R1(config-server-tacacs)# address ipv4 10.0.0.2
R1(config-server-tacacs)# key T+-pass

R1(config)# radius server SERVER-R
R1(config-radius-server)# address ipv4 10.0.0.2 auth-port 1812 acct-port 1813
R1(config-radius-server)# key R-pass

Tunneling és FHRP (HSRP/GLBP)

! GRE Tunnel
R1(config)# interface Tunnel1
R1(config-if)# ip address 172.16.1.1 255.255.255.0
R1(config-if)# tunnel source 1.1.1.1
R1(config-if)# tunnel destination 2.2.2.2
R1(config-if)# ip tcp adjust-mss 1360

! HSRP (Hot Standby Router Protocol)
R1(config-if)# standby version 2
R1(config-if)# standby 1 ip 10.0.0.1 ! Virtuális IP
R1(config-if)# standby 1 priority 110 ! Magasabb = Aktív
R1(config-if)# standby 1 preempt ! Jogvisszavétel engedélyezése

! GLBP (Gateway Load Balancing Protocol)
R1(config-if)# glbp 1 ip 10.0.0.1
R1(config-if)# glbp 1 priority 110

Szerepkörök és Resilience

! Szerepkör alapú CLI (Views)
R1(config)# enable view ! Root view-ba lépés
R1(config)# parser view MONITOR-VIEW
R1(config-view)# secret class
R1(config-view)# commands exec include show ip route

! IOS Resilience (Védelem)
R1(config)# secure boot-image ! Képfájl elrejtése/védelme
R1(config)# secure boot-config ! Startup-config védelme
R1(config)# secure boot-config restore flash:restore_cfg

! Secure Copy (SCP)
R1(config)# ip scp server enable

Tűzfalak (Klasszikus és ZPF)

! Klasszikus (Context-Based Access Control - CBAC) tűzfal
! Megjegyzés: Legacy funkció, IOS 12.4 után a ZPF az ajánlott megoldás.
R1(config)# ip inspect name FWRULE icmp ! Szabály létrehozása
R1(config-if)# ip inspect FWRULE in ! Interfészre helyezés

! ZPF (Zone-Based Policy Firewall)
R1(config)# zone security PRIVATE ! Belső zóna létrehozása
R1(config)# zone security PUBLIC ! Külső zóna létrehozása – JAVÍTVA: hiányzó definíció pótolva
R1(config)# class-map type inspect match-any CLASS_NÉV
R1(config-cmap)# match protocol http
R1(config)# policy-map type inspect POLICY_NÉV
R1(config-pmap)# class type inspect CLASS_NÉV
R1(config-pmap-c)# inspect ! Akció: inspect, drop vagy pass
R1(config)# zone-pair security ZP source PRIVATE destination PUBLIC
R1(config-sec-zone-pair)# service-policy type inspect POLICY_NÉV
R1(config-if)# zone-member security PRIVATE ! Interfész hozzárendelése a PRIVATE zónához

IPS és Frame-Relay

! IPS (Intrusion Prevention System)
R1# mkdir ipsdir
R1(config)# ip ips name IOSIPS
R1(config)# ip ips config location flash:ipsdir
R1(config)# ip ips signature-category
R1(config-ips-category)# category all
R1(config-ips-category-action)# retired true
R1(config-if)# ip ips IOSIPS in

! Frame-Relay
R1(config-if)# encapsulation frame-relay
R1(config-if)# frame-relay lmi-type cisco
R1(config)# interface serial 0/0/0.102 point-to-point
R1(config-if)# frame-relay interface-dlci 102