kristenjacobs / container-networking

Container networking from scratch, from a single namespace to an overlay network.
MIT License
345 stars 149 forks source link

tun device setup is failing #2

Open rajesh1084 opened 3 weeks ago

rajesh1084 commented 3 weeks ago

https://github.com/kristenjacobs/container-networking/blob/69015b50ad49fbbbab7ec222fc4d245d10155ad6/4-overlay-network/setup.sh#L56

This command expects a UDP server to be running on the target node ($TO_NODE_IP) on port 9000. Otherwise, we get the following error:

$ sudo socat TUN:$TUNNEL_IP/16,iff-up UDP:$TO_NODE_IP:9000,bind=$NODE_IP:9000
2024/06/10 05:27:47 socat[4826] E read(7, 0x5e426d5e2000, 8192): Connection refused

I tried running a small UDP echo server on both nodes on port 9000 and slightly modified the socat command in setup.sh to make it work-

$ sudo socat TUN:$TUNNEL_IP/16,iff-up UDP:$TO_NODE_IP:9000,bind=$NODE_IP:9001

Is there any misunderstanding? Shall I send a pull request?

rajesh1084 commented 3 weeks ago

@kristenjacobs: I must say this has been very useful in understanding the basics of container networking. Thanks for sharing this.