zoukankan      html  css  js  c++  java
  • iptables常用命令

    查看input,output,forward
    #iptables -L
    查看nat
    #iptables -t nat -L
     
    添加映射

    #iptables -t nat -A PREROUTING -d <外部IP> -p tcp --dport <外部端口> -j DNAT --to-destination 192.168.168.159:80

    删除nat映射

    #iptables -t nat -L --line-numbers
    Chain PREROUTING (policy ACCEPT)
    num  target     prot opt source               destination        
    1    DNAT       tcp  --  anywhere             router              tcp dpt:1433 to:192.168.1.10:1433
    2    DNAT       tcp  --  anywhere             router              tcp dpt:3306 to:192.168.1.20:3306
    3    DNAT       tcp  --  anywhere             router              tcp dpt:3389 to:192.168.1.30:3389
    4    DNAT       tcp  --  anywhere             router              tcp dpt:21 to:192.168.1.40:21
    5    DNAT       tcp  --  anywhere             router              tcp dpt:http to:192.168.1.50:80
    6    DNAT       tcp  --  anywhere             router              tcp dpt:ssh to:192.168.1.50:22
    删除num=6

    #iptables -t nat -D PREROUTING 6

     

  • 相关阅读:
    GRUB引导——menu.lst的写法
    条形码类型及常见条形码介绍
    Tmux:终端复用器
    find+*的问题
    find命令之exec
    Linux core 文件介绍
    C语言中返回字符串函数的四种实现方法
    C语言中的volatile
    Stars
    Game with Pearls
  • 原文地址:https://www.cnblogs.com/coffee_cn/p/1612097.html
Copyright © 2011-2022 走看看