Below you can find the template to mark any traffic coming from the interface "TenGigabitEthernet1/0/40" with a value of DSCP 40. The cos will automatically mapped by the switch over the trunk port.
ip access-list extended INGRESS //create and acl to define any traffic coming in
10 permit ip any any
class-map match-any adacmap //match that aacl in the class map
match access-group name INGRESS
policy-map ADA-policy //create a policy map and call the class map.
class adacmap
set dscp 40 // set the qos to "cs5" which is equivalent to "40"
interface TenGigabitEthernet1/0/40 //apply it under all the interface individually where you wnt your hosts to be marked as DSCP 40.
switchport access vlan 192
switchport mode access
service-policy input ADA-policy
end
You can verify the configurations by running the below command.
switch#sh policy-map interface TenGigabitEthernet1/0/40 input
You'll see packets counter incrementing under the policy that you made:
#show policy-map interface TenGigabitEthernet1/0/40 input TenGigabitEthernet1/0/40
Service-policy input: ADA-policy
Class-map: adacmap (match-any)
259020 packets
Match: access-group name INGRESS
QoS Set
dscp cs5
Class-map: class-default (match-any)
127984 packets
Match: any
Please vote if you find this helpful.