I set up tun device server on

socat -v -v -v -v -d -d TCP-LISTEN:11443,reuseaddr,fork TUN:,up

I set up client 1:

socat TCP: TUN:,up

I can ping from client 1

I set up client 2:

socat TCP: TUN:,up

I can't ping from client 2 I can ping from client 2 only if I terminate (ctrl+c) connection from client 1 (immediate effect)

Why? TUN device can't handle multiple connections? Or is that a socat limitation? How should I setup such simple tunneling so I don't have to setup separate listener for every client?

  • fork TUN: creates for every incoming connection a tun device with the specified address. My guess is that the TUN driver refuses to create a second interface with the same IP, as every IP must be unique within one kernel namespace.
    – Martin
    Sep 13 '21 at 18:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.