More than 3,000 people have died in fighting since April. A truce was agreed on 5 September but there have been repeated violations since then. The fighting began after Russia annexed Ukraine's southern Crimea peninsula in March - a move condemned by Ukraine and the West.
The demonstrators marched from Pushkin Square to Sakharov Avenue in central Moscow. Organizers had hoped up to 50,000 people would take part to denounce what they described as Russia's "aggressive foreign policy."
Moscow police said there were about 5,000 protesters but a reporter for the AP news agency estimated that the crowd was at least 20,000-strong.
Police stepped up security in the capital and there were only minor scuffles reported between rival demonstrators. It is Russia's first major anti-war rally since the fighting began five months ago in Ukraine's eastern Donetsk and Luhansk regions. A number of supporters of the pro-Russia separatists in Ukraine held their own rally in Moscow.
Ukrainian military spokesman Andriy Lysenko said violations of the ceasefire continued, telling reporters: "In the last 24 hours we have lost two Ukrainian soldiers, eight have been wounded." Moreover, General Philip Breedlove, NATO's supreme commander in Europe, said the ceasefire existed "in name only." He said the numbers of artillery rounds fired recently was comparable to periods before the truce came into effect two weeks ago.