Port forwarding using Firewalld and specifying interface

Issues related to configuring your network
Post Reply
Hazzel
Posts: 1
Joined: 2017/05/16 12:48:40

Port forwarding using Firewalld and specifying interface

Post by Hazzel » 2017/05/16 12:59:14

Hey!

I got a setup where I am running a computer with 3 network adapters. One internal and two "external" interfaces. I want firewalld to enable port forwarding between these interfaces, and got most of it working. The problem is that in some setups, I might have ip conflicts on the two external interfaces, so when I want to create a port forwarding rule from the internal network to ONE of the external ones, I would like to specify the adapter. All 3 adapters are in it's own firewalld zone.

For example
firewall-cmd --zone=internal --add-forward-port=port=80:proto=udp:toport=8080:toaddr=172.20.0.3 --permanent

It looks like it's using the system routing table to figure out what external interface to send these packets out on. Is there a way to specify what network adapter name to send out on without using pure iptables?

[EDIT]
Is rich rules with destination address=adapter IP the way to go?

Post Reply