0

I try to set the AS_PATH attribute:

setAS=BGPPathAttr(type_flags="Transitive", type_code="AS_PATH",attr_len=None,attribute=None)

But Wireshark is saying that it is a malformed AS_PATH attribute.

I already have the other mandatory attributes in my Update message packet and they're doing well.

How to send a BGP Update message crafted packet with correct attributes?

hc_dev
  • 8,389
  • 1
  • 26
  • 38
  • What did you research? Can you post the error-message from Wireshark. Also see [similar question](https://stackoverflow.com/questions/39104621/setting-up-bgp-layer-using-scapy) for help. – hc_dev Jun 23 '22 at 18:52

1 Answers1

0

I did like this and works.

setAS = BGPPathAttr(
    type_flags="Transitive",
    type_code="AS_PATH",
    attr_len=None,
    attribute=BGPPAAS4BytesPath(
        segments=BGPPAAS4BytesPath().ASPathSegment(
                                                    segment_type=2(AS_SEQUENCE), segment_length=None, segment_value=[1234]
                                                )
                                )
    )

When we have variables asking the "length", please use "None".

Noam Rathaus
  • 5,405
  • 2
  • 28
  • 37