New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iptables 端口转发 #13

kaidiren opened this Issue Jun 22, 2018 · 0 comments


None yet
1 participant

kaidiren commented Jun 22, 2018

  1. 列出所有规则
    iptables -t nat --line-numbers -L
  2. 删除指定规则
    iptables -t nat -D OUTPUT 2
  3. 端口转发 示例从 9001 转发到 8000
    iptables -t nat -A PREROUTING -p tcp --dport 8000 -j REDIRECT --to-ports 9001
    iptables -t nat -A OUTPUT -p tcp -d localhost --dport 8000 -j REDIRECT --to-ports 9001
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment