1.實現步驟
- 安裝rinetd工具
sudo apt install rinetd
- 修改配置文件:/etc/rinetd.conf
sudo vim /etc/rinetd.conf
#bindaddress bindport connectaddress connectport
#綁定的地址 綁定的端口 轉發的地址 轉發的端口
#將所有發往本機的2019端口的請求轉發到本機的2020端口
127.0.0.1 2019 127.0.0.1 2020
- 啓動命令
/usr/sbin/rinetd -c /etc/rinetd.conf
- 停止命令
ps -ef | grep rine
root 18240 1 0 15:32 pts/57 00:00:00 rinetd -c /etc/rinetd.conf
root 22293 17709 0 15:35 pts/51 00:00:00 grep rine
kill 18240