用户工具

站点工具


linux:iptables

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录前一修订版
后一修订版
前一修订版
linux:iptables [2017/08/20 10:18] memorylinux:iptables [2023/12/03 10:24] (当前版本) – 外部编辑 127.0.0.1
行 57: 行 57:
   iptables -A INPUT -j DROP   iptables -A INPUT -j DROP
  
 +===== Router =====
 +
 +Redirect all dns query to specified ip:
 +
 +  iptables -t nat -A PREROUTING -p udp -s 192.168.1.0/24 --dport 53 -j DNAT --to 192.168.1.1
 +
 +Redirect all dns query to specified ip except some ip:
 +
 +  iptables -t nat -A PREROUTING -p udp -s 192.168.1.24 -j ACCEPT
 +  iptables -t nat -A PREROUTING -p udp -s 192.168.1.0/24 --dport 53 -j DNAT --to 192.168.1.1
 +
 +
 +===== Reference =====
 +
 +  * [[https://github.com/trimstray/iptables-essentials|Iptables Essentials: Common Firewall Rules and Commands]]
linux/iptables.1503195488.txt.gz · 最后更改: 2023/12/03 10:24 (外部编辑)