Ubuntu

Ubuntu ufw:基於每個介面設置規則

  • August 2, 2012

我想創建一個規則,允許 eth1 上的任何人訪問埠 80。 UFW 可以這樣做還是應該回到使用 Shorewall?

澄清一下:這是一個能力問題,ufw可以將介面作為目標處理嗎?

我終於閱讀了手冊頁:

By default, ufw will apply rules to all available interfaces. To
limit  this,  specify DIRECTION on INTERFACE, where DIRECTION is
one of in or out (interface aliases  are  not  supported).   For
example,  to  allow  all  new incoming http connections on eth0,
use:

ufw allow in on eth0 to any port 80 proto tcp

稍微詳細一點,答案是肯定的,ufw 可以使用介面作為目標。我的特定規則如下所示:

ufw allow in on eth1 to [eth1 ip addr] port 80 proto tcp

引用自:https://serverfault.com/questions/270715