Configurazione catalyst 3560x

Tutto ciò che ha a che fare con la configurazione di apparati Cisco (e non rientra nelle altre categorie)

Moderatore: Federico.Lagni

Rizio
Messianic Network master
Messaggi: 1158
Iscritto il: ven 12 ott , 2007 2:48 pm
Contatta:

squasar ha scritto:Non mi prende il comando "police".
Io ho la versione "IP base" e non "IP services".
E' possibile che sia questo il problema?
Oltre all'osservazione che ti ha fatto Scolpi ti consiglio di fare un giro in questa pagina dei tool cisco (devi avere un utente registrato ma credo che non debba avere nessun privilegio oltre la registrazione).

http://tools.cisco.com/Support/Fusion/F ... 4&myStep=3

Questa pagina ti consente di sapere la features che cerchi in che release software e in che versione è inserita, così puoi sapere se il problema è anche la IP base o meno.

Rizio
Si vis pacem para bellum
squasar
n00b
Messaggi: 18
Iscritto il: lun 11 mar , 2013 6:14 pm

Ciao,
questo è quello che ho trovato in internet riferito a questo modello di switch.

ip access-list extended http

permit tcp any any eq http


policy-map child-policy

class http

police cir 256000 conform-action-transmit exceed-action-drop


policy-map parent-policy

class class-default

shape average 512000

service-policy child-policy


class-map match-all http

match access group name http


Sicuramente in quanto scritto ci sono degli errori ma non essendo molto esperto non riesco a capire.
scolpi
Network Emperor
Messaggi: 337
Iscritto il: sab 30 ott , 2010 5:33 pm

squasar ha scritto:Ciao,
questo è quello che ho trovato in internet riferito a questo modello di switch.

ip access-list extended http

permit tcp any any eq http


policy-map child-policy

class http

police cir 256000 conform-action-transmit exceed-action-drop


policy-map parent-policy

class class-default

shape average 512000

service-policy child-policy


class-map match-all http

match access group name http


Sicuramente in quanto scritto ci sono degli errori ma non essendo molto esperto non riesco a capire.
il problema sta nel fatto che le ultime due righe vanno inserite prima della definizione della policy:
policy-map child-policy

altrimenti quando dai il comando class http, ti dice che non esiste e quindi rejetta il comando.
CCNA Security,CCDP, CCNP R&S
squasar
n00b
Messaggi: 18
Iscritto il: lun 11 mar , 2013 6:14 pm

Salve a tutti,
eccomi tornato dopo parecchio tempo in quanto solo ora riesco a dedicarmi di nuovo a questa configurazione.

Ecco cosa ho applicato:

3560-x(config)#ip access-list extended http
3560-x(config-ext-nacl)#permit tcp any host 10.2.1.48 eq 80
3560-x(config-ext-nacl)#class-map match-all http
3560-x(config-cmap)#match access-group name http
3560-x(config-cmap)#policy-map limita-http
3560-(config-pmap)#class http
3560-x(config-pmap-c)#police 1000000 12500 exceed-action drop
interface GigabitEthernet0/34
service-policy input limita-http

Ho provato a scaricare lo stesso file da due siti diversi per vedere se notavo differenze ma non sembra essersi limitato niente.
Inoltre avendo fatto dei test mi ritrovo la riga "policy-map child-policy" all'interno della configurazione e digitando "no policy-map child-policy" non compaiono errori ma se riguardo la configurazione la policy map è sempre presente.
Avete idee?
scolpi
Network Emperor
Messaggi: 337
Iscritto il: sab 30 ott , 2010 5:33 pm

probabilmente non noti niente perchè non scarichi a più di 1Mega, o forse la acl non è corretta.

Purtroppo il 3560 fa le operazioni di qos in hardware e i contatori nelle varie info degli show non si vedono, quindi il throubleshutting è difficile.

Per il problema della config da cancellare post lo show run che vediamo
CCNA Security,CCDP, CCNP R&S
squasar
n00b
Messaggi: 18
Iscritto il: lun 11 mar , 2013 6:14 pm

Ho provato a scaricare lo stesso file sullo stesso server da due siti diversi che hanno 2 IP diversi. L'ip che dovrebbe essere limitato è 10.2.1.48 sulla porta 80. Tutti e due i siti mi scaricano a 4/5 MB/s quindi supero il megabyte. Ho provato anche a sostituire l'IP privato con l'IP pubblico associato ma le cose non cambiano. E' possibile che sia necessaria una regola di output invece che di input?

