To improve the performance of the firewall in which two Ethernet cards transmit mutually receiving packets, a new method for getting the information of the Ethernet card,which was used to send a packet,was presented after the analysis of receiving, transmitting and the Netfilter. Based on this method, two kinds of transparent firewall, state inspection and simple packet filtering, were implemented. The test results showed that, compared with the transparent firewalls which are based on Linux bridge and Netfilter, the process of forwarding and filtering in these two firewalls is more efficient.