how do you ufw allow in on wlan0 not to 192.168.0.0/16

Asked by Tristan Hill on 2012-03-05

To allow traffic except to a specific host/network. I'd guess syntax like 'ufw allow in on wlan0 not to 192.168.0.0/16'. Is that possible?

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu ufw Edit question
Assignee:
No assignee Edit question
Last query:
2012-03-05
Last reply:
2012-03-05
Tristan Hill (stan) said : #1

Hmm guess you have to 'ufw reject in on wlan0 to 192.168.0.0/16' and ufw allow in on wlan0 to 0.0.0.0/0 separately? Any I think these are only affecting input rules and not forwarding, which is what I'm after.

Tristan Hill (stan) said : #2

For now added

-A ufw-after-forward -i wlan0 -d 192.168.121.254/32 -j ACCEPT
-A ufw-after-forward -i wlan0 ! -d 192.168.0.0/16 -j ACCEPT

to /etc/ufw/after.rules

If you have a desktop OS, you can use gufw

Can you help with this problem?

Provide an answer of your own, or ask Tristan Hill for more information if necessary.

To post a message you must log in.