I have a bridge with all hosts from the 192.168.5.0/24 network connected to it.They all connect to this bridge via a secondary interface eth1.
I have a router which connects this bridge to others on my network via 192.168.5.1
On my router I am able to filter all traffic going to and from this network to others with iptables but I am unable to filter any traffic between hosts on the same network (192.168.5.0)
I believe this is because if for instance 192.168.5.2 were to ping 192.168.5.3 the traffic goes straight to the bridge without passing through my router gateway 192.168.5.1
Is it possible to force all traffic for the same subnet to go to the router first?
The following is an extract from my static routes:
default 192.168.3.1 0.0.0.0 UG 0 0 0 eth0
link-local * 255.255.0.0 U 1002 0 0 eth0
link-local * 255.255.0.0 U 1003 0 0 eth1
192.168.3.0 * 255.255.255.0 U 0 0 0 eth0
192.168.5.0 * 255.255.255.0 U 0 0 0 eth1
And the following are extracts from my ifcfg-ethx files (CentOS):
DEVICE="eth0"
BOOTPROTO="static"
BROADCAST="192.168.3.255"
GATEWAY="192.168.3.1"
IPADDR="192.168.3.2"
NETMASK="255.255.255.0"
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE="Ethernet"
DEVICE="eth1"
BOOTPROTO="static"
BROADCAST="192.168.5.255"
IPADDR="192.168.5.2"
NETMASK="255.255.255.0"
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE="Ethernet"
If I am not mistaken the way to go is to edit my static routes specifically the last line of the snippet above to specify the gateway 192.168.5.1 for the 192.168.5.0/24 network.
I have tried adding GATEWAY="192.168.5.1" to ifcfg-eth1 which creates a routing table with this interface as default. How can I maintain 3.1 as the main gateway but also force all traffic from the 192.168.5.0/24 address space to go through 192.168.5.1?