This paper is concerned with sampled-data leader-following consensus of a group of agents with nonlinear characteristic. A distributed consensus protocol with probabilistic sampling in two sampling periods is proposed. First, a general consensus criterion is derived for multiagent systems under a directed graph. A number of results in several special cases without transmittal delays or with the deterministic sampling are obtained. Second, a dimension-reduced condition is obtained for multiagent systems under an undirected graph. It is shown that the leader-following consensus problem with stochastic sampling can be transferred into a master-slave synchronization problem with only one master system and two slave systems. The problem solving is independent of the number of agents, which greatly facilitates its application to large-scale networked agents. Third, the network design issue is further addressed, demonstrating the positive and active roles of the network structure in reaching consensus. Finally, two examples are given to verify the theoretical results.