a method for preventing ethernet from being attacked is provided . the method comprises the steps as follows : after detecting a new connection between a port and a terminal device and receiving a data packet from the terminal device , an ethernet communication device establishing and storing a fixed map between the port and a hardware address of the terminal device , then forwarding the data packet according to the fixed map ; after detecting a disconnection between the port and the terminal device , the ethernet communication device deleting the fixed map .