0

I've created a Virtual network where there's a CLIENT---GATEWAY---SERVER

The client has IP 192.168.242.141, the GATEWAY has two network interfaces with IPs 192.168.242.134 and 192.168.241.132 and the SERVER has two network interfaces as well 192.168.241.129, 192.168.42.135. The server is set for internet connection and has a NAT rule on iptables:

sudo iptables -t nat -A POSTROUTING -s 192.168.241.0/24 -o ens33 -j MASQUERADE

and the same rule is applied on the GATEWAY

sudo iptables -t nat -A POSTROUTING -s 192.168.242.0/24 -o ens34 -j MASQUERADE

both GATEWAY and SERVER has ip4 forward actived.

I can ping from subnet 242 to 241 but I can't ping the other way.

Is there a chance to do it or is it not possible? Do I need to create a new route on the GATEWAY from the backtraffic from 241 to 242?

2
  • 192.168.42.135 should be 192.168.242.135
    – Raffa
    Mar 11, 2021 at 17:43
  • @Raffa nope; it's right because that subnet goes out to the NAT
    – NicoCaldo
    Mar 11, 2021 at 20:51

0

You must log in to answer this question.

Browse other questions tagged .