Qui sotto la configurazione (ho sostituito con delle x alcuni dati privati)

version 12.2
no service pad
service timestamps debug datetime msec
service timestamps log datetime msec
service password-encryption
service sequence-numbers
!
hostname 3560-xxxxxx
!
boot-start-marker
boot-end-marker
!
enable secret 5 $1$/0VX$1lVc0z/7MDzOwLzCQFa9l.
!
!
!
no aaa new-model
clock timezone UTC 1
clock summer-time UTC recurring last Sun Mar 2:00 last Sun Oct 3:00
system mtu routing 1500
!
!
!
mls qos
!
crypto pki trustpoint TP-self-signed-3320307328
enrollment selfsigned
subject-name cn=IOS-Self-Signed-Certificate-3320307328
revocation-check none
rsakeypair TP-self-signed-3320307328
!
!
crypto pki certificate chain TP-self-signed-3320307328
certificate self-signed 01
30820244 308201AD A0030201 02020101 300D0609 2A864886 F70D0101 04050030
31312F30 2D060355 04031326 494F532D 53656C66 2D536967 6E65642D 43657274
69666963 6174652D 33333230 33303733 3238301E 170D3933 30333031 30303031
33305A17 0D323030 31303130 30303030 305A3031 312F302D 06035504 03132649
4F532D53 656C662D 5369676E 65642D43 65727469 66696361 74652D33 33323033
30373332 3830819F 300D0609 2A864886 F70D0101 01050003 818D0030 81890281
8100B726 03DCCFBA D1622B3E 02F1291E 892DD79F F4B0C86F E0E4BC02 BB400A7B
47F2C122 AA6BA31E FD2D277D 10FBD4E1 A4D45B82 D05F1188 854EFD6B 0C250AD5
FCAA7B4F 8C94663C 8B7D1057 742E0120 E5C3CE6E BB83B151 B074FD81 848C2DC5
67A83BB3 0808DBC6 02F993C7 049FABBF 6A356DCC B7874704 F37C8F55 C176C1E5
F3AB0203 010001A3 6C306A30 0F060355 1D130101 FF040530 030101FF 30170603
551D1104 10300E82 0C537769 74636833 35363078 2E301F06 03551D23 04183016
8014AC4E C25A321D 66D3066C 186EF280 EC4B62DC 0560301D 0603551D 0E041604
14AC4EC2 5A321D66 D3066C18 6EF280EC 4B62DC05 60300D06 092A8648 86F70D01
01040500 03818100 B5F2AF4B 81B396DF 3F312443 83CB735E 4666AD64 B5AF0F49
647075BD 092C1949 558E9429 FF564B6F 0AEDF027 F7610424 EECE3D42 07637082
53C9BAFD 57983FF0 F85653E1 0105A82A C060E957 DE481FF0 B800983E 899077E5
45998323 88CE1279 AAA8DF18 959428D2 886C065B 895AB4EA EBD46126 F2ED4850
188709BD F4FE19E0
quit
spanning-tree mode pvst
spanning-tree extend system-id
!
!
!
!
vlan internal allocation policy ascending
!
!
class-map match-all http
match access-group name http
!
!
policy-map limita-http
class http
police 1000000 12500 exceed-action drop
!
!
!
interface FastEthernet0
no ip address
!
interface GigabitEthernet0/1
description OUTSIDE - xxxx
switchport access vlan 6
spanning-tree portfast
!
interface GigabitEthernet0/2
description xxxxxxxxxxx
switchport access vlan 5
spanning-tree portfast
!
interface GigabitEthernet0/3
description xxxxxxxxxxx
spanning-tree portfast
!
interface GigabitEthernet0/4
description xxxxxxxxxxx
switchport access vlan 5
spanning-tree portfast
!
interface GigabitEthernet0/5
description xxxxxxxxxxx
spanning-tree portfast
!
interface GigabitEthernet0/6
description xxxxxxxxxxx
switchport access vlan 5
spanning-tree portfast
!
interface GigabitEthernet0/7
!
interface GigabitEthernet0/8
description xxxxxxxxxx
switchport access vlan 5
spanning-tree portfast
!
interface GigabitEthernet0/9
!
interface GigabitEthernet0/10
description xxxxxxxxxxxx
switchport access vlan 5
spanning-tree portfast
!
interface GigabitEthernet0/11
!
interface GigabitEthernet0/12
description xxxxxxxxxxxx
switchport access vlan 5
spanning-tree portfast
!
interface GigabitEthernet0/13
description xxxxxxxxxx
switchport access vlan 2
spanning-tree portfast
!
interface GigabitEthernet0/14
description xxxxxxxxxxxx
switchport access vlan 5
spanning-tree portfast
!
interface GigabitEthernet0/15
description xxxxxxxxxxx
switchport access vlan 6
spanning-tree portfast
!
interface GigabitEthernet0/16
description xxxxxxxxxx
switchport access vlan 5
spanning-tree portfast
!
interface GigabitEthernet0/17
description xxxxxxxxxxx
switchport access vlan 4
spanning-tree portfast
!
interface GigabitEthernet0/18
description xxxxxxxxxxx
switchport access vlan 5
spanning-tree portfast
!
interface GigabitEthernet0/19
!
interface GigabitEthernet0/20
description xxxxxxxxxxxxx
switchport access vlan 5
spanning-tree portfast
!
interface GigabitEthernet0/21
!
interface GigabitEthernet0/22
description xxxxxxxxxxx
switchport access vlan 5
spanning-tree portfast
!
interface GigabitEthernet0/23
!
interface GigabitEthernet0/24
description xxxxxxxxxxxx
switchport access vlan 5
spanning-tree portfast
!
interface GigabitEthernet0/25
!
interface GigabitEthernet0/26
description xxxxxxxxxxx
switchport access vlan 5
spanning-tree portfast
!
interface GigabitEthernet0/27
!
interface GigabitEthernet0/28
description xxxxxxxxxxxx
switchport access vlan 5
spanning-tree portfast
!
interface GigabitEthernet0/29
!
interface GigabitEthernet0/30
description xxxxxxxxxxx
switchport access vlan 5
spanning-tree portfast
!
interface GigabitEthernet0/31
!
interface GigabitEthernet0/32
description xxxxxxxxxxx
switchport access vlan 5
spanning-tree portfast
!
interface GigabitEthernet0/33
!
interface GigabitEthernet0/34
description xxxxxxxxxxxxx
switchport access vlan 5
spanning-tree portfast
service-policy input limita-http
!
interface GigabitEthernet0/35
!
interface GigabitEthernet0/36
description SERVER - LIBERA
switchport access vlan 5
spanning-tree portfast
!
interface GigabitEthernet0/37
description xxxxxxxxxxxx
spanning-tree portfast
!
interface GigabitEthernet0/38
description xxxxxxxxxxxx
spanning-tree portfast
!
interface GigabitEthernet0/39
description xxxxxxxxxxx
switchport access vlan 6
spanning-tree portfast
!
interface GigabitEthernet0/40
description xxxxxxxxxxxx
switchport access vlan 6
spanning-tree portfast
!
interface GigabitEthernet0/41
description xxxxxxxx
switchport access vlan 2
spanning-tree portfast
!
interface GigabitEthernet0/42
description xxxxxxxxxx
switchport access vlan 2
spanning-tree portfast
!
interface GigabitEthernet0/43
description xxxxxxxxxx
switchport access vlan 3
spanning-tree portfast
!
interface GigabitEthernet0/44
description xxxxxxxxxx
switchport access vlan 3
spanning-tree portfast
!
interface GigabitEthernet0/45
description xxxxxxxxxx
switchport access vlan 4
spanning-tree portfast
!
interface GigabitEthernet0/46
description xxxxxxxxxx
switchport access vlan 4
spanning-tree portfast
!
interface GigabitEthernet0/47
description xxxxxxxxxxxx
switchport access vlan 5
spanning-tree portfast
!
interface GigabitEthernet0/48
description xxxxxxxxxxx
switchport access vlan 5
spanning-tree portfast
!
interface GigabitEthernet1/1
!
interface GigabitEthernet1/2
!
interface GigabitEthernet1/3
!
interface GigabitEthernet1/4
!
interface TenGigabitEthernet1/1
!
interface TenGigabitEthernet1/2
!
interface Vlan1
description INSIDE
ip address x.x.x.x 255.255.255.0
!
interface Vlan2
description xxx
no ip address
no ip route-cache
no ip mroute-cache
spanning-tree portfast
!
interface Vlan3
description xxx
no ip address
no ip route-cache
no ip mroute-cache
spanning-tree portfast
!
interface Vlan4
description xxx
no ip address
no ip route-cache
no ip mroute-cache
spanning-tree portfast
!
interface Vlan5
description xxx
no ip address
no ip route-cache
no ip mroute-cache
spanning-tree portfast
!
interface Vlan6
description xxx
no ip address
no ip route-cache
no ip mroute-cache
spanning-tree portfast
!
ip default-gateway x.x.x.x
ip classless
ip http server
ip http secure-server
!
ip access-list extended http
permit tcp any any eq www
!
!
!
line con 0
line vty 0 4
password 7 120E541B16185D002F3D36
login
line vty 5 15
password 7 15055A0000397A202D2527
login
!
end
Rizio
Messianic Network master
Messaggi: 1158
Iscritto il: ven 12 ott , 2007 2:48 pm
Contatta:

