mirror of https://github.com/dadevel/wg-netns
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
238 B
Bash
10 lines
238 B
Bash
2 years ago
|
#!/bin/sh
|
||
|
set -eu
|
||
|
|
||
|
if [ $# -ne 3 ]; then
|
||
|
echo 'usage: netns-publish PUBLIC_PORT NETNS_NAME NETNS_ADDRESS:NETNS_PORT'
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
exec socat tcp-listen:"$1",reuseaddr,fork "exec:ip netns exec $2 socat stdio 'tcp-connect:$3',nofork"
|