A method for configuring an implementation of a logical network, the method being implemented by a network controller, the method comprising: configuring a first set of edge managed switching elements to perform logical switching for a first logical domain (150, 220) and a second set of edge managed switching elements to perform logical switching for a second logical domain (155, 230); configuring a particular managed switching element, not in either the first or second sets of edge managed switching elements (815, 820), that operates in a host machine as a second-level managed switching element to perform logical switching for the first logical domain (150, 220) and the second logical domain (155, 230); and characterised by: configuring a container in the host machine to operate as a router for handling packets sent from one of the first logical domain and the second logical domain to the other one of the first logical domain and the second logical domain, wherein the second-level managed switching element is configured to forward to the container packets sent from one of the first and second logical domains (220, 230) to the other of the first and second logical domains (220, 230), and wherein the container is configured to route packets sent from one of the first and second logical domains (220, 230) to the other of the first and second logical domains (220, 230) and return the routed packets to the second-level managed switching element in the host machine. configuring a first set of edge managed switching elements to perform logical switching for a first logical domain (150, 220) and a second set of edge managed switching elements to perform logical switching for a second logical domain (155, 230); configuring a particular managed switching element, not in either the first or second sets of edge managed switching elements (815, 820), that operates in a host machine as a second-level managed switching element to perform logical switching for the first logical domain (150, 220) and the second logical domain (155, 230); and characterised by: configuring a container in the host machine to operate as a router for handling packets sent from one of the first logical domain and the second logical domain to the other one of the first logical domain and the second logical domain, wherein the second-level managed switching element is configured to forward to the container packets sent from one of the first and second logical domains (220, 230) to the other of the first and second logical domains (220, 230), and wherein the container is configured to route packets sent from one of the first and second logical domains (220, 230) to the other of the first and second logical domains (220, 230) and return the routed packets to the second-level managed switching element in the host machine. configuring a container in the host machine to operate as a router for handling packets sent from one of the first logical domain and the second logical domain to the other one of the first logical domain and the second logical domain, wherein the second-level managed switching element is configured to forward to the container packets sent from one of the first and second logical domains (220, 230) to the other of the first and second logical domains (220, 230), and wherein the container is configured to route packets sent from one of the first and second logical domains (220, 230) to the other of the first and second logical domains (220, 230) and return the routed packets to the second-level managed switching element in the host machine.