Scolpi, scusa se mi intrometto ma mi sorge un dubbio vedendo la sua conf: la policy per funzionare non deve essere applicata ad un'interfaccia IP?

Rizio
Si vis pacem para bellum
squasar
n00b
Messaggi: 18
Iscritto il: lun 11 mar , 2013 6:14 pm

La policy infatti è associata a:

interface GigabitEthernet0/34
scolpi
Network Emperor
Messaggi: 337
Iscritto il: sab 30 ott , 2010 5:33 pm

sei sicuro che il traffico diretto all'host di destinazione entri proprio da quell'interfaccia?

io la applicherei all'interfaccia vlan 5

assumendo che l'host di destinazione sia su una rete che verrà ruotata; per semplificare, supponiamo che il mondo esterno, dove si trova il server, venga visto dallo switch via vlan 5 e che il client si trovi sulla vlan 6, la policy la applichi all' interface vlan 5 in input.
CCNA Security,CCDP, CCNP R&S
Rizio
Messianic Network master
Messaggi: 1158
Iscritto il: ven 12 ott , 2007 2:48 pm
Contatta:

squasar ha scritto:La policy infatti è associata a:

interface GigabitEthernet0/34
Si, che non ha nessun ip layer3

Rizio
Si vis pacem para bellum
Rizio
Messianic Network master
Messaggi: 1158
Iscritto il: ven 12 ott , 2007 2:48 pm
Contatta:

