Ubuntu VPS 服务器中的端口转发,从公共 IP 到客户端

Ubuntu VPS 服务器中的端口转发,从公共 IP 到客户端

VPS中安装了Ubuntu服务器20.04和OpenVPN,我需要将所有流量从vps公网ip的特定端口转发到VPN客户端的同一端口。

我的 Ubuntu VPS ip 是 107.172.142.153 并且我想使用这个端口 8888

root@himuami:~# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 107.172.142.153  netmask 255.255.255.0  broadcast 107.172.142.255
        inet6 fe80::216:3cff:fe7f:6a1c  prefixlen 64  scopeid 0x20<link>
        ether 00:16:3c:7f:6a:1c  txqueuelen 1000  (Ethernet)
        RX packets 18348960  bytes 4334658733 (4.3 GB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 17026930  bytes 4369649692 (4.3 GB)
        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 64  bytes 6523 (6.5 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 64  bytes 6523 (6.5 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

 0

相关内容