socksns
socksns copied to clipboard
Make the ports listening inside the network namespace reachable
When I run a program which listen on an address, it's port are not fully reachable:
user@localhost:/dev/shm/socksns$ /home/user/.cargo/bin/socksns tcppm -l -i0.0.0.0 1053 1.1.1.1 53
220715202341.157 1053 00000 - 0.0.0.0:1053 0.0.0.0:0 0 0 0 Accepting connections [151546/3018610496]
220715202406.294 1053 00013 - 127.0.0.1:34805 1.1.1.1:53 0 0 0 1.1.1.1
220715202406.294 1053 00013 - 127.0.0.1:33807 1.1.1.1:53 0 0 0 1.1.1.1
root@localhost:/home/user# lsns | grep tcppm
4026533245 net 1 151546 user tcppm -l -i0.0.0.0 1053 1.1.1.1 53
4026533301 user 1 151546 user tcppm -l -i0.0.0.0 1053 1.1.1.1 53
root@localhost:/home/user# nsenter -t 151546 -n dig +tcp @127.0.0.1 -p 1053 t.co
;; communications error to 127.0.0.1#1053: end of file
;; communications error to 127.0.0.1#1053: end of file
This would be a nice feature because some programs need communication using listening ports.
I don't know if this is possible to implement, but if yes, it would be a very useful feature.