scolpi ha scritto:io la applicherei all'interfaccia vlan 5
Perciò lavora anche a layer2?

Rizio
Si vis pacem para bellum
scolpi
Network Emperor
Messaggi: 337
Iscritto il: sab 30 ott , 2010 5:33 pm

Non sono un esperto di qos su switch e non ho mai configurato qos su switch se non il classico mls qos trust ecc... , però avendo fatto un corso e leggendo le guide, la config dello switch andrebbe bene solo che presuppone che il traffico in arrivo dal server entri dall'interfaccia giga 0/34.

Applicando la policy alla svi X e configurando tutte le interfaccie fisiche della stessa vlan X con il comando: mls qos vlan-based, tutto il traffico che dalla vlan X va verso un'altra è sottoposto a policy indipendentemente dalla porta fisica da cui entra.
CCNA Security,CCDP, CCNP R&S
squasar
n00b
Messaggi: 18
Iscritto il: lun 11 mar , 2013 6:14 pm

Non posso applicare la regola a tutta la VLAN in quanto devo limitare l'http di un un solo sito presente su quell'interfaccia. Faccio presente che il mio catalyst 3560x è un IP Base quindi layer3.
scolpi
Network Emperor
Messaggi: 337
Iscritto il: sab 30 ott , 2010 5:33 pm

squasar ha scritto:Non posso applicare la regola a tutta la VLAN in quanto devo limitare l'http di un un solo sito presente su quell'interfaccia. Faccio presente che il mio catalyst 3560x è un IP Base quindi layer3.
La conf presuppone che su quell'interfaccia (interface GigabitEthernet0/34) ci sia il client non il server, infatti l'acl presuppone che la porta 80 sia nella destinezione del pacchetto.
Se invece lì si trova il server devi girare l'acl
CCNA Security,CCDP, CCNP R&S
squasar
n00b
Messaggi: 18
Iscritto il: lun 11 mar , 2013 6:14 pm

Con "girare" intendi che devo impostare la regola in output invece che in input?
Rispondi