Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.5k views
in Technique[技术] by (71.8m points)

sockets - How to add VLAN tag to outgoing Ethernet frames from a Python client

I'm developing a Python script to work as a TCP client on a Windows PC in this way:

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(5.0)
s.connect((Se9ver_Ip, 13400))

The outgoing Ethernat packet is of type 0x8000 (IPv4), while the opposite server shall receive the packet on a VLAN.

I need to add the VLAN tagging for the underlying Ethernet frame from the client script, so that all exchanges with the server shall be based on a VLAN.

  1. How can I configure the underlying Ethernet frames to have a VLAN tag?
  2. Does Windows support sending out VLAN-tagged Ethernet frames?
question from:https://stackoverflow.com/questions/65906535/how-to-add-vlan-tag-to-outgoing-ethernet-frames-from-a-python-client

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...