Routing between subnets | iptables

gr8arty

New Member
Joined
May 17, 2021
Messages
2
Reaction score
0
Credits
25
Hello guys!
I recently received a task to configure iptables rules for the following scenario:

A: enp3s0 172.16.8.0/21 - 172.16.8.10
B: enp4s0 192.168.0.0/24 - 192.168.0.1


network B has access to a couple of addresses in network A, and no access to the subnet itself.
and now I need to get access from network A to network B, but I can't think of it ...
in particular, I need to grant access via mac address of a couple of hosts to network B

The table was already set up this way:

-A FORWARD -d 172.16.8.8 -i enp4s0 -j ACCEPT
-A FORWARD -d 172.16.8.9 -i enp4s0 -j ACCEPT
-A FORWARD -d 172.16.8.0/21 -i enp4s0 -j DROP
-A FORWARD -s 192.168.0.0/24 -i enp4s0 -o enp3s0 -j ACCEPT
-A FORWARD -d 192.168.0.0/24 -i enp3s0 -o enp4s0 -j ACCEPT
-A POSTROUTING -s 192.168.0.0/24 -o enp3s0 -j SNAT --to-source 172.16.8.10


as I understand, I need to add PREROUTING rule, I was fiddling around with different approaches doing tries and errors but no luck so far...
I'm not good at it myself and seems like I stuck here

I'd be much appreciated any help, thanks in advance
 


G'day @gr8arty and welcome to linux.org

I recently received a task to configure iptables rules for the following scenario:

From whom, please? (my highlighting)

Chris Turner
wizardfromoz
 
Thanks for the response.

Networking is not my strength, but someone will be along when they can.

Good Luck

Wizard
 
Top