Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
vloony
V2EX  ›  Linux

iptables 外网 IP 转发到另一台机器内网

  •  
  •   vloony · Jul 3, 2021 · 2127 views
    This topic created in 1804 days ago, the information mentioned may be changed or developed.
    iptables 外网 IP 转发到另一台机器内网

    怎么控制范围公网 A 机器公网 IP 转发流量到 B 机器

    以前好像写过一次 后面忘记了 好像是 A 公网 IP 流量转发到内网 IP 上 再转发这个内网 IP 到 B 机器
    4 replies    2021-07-05 10:32:32 +08:00
    NowTime
        1
    NowTime  
       Jul 4, 2021
    我也想知道怎么做,帮顶。
    dorothyREN
        2
    dorothyREN  
       Jul 4, 2021
    盲猜 lvs ?
    liuxu
        3
    liuxu  
       Jul 4, 2021
    没这么玄乎小兄弟,A 直接匹配 dst 是本机公网 ip 然后就转发到内网 B 的 IP 就行了,包出去后走到路由,路由会自己转给 B 机器
    smalllam
        4
    smalllam  
       Jul 5, 2021 via iPhone
    nat table,prerouting + post routing,改目标 IP 为第二台的 IP 。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3117 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 12:41 · PVG 20:41 · LAX 05:41 · JFK 08:41
    ♥ Do have faith in what you're doing.