AnalyzingBorderGatewayProtocol(BGP)instancesisacrucialstep in the design and implementation of safe BGP systems. Today, the analysis is a manual and tedious process. Researchers study the instances by manually con- structing execution sequences, hoping to either identify an oscillation or show that the instance is safe by exhaustively examining all possible sequences. We propose to automate the analysis by using Maude, a tool based on rewriting logic. We have developed a library specifying a generalized path vector protocol, and methods to instantiate the library with customized routing policies. Protocols can be analyzed automatically by Maude, once users provide specifications of the network topology and routing policies. Using our Maude library, protocols or policies can be easily specified and checked for problems. To validate our ap- proach, we performed safety analysis of well-known BGP instances and actual routing configurations.