交换机是cisco3550-24三层交换机,24口进100兆带宽,1口,2口,3口每个口出带宽限25兆,这些资料够了嘛
24口上面的网关ip是218.20.252.241,1口下面的ip是218.20.252.242,2口下面的ip是218.20.252.243,3口下面ip是218.20.252.244,我这台机的ip218.20.252.254,掩码是255.255.255.240
Switch#sh run
Building configuration...
Current configuration : 3239 bytes
!
version 12.2
no service pad
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname Switch
!
enable password cisco
!
no aaa new-model
ip subnet-zero
ip routing
!
mls qos aggregate-policer user1-in 25000000 2000000 exceed-action drop
mls qos
!
!
!
no file verify auto
spanning-tree mode pvst
spanning-tree extend system-id
!
!
!
vlan internal allocation policy ascending
!
class-map match-all match-alluser1-in
match ip dscp default
!
!
policy-map 10
class match-alluser1-in
police aggregate user1-in
!
!
!
interface FastEthernet0/1
switchport trunk encapsulation dot1q
switchport trunk native vlan 632
switchport mode trunk
service-policy input 10
service-policy output 10
!
interface FastEthernet0/2
switchport access vlan 632
switchport mode dynamic desirable
service-policy input 10
service-policy output 10
!
interface FastEthernet0/3
switchport access vlan 632
switchport mode dynamic desirable
service-policy input 10
service-policy output 10
!
interface FastEthernet0/4
switchport access vlan 2
switchport mode dynamic desirable
!
interface FastEthernet0/5
switchport access vlan 632
switchport mode dynamic desirable
service-policy input 10
service-policy output 10
!
interface FastEthernet0/6
switchport mode dynamic desirable
!
interface FastEthernet0/7
switchport mode dynamic desirable
!
interface FastEthernet0/8
switchport access vlan 3
switchport mode dynamic desirable
!
interface FastEthernet0/9
switchport mode dynamic desirable
!
interface FastEthernet0/10
switchport mode dynamic desirable
!
interface FastEthernet0/11
switchport mode dynamic desirable
!
interface FastEthernet0/12
no switchport
ip address 192.168.200.1 255.255.255.0
ip policy route-map test
!
interface FastEthernet0/13
switchport mode dynamic desirable
!
interface FastEthernet0/14
switchport mode dynamic desirable
!
interface FastEthernet0/15
switchport mode dynamic desirable
!
interface FastEthernet0/16
switchport mode dynamic desirable
!
interface FastEthernet0/17
switchport mode dynamic desirable
!
interface FastEthernet0/18
switchport mode dynamic desirable
!
interface FastEthernet0/19
switchport mode dynamic desirable
!
interface FastEthernet0/20
switchport mode dynamic desirable
!
interface FastEthernet0/21
switchport mode dynamic desirable
!
interface FastEthernet0/22
switchport mode dynamic desirable
!
interface FastEthernet0/23
switchport mode dynamic desirable
!
interface FastEthernet0/24
switchport trunk encapsulation dot1q
switchport trunk native vlan 632
switchport mode trunk
!
interface GigabitEthernet0/1
switchport mode dynamic desirable
!
interface GigabitEthernet0/2
switchport mode dynamic desirable
!
interface Vlan1
no ip address
!
interface Vlan2
ip address 192.168.0.1 255.255.255.0
!
interface Vlan3
ip address 192.168.1.1 255.255.255.0
!
interface Vlan100
no ip address
!
interface Vlan632
ip address 218.20.252.254 255.255.255.240
!
ip classless
ip route 0.0.0.0 0.0.0.0 218.20.252.241
ip http server
ip http secure-server
!
!
!
!
route-map test permit 112
match ip address 112
set ip next-hop 192.168.222.1
!
!
control-plane
!
!
line con 0
line vty 0 4
no login
line vty 5 15
no login
!
!
end
Switch#
案例二:
一、网络说明
PC1接在Cisco3550 F0/1上,速率为1M;
PC1接在Cisco3550 F0/2上,速率为2M;
Cisco3550的G0/1为出口。
二、详细配置过程
注:每个接口每个方向只支持一个策略;一个策略可以用于多个接口。因此所有PC的下载速率的限制都应该定义在同一个策略(在本例子当中
为policy -map user-down),而PC不同速率的区分是在Class-map分别定义。
1、在交换机上启动QOS
Switch(config)#mls qos //在交换机上启动QOS
2、分别定义PC1(10.10.1.1)和PC2(10.10.2.1)访问控制列表 Switch(config)#access-list 10 permit 10.10.1.0 0.0.0.255 //控制pc1上行流量
Switch(config)#access-list 100 permit any 10.10.1.0 0.0.0.255 //控制pc1下行流量
Switch(config)#access-list 11 permit 10.10.2.0 0.0.0.255 //控制pc2上行流量
Switch(config)#access-list 111 permit any 10.10.2.0 0.0.0.255 //控制pc2下行流量
3、定义类,并和上面定义的访问控制列表绑定 Switch(config)# class-map user1-up //定义PC1上行的类,并绑定访问列表10
Switch(config-cmap)# match access-group 10
Switch(config-cmap)# exit
Switch(config)# class-map user2-up
Switch(config-cmap)# match access-group 11 //定义PC2上行的类,并绑定访问列表10
Switch(config-cmap)# exit
Switch(config)# class-map user1-down
Switch(config-cmap)# match access-group 100 //定义PC1下行的类,并绑定访问列表100
Switch(config-cmap)# exit
Switch(config)# class-map user2-down
Switch(config-cmap)# match access-group 111 //定义PC2下行的类,并绑定访问列表111
Switch(config-cmap)# exit
4、定义策略,把上面定义的类绑定到该策略 Switch(config)# policy-map user1-up //定义PC1上行的速率为1M
Switch(config-pmap)# class user1-up
Switch(config-pmap-c)# trust dscp
Switch(config-pmap-c)# police 1024000 1024000 exceed-action drop
Switch(config)# policy-map user2-up //定义PC2上行的速率为2M
Switch(config-pmap)# class user2-up
Switch(config-pmap-c)# trust dscp
Switch(config-pmap-c)# police 2048000 1024000 exceed-action drop
Switch(config)# policy-map user-down
Switch(config-pmap)# class user1-down
Switch(config-pmap-c)# trust dscp
Switch(config-pmap-c)# police 1024000 1024000 exceed-action drop
Switch(config-pmap-c)# exit
Switch(config-pmap)# class user2-down
Switch(config-pmap-c)# trust dscp
Switch(config-pmap-c)# police 2048000 1024000 exceed-action drop
Switch(config-pmap-c)# exit
5、在接口上运用策略 Switch(config)# interface f0/1
Switch(config-if)# service-policy input user1-up
Switch(config)# interface f0/2
Switch(config-if)# service-policy input user2-up
Switch(config)# interface g0/1
Switch(config-if)# service-policy input user-down