-1

I have two linux systems, server and client, whose both ethernet port has VLAN tagging(preconfigured IP address and same subnet), and connected with a common ethernet cable (no router or network switch in between them).

I need to establish communication between the two systems. On the server, I need to develop a program which runs in while(1) and listens to the VLAN port and responds to client request. On the client I need to use normal TCP socket programming in python/C++, which basically binds to its own VLAN IP and connects to server VLAN IP and sends requests.

I tried using scapy to send Ether() packets over the Vlan's and I was able to observe traffic on wireshark, but when I used client request, the server is not accepting the connection.

Can the above problem statement be possible to implement?

sjain
  • 17
  • 4
  • It **is** possible to establish communication with just an ethernet cable. – wwii Jan 22 '23 at 03:56
  • There is a basic [tcp echo client example in the asyncio docs](https://docs.python.org/3/library/asyncio-stream.html#asyncio-streams), also a server example. Those aren't the only way to do it. – wwii Jan 22 '23 at 04:02
  • is it similar to asio in c++? – sjain Jan 22 '23 at 04:06
  • No experience with c++ so I couldn't say. – wwii Jan 22 '23 at 04:08
  • Okay so you mean that if i use the server example and on the client if I use normal socket progg, I will be able to communicate? – sjain Jan 22 '23 at 06:17
  • Yes. Is there a reason not to? Do you have to maintain the vlan settings on the devices? – wwii Jan 22 '23 at 14:47
  • Typically end devices don't need to be *vlan aware*. Your question probably needs more specifics and it is probably off topic for stack overflow. There is probably a networking g stack exchange site. https://networkengineering.stackexchange.com/ – wwii Jan 22 '23 at 15:05

1 Answers1

-2

You are going to need a VLAN switch between the two.

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – shamnad sherief Jan 24 '23 at 04:12
  • Remember each VLAN server has a specific IP address assigned to them, and both will be different. Each will have a different IP address. Typically you would have two regular switches between them and a VLAN switch above both switches. You can certainly go to VLAN switch mfg, and see the configuration options. Each option will depend upon what you are trying to accomplish. In your case, you want a secure one-way direction both to and from. With a regular LAN you would not have the security because it broadcast signals to every device. The VLAN is very specific in what it will accept. – user21058351 Jan 25 '23 at 14:29