From surenkid, 2 Months ago, written in Bash.
Embed
  1. # 检查是否允许伪装ip:
  2. firewall-cmd --query-masquerade
  3. # if return no, allow masquerade
  4. firewall-cmd --add-masquerade --permanent
  5. # add tcp port 36379
  6. firewall-cmd --add-port=36379/tcp --permanent
  7. firewall-cmd --reload
  8. firewall-cmd --list-ports
  9. # add port forword
  10. firewall-cmd --add-forward-port=port=36379:proto=tcp:toaddr=10.66.119.86:toport=6379 --permanent
  11. firewall-cmd --reload
  12. firewall-cmd --list-forward