When using Scapy, I am unable to set the AS_PATH attribute. I have tried following the answer provided in this StackOverflow page How to use AS_PATH attribute in scapy for BGP?, but it did not work. I have also tried inputting the following statements in the attribute parameter, but I have not been able to.
setAS=BGPPathAttr(type_flags="Transitive", type_code="AS_PATH", attribute="2")
setAS=BGPPathAttr(type_flags="Transitive", type_code="AS_PATH",attr_len=None,attribute=BGPPAAS4BytesPath(segments=BGPPAAS4BytesPath().ASPathSegment(segment_type=2,segment_length=None,segment_value=[2])))
My desired outcome is to send a packet with the AS_PATH value of 2.