Sunday, April 20, 2014

Limit bandwidth base on ip address -- cisco

! create class map        
class-map match-any limitedHost
 match access-group 115
!        
! create policy map and set the limitation to   1000000 bit     
policy-map queueHost
 class limitedHost
  police cir 1000000 bc 250000 be 250000
    conform-action transmit
    exceed-action drop
    violate-action drop
!        
!        
!        
!        
!        
! set ip address on interface f0/0 and apply the policy-map to limit 1000000bit        
interface FastEthernet0/0
 ip address 192.168.57.1 255.255.255.0
 duplex auto
 speed auto
 service-policy input queueHost
 service-policy output queueHost
!        
interface FastEthernet0/1
 ip address 192.168.58.1 255.255.255.0
 duplex auto
 speed auto
!        
!        
!        
!        
ip http server
no ip http secure-server
! create access 115 and add ip address that we want to limit       
access-list 115 permit ip 192.168.57.0 0.0.0.255 any
access-list 115 permit ip any 192.168.57.0 0.0.0.255
!        
!        

No comments:

Post a Comment