Disclosed are synthesized derivatives of a natural product, (±)-marinopyrrole A, shown as structural formula I, which have inhibition activities on gram-positive bacteria, such as methicillin sensitive Staphylococcus aureus (MSSA), methicillin-resistant Staphylococcus aureus (MRSA), vancomycin-resistant Enterococcus (VRE), oxacilline-resistant Staphylococcus aureus (ORSA), methicillin-resistant Staphylococcus epidermidis (MRSE) and the like. Furthermore, the methods for preparing (±)-marinopyrrole A and the derivatives thereof are disclosed. According to the study of antibacterial activity in vitro, the synthesized derivatives of the natural product (±)-marinopyrrole A have excellent antibiotic activities on the gram-positive bacteria, such as methicillin sensitive Staphylococcus aureus (MSSA), methicillin-resistant Staphylococcus aureus (MRSA), vancomycin-resistant Enterococcus (VRE), oxacilline-resistant Staphylococcus aureus (ORSA), methicillin-resistant Staphylococcus epidermidis (MRSE) and the like, and have potential prospects in clinical application.