Rein
This program is used to efficiently redirect connections(TCP proxy to redirect) from one IP address/port combination to another. It is useful when operating virtual servers, dockers, firewalls and the like. Simple deployment. It creates a tunnel from a public endpoint to a locally running service.It was developed by golang.
Install / Use
/learn @firstboot/ReinREADME
rein
| Commit Log |
Introduction
This program is used to efficiently redirect connections from one IP address/port combination to another.
It is useful when operating virtual servers, dockers, firewalls and so on.
It creates a tunnel from a public endpoint to a locally running service (version >= 1.0.5). It was developed by golang.
reinsupport mode:
| mode | tip |
| ----------- | ------------------------------------------------------------ |
| upstream | It is used to efficiently redirect connections from one IP address/port combination to another. |
| fileshare | local files publishing. |
| inps | It creates a tunnel from a public endpoint to a locally running service. Put inps onto your server with public IP. (version >= 1.0.5) |
| inpc | It creates a tunnel from a public endpoint to a locally running service. Put inpc onto your server in LAN (that can't be connected from public Internet). (version >= 1.0.5) |
inpsandinpcmode illustration:
1. Download by your OS
All release download: https://github.com/firstboot/rein/releases
1.1 Download
- 1.1.1 Download by CentOS/RHEL/Ubuntu (amd64)
cd ~
wget \
https://github.com/firstboot/rein/releases/download/v1.0.6-bin/rein-1.0.6-amd64-linux.zip
unzip rein-1.0.6-amd64-linux.zip
mv rein-1.0.6-amd64-linux rein
chmod +x rein
-
1.1.2 Download by Windows (amd64)
-
download file
https://github.com/firstboot/rein/releases/download/v1.0.6-bin/rein-1.0.6-amd64-win.exe.zip
-
decompress
rein-x.x.x-amd64-windows.zip
-
2. Simple deployment
2.1 Specify required functions
- Which mode do you want to use ?
| mode | tip |
| ----------- | ------------------------------------------------------------ |
| upstream | It is used to efficiently redirect connections from one IP address/port combination to another. |
| fileshare | local files publishing. |
| inps/inpc | It creates a tunnel from a public endpoint to a locally running service. (server/client endpoint) (version >= 1.0.5) |
2.2 Function mode tip
Tip: OS description of operating differences, CentOS/RHEL/Ubuntu will be used by default in subsequent instructions. 2.2.1 will still introduce them separately.
# show all mode, CentOS/RHEL/Ubuntu, eg: upstream
./rein -e-detail
./rein -e-detail-upstream
# generate config file, CentOS/RHEL/Ubuntu, eg: upstream
./rein -e-detail-upstream > rein.json
#####################################################
# show all mode, Windows, eg: upstream
./rein.exe -e-detail
./rein.exe -e-detail-upstream
# generate a mode conf file, eg: upstream
# Windows cmd
./rein.exe -e-detail-upstream > rein.json
# Windows powershell, eg: upstream
./rein.exe -e-detail-upstream | out-file -encoding ascii rein.json
-
2.2.1 How to use mode
upstream?Use
-e-detail-xxxoption, generate config and running.-
CentOS/RHEL/Ubuntu
-
# show all mode ./rein -e-detail Enter a mode, show specific example, as follow: -e-detail-upstream -e-detail-inps -e-detail-inpc -e-detail-fileshare # generate a mode conf file, eg: upstream ./rein -e-detail-upstream > rein.json # rein.json, modify rein.json for you { "upstream": [ {"source": "0.0.0.0:8150", "target": "127.0.0.1:9990"} ] } # running ./rein -c rein.json
-
-
Windows
-
# show all mode ./rein.exe -e-detail Enter a mode, show specific example, as follow: -e-detail-upstream -e-detail-inps -e-detail-inpc -e-detail-fileshare # generate a mode conf file, eg: upstream # windows cmd ./rein.exe -e-detail-upstream > rein.json # windows powershell ./rein.exe -e-detail-upstream | out-file -encoding ascii rein.json # rein.json, modify rein.json for you { "upstream": [ {"source": "0.0.0.0:8150", "target": "127.0.0.1:9990"} ] } # running ./rein.exe -c rein.json
-
-
-
2.2.2 How to use mode
fileshare?# show default config ./rein -e-detail-fileshare { "fileshare": [ {"port": "9990", "path": "."} ] } # generate a mode conf file ./rein -e-detail-fileshare > rein.json # rein.json, modify rein.json for you { "fileshare": [ {"port": "9990", "path": "."} ] } # running ./rein -c rein.json -
2.2.3 How to use mode
inps/inpc?If you have a server(A) public IP is
52.74.223.119, and you have a server(B) private IP is192.168.1.122.Put
inpsonto your server A with public IP. Putinpconto your server B in LAN (that can't be connected from public Internet).illustration:
deploy: inps
Put
inpsonto your server A with public IP.# generate a mode conf file ./rein -e-detail-inps > rein.json # rein.json, modify rein.json for you { "inps": [ {"ctrl": "0.0.0.0:17500"} ] } # running ./rein -c rein.jsondeploy: inpc
Put
inpconto your server B in LAN (that can't be connected from public Internet).# generate a mode conf file ./rein -e-detail-inpc > rein.json # rein.json, modify rein.json for you # port 17500 is 'inps' server port # port 22 is local host service port, this port is ssh # port 9800 is 'inps' server open port { "inpc": [ { "ctrl": "52.74.223.119:17500", "source": "0.0.0.0:9800", "target": "127.0.0.1:22" } ] } # running ./rein -c rein.jsonquery: inpq (verion 1.0.6+)
Get current
inpslink status.# get inps link status, x.x.x.x:17500 is inps ip addr. ./rein -inpq x.x.x.x:17500 0.0.0.0:9800/127.0.0.1:22, online
Related Skills
tmux
349.0kRemote-control tmux sessions for interactive CLIs by sending keystrokes and scraping pane output.
diffs
349.0kUse the diffs tool to produce real, shareable diffs (viewer URL, file artifact, or both) instead of manual edit summaries.
terraform-provider-genesyscloud
Terraform Provider Genesyscloud
blogwatcher
349.0kMonitor blogs and RSS/Atom feeds for updates using the blogwatcher CLI.
