[已软注销]对《Linux Firewalls》的笔记(1)

[已软注销]
[已软注销] (Hello world)

读过 Linux Firewalls

Linux Firewalls
  • 书名: Linux Firewalls
  • 作者: Michael Rash
  • 副标题: Attack Detection and Response
  • 页数: 352
  • 出版社: No Starch Press
  • 出版年: 2007-9
  • Care and Feeding of iptables

    有一个栗子:本机web服务器开在8080端口,需要将所有访问80的流量重定向到8080。使用以下命令: $ sudo iptables -t nat -A PREROUTING -p tcp --dport 8080 -j REDIRECT --to-port 80 但是本机访问localhost:8080似乎没有效果。结果开始怀疑iptables是否正确,开始怀疑自己。开始放弃学习iptables。千万别,你到别人机器上试试,见http://wiki.debian.org/Firewalls-local-port-redirection 里面有段话: To redirect locally generated packets, you must have the kernel option CONFIG_IP_NF_NAT_LOCAL set to Y. You will have to keep in mind, that without it, you will be unable to test this configuration from the localhost (meaning the computer where the redirection should take place) without special network setting (which is out of the scope of this document -- hint: a dummy module can help). 不知道其他发行版怎么样,反正我的ubuntu 13.04没开这个选项,估计所有发行版都没开这个选项。 这是个大坑啊,当年我就是因为这个不想学iptables的(当然是不知道原因的情况下)

    2013-07-16 17:32:56 1人推荐 回应