Score:0

How do I block non-forwarded traffic for a dnat closed network?

jp flag

I'm trying to set up a dnat closed network with UFW running on the gateway (Ubuntu 20.04.2). I have the following rules:

-A PREROUTING -i enp0s5 -p tcp --dport 443 -d 192.168.1.1 -j DNAT --to-destination x.x.x.x:443
-A ufw-before-forward -i enp0s5 -p tcp -d x.x.x.x --dport 443 -j ACCEPT
-A ufw-before-forward -i enp0s5 -j DROP

I can curl https://192.168.1.1 and that connects successfully to x.x.x.x. But, I can curl https://x.x.x.x and that connects successfully as well. I want to limit access to x.x.x.x to only be successful when using 192.168.1.1. How do I accomplish this?

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.