0

I set up tun device server on 1.2.3.4

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

I set up client 1:

socat TCP:1.2.3.4:11443 TUN:10.3.33.21/16,up

I can ping 10.3.33.20 from client 1

I set up client 2:

socat TCP:1.2.3.4:11443 TUN:10.3.33.22/16,up

I can't ping 10.3.33.20 from client 2 I can ping 10.3.33.20 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?

1
  • 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.