背景
国内Nat机器(简称A),面板搭建在国外服务器,Nat机器(A)商家屏蔽了国外出口,基于上述原因所以需要通过另一台国内可以访问面板机的机器(简称B)借助gost进行端口转发
步骤
1.在国内能够访问面板机的机器B上安装gost,并执行以下命令
1 2
| ./gost -L tcp://:18008/data.nezha.com:8008
|
效果图:

2.下载agent上传至A机器/opt/nezha目录并修改Nat机器上agent的conf.yml文件,主要修改server信息
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| client_secret: ZGRcE3Sas4BlBVEKwmOD2KLJACgQQEQ9 debug: false disable_auto_update: true disable_command_execute: true disable_force_update: false disable_nat: true disable_send_query: false gpu: false insecure_tls: false ip_report_period: 1800 report_delay: 3 server: 213.224.27.84:10196 skip_connection_count: false skip_procs_count: false temperature: false tls: false use_gitee_to_upgrade: false use_ipv6_country_code: false uuid: 26f94cce-ws70-23bf-5725-29f6932322999
|
3.启动agent
1 2
| cd /opt/nezha ./nezha-agent -c ./config.yml restart
|
gost成功显示接收信息
效果图:

B机器后台运行gost
1 2 3 4 5
| nohup ./gost -L tcp://:18008/data.nezha.com:8008 > gost.log 2>&1 &
tail -f gost.log
ps -aux|grep 18008
|