如何在BGP的Scapy中使用as_path属性?

发布于 2025-02-09 21:13:26 字数 431 浏览 1 评论 0原文

我尝试设置as_path属性:

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

但是Wireshark说它是畸形的as_path属性。

我的更新消息数据包中的其他强制性属性已经很好。

如何发送 > 更新消息具有正确属性的精心设计的数据包?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谜兔 2025-02-16 21:13:26

我确实喜欢这样做。

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]
                                                )
                                )
    )

当我们有变量询问“长度”时,请使用“无”

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".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文