Daimon Blog

山在那里

dns Cheatsheet

最近需要配置一个IP地址,dns很灵活。值得花时间把常用用法掌握学习。firewalldiptables的一个上层封装。有时候不明白为什么的时候,看看iptables的规则库,就理解了。这里把我常用的iptables命令做个汇总。

ip

iptables -I INPUT -s 211.1.2.1 -j DROP

对应的解封

iptables -L --line-numbers
iptables -D INPUT 1

端口转发

https://blog.csdn.net/zzhongcy/article/details/42738285

本机端口转发

 iptables -t nat -A OUTPUT -d localhost -p tcp --dport 80 -j REDIRECT --to-ports 8080

注意这样配置,在本机是不能访问80端口的。如果要本机也能访问,要这么配(但下面配法我没实践过。不知可行否。)

iptables -t nat -A OUTPUT -d localhost -p tcp --dport 80 -j REDIRECT --to-ports 8080

文章分类目录