it is NOT illegal if they made you aware of it at the time of hire. Most places make you sign a bunch of "new hire" paperwork. mixed in to most employee based compaines "new hire" packets are no compete clauses and waivers and such. If you signed a paper stating that you agreed to it, it is perfectly fine for them to do it. That is in any state.
This is CABL.com posting #318937. Tiny Link: cabl.co/mbu8j