1

This is the iptables rule:

-A INPUT -i eth0 -s 10.2.0.51,10.2.0.52 -d 228.0.0.3 -j ACCEPT

How can I translate it to ufw rule?

I´ve tried:

root@localhost:~# sudo ufw allow from 10.2.0.51,10.2.0.,52 to 228.0.0.3 to any port
ERROR: Wrong number of arguments

root@localhost:~# sudo ufw allow from 10.2.0.51,10.2.0,52 to 228.0.0.3 to any port proto tcp
ERROR: Wrong number of arguments

What am I missing?

1 Answer 1

0

The syntax is following:

sudo ufw allow from <target> to <destination> port <port number> proto <protocol name>

so, you should run

sudo ufw allow from 10.2.0.51,10.2.0.52 to 228.0.0.3

it will allow all ports and all protocols. For TCP only:

sudo ufw allow from 10.2.0.51,10.2.0.52 to 228.0.0.3 proto tcp
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .