This app can be used for external access local PC http ports
- Create a ZeroTier network. Probably you wanna restrict an inter-network cross-client access (docs)
- Setup this app to be a zerotier network gateway:
- Generate identity via:
zerotier-idtool generate gateway.secret gateway.public
- Manualy add member with id from public or secret file (id is the same in both files), example
$ zerotier-idtool generate gateway.secret gateway.public gateway.secret written gateway.public written $ cat gateway.public 4a7f049cf1:0:a4ee328392ccaf0c22900606aeb20a9cdc76716da70[OMMITED]
4a7f049cf1
will be host ID in this case 3. Assign an IP address to this host via admin console - Create a config file, example:
{
"zerotier_network": "ZeroTier network ID",
"zerotier_public_key": "gateway.public output from exaple above",
"zerotier_private_key": "gateway.secret output from exaple above",
"hostname_base": "set a base hostname, eq: 'ext.example.com'",
"users": [ # put all users here
{
"hostname": "prefix to base hostname, eq: 'user1'. It will produce 'user1.ext.example.com' address",
"ip": "user ZeroTier IP address for proxy external traffic to. Eq: 10.10.10.2 for 10.10.10.0/24 net"
}
]
}
- Start a container with the app
docker run \
--name ext-ip \ # optional
-v $(pwd)/config.json:/etc/app/config.json \
--cap-add NET_ADMIN \
--device /dev/net/tun \
flipperdevices/ext-ip-local-port:0.0.1 # this should be a latest release from github
For Kubernetes use you also need to add capabilities docs
- Join a network from clients, also set a coresponding IP's
In example above URL user1.ext.example.com
will point to the 10.10.10.2
address.