Depends what type of firewall you have.
For hardware firewall (router... etc) you need to go into PORT FORWARDING under the router settings and allow those two ports to access the internet.
For software firewall (zonealarm... etc) you just type in the program and the port it needs, i think, i haven't messed with software firewalls in a long time.
If that doesn't help, make sure you don't have too many filters on your counter strike, if none of this works you may have to try reinstalling your HL and CS.
Remember to always update your HL to 1.0.0.5 then upgrade to CS 1.1.1.5