attachmentgenie / attachmentgenie-ufw

MIT License
21 stars 27 forks source link

support interface #46

Open mark-agillic opened 9 years ago

mark-agillic commented 9 years ago

It would be really if it was possible to make rules based on the interface.

attachmentgenie commented 9 years ago

would you be able to give an example for that?

mark-agillic commented 9 years ago

Sure :)

Tested with ufw 0.34, Ubuntu 14.04.

From the man page:

 ufw  [--dry-run] [rule] [delete] [insert NUM] allow|deny|reject|limit [in|out [on INTERFACE]] [log|log-all] [proto PROTOCOL] [from
       ADDRESS [port PORT]] [to ADDRESS [port PORT]]

Example: ufw allow in on eth1 proto tcp from any port 443

Status output afterwards:

# ufw status
Status: active

To                         Action      From
--                         ------      ----
Anywhere on eth1           ALLOW       443/tcp
Anywhere (v6) on eth1      ALLOW       443/tcp (v6)

Example: ufw allow in on eth0

Status output afterwards:

# ufw status
Status: active

To                         Action      From
--                         ------      ----
Anywhere on eth0           ALLOW       Anywhere
Anywhere (v6) on eth0      ALLOW       Anywhere (v6)

For me the feature would be really useful, especially when defining the rules from hiera.

schkovich commented 7 years ago

Is there are PR for this one? I would be glad to help.