How to forward packets from one network interface via another interface
Managed to find the issue.
Whilst adding the route for the container in the other subnet I haven't correctly specified the gateway. The gateway still points to the host machine in which docker is run (see above figure). So I added the correct routing rule specific to the two end-containers - c1 & c3.
c1 - ip route add 10.23.0.0/24 via 10.12.0.1 dev peervpn12
c3 - ip route add 10.12.0.0/24 via 10.23.0.1 dev peervpn23
In the meantime, had to add the correct FORWARD rules in the c2 container's iptables:
iptables -A FORWARD -s 10.12.0.2 -i peervpn12 -d 10.23.0.2 -o peervpn23 -j ACCEPT
iptables -A FORWARD -s 10.23.0.2 -i peervpn23 -d 10.12.0.2 -o peervpn12 -j ACCEPT
With this setup I was able to achieve the flow I expected.
Thank You and I don't know why it's down-voted.
Maybe if I know the reason I can correct myself in future :)
Linux: Port Isolation on a Bridge to use OLSR correctly
its as simple as to put all ports into a bridge br0 and then:
ebtables -P FORWARD DROP
ip link set br0 promisc on
(works as expected on an ubnt edgerouter, but was also tested on a linux box before, so should work there too)
Linux: Loopback incoming packets on an interface
I think you can easily achieve this with Python/Scapy. Something like
sniff(iface="eth0", prn=lambda x: sendp(x, iface="eth0"))
should do it.
Related Topics
Linux - Mapping User Space Memory in Kernel Code
I Need a Binary Comparison Tool for Win/Linux
How to Execute a Command in a Bash Script and Then Focus The Appearing Window
Building Robert Nelson's Linux Kernel into Yocto(Daisy) for Beaglebone Black
How to Find List of Valid Locales in My Linux Using Perl
How to Get CPU Serial Under Linux Without Root Permissions
How to Start a Process in Its Own Process Group
Shopify + Ubuntu 12.04Lts + Faraday Issue = Ok to Use Older Openssl
Linux + Verify If File Is Text or Binary
Shared Library Symbol Conflicts and Static Linking (On Linux)
Sed to Loop Through File and Replace Placeholder Variables
Nasm X86_64 Assembly in 32-Bit Mode: Why Does This Instruction Produce Rip-Relative Addressing Code
Problem of Understanding Clock_Gettime
Linux Support 802.1Ag and Y1731
Unzip in Current Directory While Preserving File Structure
Raw Socket Access as Normal User on Linux 2.4
How to Specify Which Kernel to Build with Bitbake/Yocto
Scheduling in Linux: Run a Task When Computer Is Idle (= No User Input)