Disclosed are methods and apparatus for restarting a first network device having a plurality of ports for receiving and transmitting layer 2 data. The first network device belongs to a network of network devices. When a restart of at least a portion of the first network device is imminent whereby the restarting network device portion can no longer alter a spanning tree protocol (STP) state of one or more of the ports and such ports that remain in a fixed state during the restart are referred to as restarting ports, a current state (such as forwarding) of each restarting port is maintained during the restart under predefined conditions. During the restart, each of the restarting ports of the restarting network device portion cooperate with its peer port of a second non-restarting network device that is a neighbor of the first network device so as to prevent layer 2 loops in the network.