In a switching problem, a one-to-one mapping from the inputs to the outputs is conducted according to a switch pattern, i.e., a permutation matrix. In this paper, we investigate a wireless switching problem, in which a group of single-antenna relays acts together as a multiple-input-multiple-output (MIMO) switch to carry out distributed precode-and-forward. All users transmit simultaneously to the MIMO switch in the uplink and then the MIMO switch precodes the received signals and broadcasts in the downlink. Ideally, each user could receive its desired signal from one other user with no or little interference from other users. Self-interference is allowed in the received signals, as it can be canceled when each user has the channel gain of its self-interference. We propose two distributed relaying schemes based on two widely adopted criteria, i.e., zero-forcing relaying and minimum mean square error (MMSE) relaying. For the distributed zero-forcing relaying, we further propose a message passing approach, with which the proposed zero-forcing relaying achieves significant throughput gain with little attendant overhead. We also claim that the proposed MMSE relaying achieves even larger throughput at the expense of larger amount of message passing. Simulation results validate the throughput gains of the proposed relaying schemes.