Score:0

Why isn't logic working on ufw?

ye flag

Let's say I want to allow my own external IP in on tun0 interface port 443.

Why doesn't

sudo ufw allow from 217.xxx.xxx.xxx proto tcp to tun0 port 443

Work (not on tun0 either) when

sudo ufw allow from 217.xxx.xxx.xxx proto tcp to any port 443

works?

All other answers (on this site) are allowing any, I don't want that.

djdomi avatar
za flag
Does this answer your question? [Ubuntu ufw: set a rule on a per interface basis](https://serverfault.com/questions/270715/ubuntu-ufw-set-a-rule-on-a-per-interface-basis)
ye flag
@djdomi not actually, at least so I understand it. I want to open port **443** on network **interface tun0** for **one ip address** only. isn't that opening for everybody? or am I missing something?
Score:1
ng flag

You must specify any or an ip-address before the command port

if you want just one address:

sudo ufw allow in on tun0 to (your tun0 ip address) 111.111.111.111 port 443 from (the ip you want to allow in) 222.222.222.222

sudo ufw allow in on tun0 to 111.111.111.111 port 443 from 222.222.222.222

If you want to allow everyone:

sudo ufw allow in on tun0 to any port 443
Score:0
jp flag

because the parameter for to is an IP address, not an interface. To specify an interface you need to use on tun0. See man ufw

ye flag
I've tested to replace to (to) on, (as I wrote in my question), and that doesn't work.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.