In a given machine I have got two interfaces eth0 and eth1. Cisco routers are connected, to both interfaces, eth0 and eth1 and I want OSPF packets which arrives on eth0 to be forwarded to eth1 and vice versa (see image below).
I have tried issued the following commands:
iptables -A FORWARD -i eth1 -o eth0 iptables -A FORWARD -i eth0 -o eth1
But that did not work. Moreover, I wish this forwarding rule to apply on OSPF packets only, filtering packets by source and destination address and perhaps, even by protocol if possible. OSPF packets are appeared to be
IP 22.214.171.124 > 126.96.36.199: OSPFv2
from one direction, and
IP 188.8.131.52 > 184.108.40.206: OSPFv2
from the other.