1. A non-transitory machine readable medium storing a program which when executed by at least one processing unit configures first and second managed forwarding elements to perform logical L2 switching and L3 routing, the program comprising sets of instructions for: generating a first set of flow entries for configuring the first managed forwarding element to perform (i) a first logical L2 processing for a first logical L2 domain, (ii) a logical L3 processing, and (iii) a second logical L2 processing for a second logical L2 domain; and generating a second set of flow entries for configuring the second managed forwarding element to determine whether the first managed forwarding element has performed the first logical L2 processing, the logical L3 processing, and the second logical L2 processing.