• 请不要在回答技术问题时复制粘贴 AI 生成的内容
rizon
V2EX  ›  程序员

firewall-cmd 怎么配置端口转发?

  •  
  •   rizon ·
    othorizon · Apr 2, 2019 · 2479 views
    This topic created in 2685 days ago, the information mentioned may be changed or developed.

    内网机器 A 和 B,在 B 上安装了 zerotier,然后在另一台机器可以借助 zerotier 的虚拟网来连接 B。 于是想要在 B 做端口转发来访问 A。
    因为 A 上不想安装 zerotier,A 是一个群晖 nas,zerotier 会导致硬盘一直在咔咔的响。
    B 是 centos 的系统,但是我用 firewall-cmd 配置了端口转发没有用? 请问这东西怎么配置啊?

    firewall-cmd --add-forward-port=port=7100:proto=tcp:toaddr=xxx.xx.xx.xxx:toport=22

    PS. 执行firewall-cmd --get-zone-of-interface=[zerotier 虚拟网卡]结果是 no zone
    PS. 转发 22 端口是因为 A 机器上装了 git server,想要用 git 去 push 代码到 A 上

    1 replies    2019-04-02 10:37:12 +08:00
    rizon
        1
    rizon  
    OP
       Apr 2, 2019
    firewall-cmd 的几个 zone 有什么区别吗?除了 trusted 和 drop 之外,剩下的有区别吗?还是只是起了个名字而已?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2634 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 11:05 · PVG 19:05 · LAX 04:05 · JFK 07:05
    ♥ Do have faith in what you're doing.