Let F q be a finite field of order q, a prime power integer such that q = et + 1 where t ≥ 1, e ≥ 2 are integers.In this paper, we study cyclic codes of length n over a non-chain ring R e,q = F q [u]/ u e −1 . We define a Gray map ϕ and obtain many maximum-distance-separable (MDS) and optimal F q -linear codes from the Gray images of cyclic codes. Under certain conditions we determine linear complementary dual (LCD) codes of length n when gcd(n, q) = 1 and gcd(n, q) = 1, respectively. It is proved that a cyclic code C of length n is an LCD code if and only if its Gray image ϕ(C) is an LCD code of length 4n over F q . Among others, we present the conditions for existence of free and non-free LCD codes. Moreover, we obtain many optimal LCD codes as the Gray images of non-free LCD codes over R e,q .