Linux routing - Iptables

Job ID: 35918272

Budget: $30 – $250 USD

I have a linux router setup that attaches 2 VLANS

VLAN1 192.168.40.0/22
VLAN20 192.168.20.0/24

Interface 1 = 192.168.40.22 ( VLAN1)
Interface 2 = 192.168.20.2 ( VLAN 20)

I have IPv4 forwarding enabled on the linux machine. It is running Ubuntu 22.02
I have devices in VLAN 20 that sent out broadcasts with the bacnet protocol via UDP.

When the linux router receives these broadcasts on interface2 ( 192.168.20.2) I need it to send the packets out the interface on VLAN1 (192.168.40.22) to a specific host on VLAN 1 192.168.42.3

I need to know how to do this with either static routes and/or Iptables.

The version of UBUNTU I am using uses NETPLAN for networking FYI.

Please see an attached diagram. Thank you!
Related categories: System Admin Linux Ubuntu Network Administration