I'm dealing with LXC, iptables and route, and at this point I'm not even sure what I'm doing anymore. For the sake of simplicity, every policy in iptables is set to ACCEPT and forwarding is set to 1 in sysctl.conf in each host or container.
My goal here is to be able to pass a ping request through an LXC container, from outside of its host. Let me clarify this:
Let's say I have a client C, who wants to ping a server S, but I have a gateway G in between, and an LXC container L within G.
C (eth0 192.168.0.3/24) <---> (eth0 192.168.0.2/24) G (eth1 192.168.1.3/24) <---> (eth0 192.168.1.4/24) S
then, inside G we would have :
(eth0 192.168.0.2/24) <---> (virbr0 10.0.0.2/24) L (virbr1 10.0.1.3/24) <---> (eth1 192.168.1.3/24)
So basically, I'd like to ping S from C but in such a way that the request must transit through L (and therefore through G), using iptables and route.
Hope you can help me out !