Hi,
Doesn't anyone think that just trusting everything incoming is a problem? If asked, everyone suggests to indeed define policies if you don't like it, but there are no examples of a really secure config. So let me give one later.
I've seen all the referenced documents but the problem here is, there is so much info but no canonical reference that would be self-explanatory (including CLI and configuration guides).
It starts with "CoS" not actually meaning the 802.1p header, but the Class-of-service system implemented in the switches, including CoS "priority", ToS and the mapping between both. I highly recommend to everyone to initially get a grip on the nomenclature used!
As for the promised example, the following basically trusts an IP network (in our case the IP phones), since these can only talk to the callserver through our firewall.
For edge ports:
# reset everything to CoS/ToS 0 ... set policy profile 1 name "TrustNoOneAndPriorityForVoIP" cos-status enable cos 0 # ... except for VoIP phones set policy rule 1 ipsourcesocket 172.16.0.0 mask 16 cos 5 # apply the previous policy to all user ports but do NOT apply to uplink ports, those should be trusted anyway! set policy port ge.*.1-46 1 # map CoS 0 to ToS 0: since the policy profile above sets CoS to 0 for unknown traffic, this has the effect of resetting any incoming DSCP to 0 as a consequence set cos settings 0 tos-value 0 # also map CoS 5 to ToS 184 (Note: This has the general effect of applying a DSCP value 184 to all tagged traffic with an 802.1p priority of 5 on that switch.) This can be useful when there are layer 3 devices (like a firewall) in the data path which evaluate ToS/DSCP but not CoS set cos settings 5 tos-value 184 # enable the CoS system in the switch to actually perform the defined mappings set cos state enable
For uplink ports:(the call server's replies)
# for uplink ports: set policy profile 2 name "UplinkMapToS" # map incoming ToS 184 to CoS, since CoS is the only thing that matters to the switch set policy rule 2 iptos 184 mask 8 cos 5 # apply to uplinks set policy port ge.*.48 2 # (if not already set) map ToS->CoS: incoming ToS (no CoS) on uplink will set CoS 5 in 802.1p header set cos settings 5 tos-value 184 set cos state enable
Tests that I carried out:
Phone which already sets CoS and ToS: remapped to 0 if no policy rule defined Phone which sets no CoS and/or no ToS: if in the specified IP network, CoS and ToS will be set by the switch --> In other words: no matter what the phone sets it will be rewritten to the CoS specified in the policy (and to ToS specific in "cos settings"). All other traffic will be set to CoS 0. That is what I call having your QoS under control.
BTW I also tried to match traffic based on VLAN but it didn't do anything, that's why I started using IP networks.
set policy profile 2 name "PriorityForVoIP" cos-status enable cos 5 set policy rule admin-profile vlantag 123 admin-pid 2
Bye,
Marki
PS: Using "pre" to display code here sucks because it doesn't create blocks of code but each line becomes a single line of code.