如何设置 go-mmproxy

如何设置 go-mmproxy

因此,我设置了 HA 代理,我想使用代理协议发送我的 ssh 请求,以及其他对其他 TCP 服务(如 minecraft 服务器)的请求。我读了这篇文章这里,但我不明白如何设置mmproxy(我安装了go-mmproxy因为常规 mmproxy 无法编译)。有人可以指导我如何设置 mmproxy,以及我的 HA 代理服务器如何将数据包发送到此机器的 tailscale ip(100.91.56.39),以便任何转发的内容都保留原始 IP?

的结果ifconfig

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.136  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::215:5dff:fe01:8300  prefixlen 64  scopeid 0x20<link>
        ether 00:15:5d:01:83:00  txqueuelen 1000  (Ethernet)
        RX packets 1079791  bytes 614920269 (586.4 MiB)
        RX errors 0  dropped 40186  overruns 0  frame 0
        TX packets 413958  bytes 246039170 (234.6 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 297  bytes 25587 (24.9 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 297  bytes 25587 (24.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

tailscale0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST>  mtu 1280
        inet 100.91.56.39  netmask 255.255.255.255  destination 100.91.56.39
        inet6 fe80::1035:a7c6:1f21:aa97  prefixlen 64  scopeid 0x20<link>
        inet6 fd7a:115c:a1e0:ab12:4843:cd96:625b:3827  prefixlen 128  scopeid 0x0<global>
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 500  (UNSPEC)
        RX packets 158436  bytes 18055203 (17.2 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 193670  bytes 203374669 (193.9 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ifconfig在托管 HA Proxy 的服务器上的结果:

ens3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 9000
        inet 10.0.0.133  netmask 255.255.255.0  broadcast 10.0.0.255
        inet6 fe80::17ff:fe17:895f  prefixlen 64  scopeid 0x20<link>
        ether 02:00:17:17:89:5f  txqueuelen 1000  (Ethernet)
        RX packets 1154820  bytes 1170789775 (1.1 GB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 998018  bytes 483441528 (483.4 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 21266  bytes 2650809 (2.6 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 21266  bytes 2650809 (2.6 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

tailscale0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST>  mtu 1280
        inet 100.101.205.54  netmask 255.255.255.255  destination 100.101.205.54
        inet6 fd7a:115c:a1e0:ab12:4843:cd96:6265:cd36  prefixlen 128  scopeid 0x0<global>
        inet6 fe80::50e9:4406:1131:2f21  prefixlen 64  scopeid 0x20<link>
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 500  (UNSPEC)
        RX packets 257333  bytes 237708378 (237.7 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 199652  bytes 21930487 (21.9 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

我的 HA 代理配置:

frontend ssh-elixir-vahin2
    bind 0.0.0.0:23
    mode tcp
    log global    
    default_backend     server1-ssh
    timeout client 0

backend server1-ssh
    mode tcp
    timeout server 0
    server ssh 100.91.56.39:22

相关内容