I have a situation:
2 Local subnets (Subnet1 and Subnet2) need to access the internet through the same MT PC, yet using different gateways.
Required to set Routing to direct each Local IP range to the Correct Gateway.
Setup ot the MT Unit: 1 Wlan and 1 Ethernet
The WLAN is in bridge mode with (dynamic)WDS enabled on Bridge1.
The Bridge1 Interface has Ether1 and WDS(dynamic) as ports.
Ether1 connects to a switching-hub. To this hub connects PC1 and two Internet Routers(Gateways) (Router1 and Router2)
PC1 has an IP on the same range as Subnet1.
There are 4 IP addresses set to Interface Bridge1 on the MT unit:
IP1 is the gateway of local Subnet1
IP2 is the gateway of local subnet2
IP3 is on the same range as Router1
IP4 is on the same range as Router2
Masquerade: Two rules set: One for srcaddress=subnet1 and one for srcaddress=subnet2
Routing Marks:
In Mangle two routing marks are set: One for srcaddress=subnet1 (Routing Mark=Subnet1Route)
and one for srcaddress=subnet2 (Routing-Mark=Subnet2Route)
In IP Routes:
Setting1
Two routes set:
Routing Mark = Subnet1Route => gateway = Router1 IP
Routing Mark = Subnet2Route => gateway = Router2 IP
Setting2
Alternative setup:
Default Gateway => Router1 IP
Routing Mark = Subnet2Route => gateway = Router2 IP
In Both settings, the gateway allocation works correctly.
Problem
In Both settings, PCs from different subnets can access each other until the routing rules are enabled.
In the Setting1, PC1 can access subnet1 until the routing rules are enabled. In the second setting, PC1 can access subnet1.
Any advice? Any better approach for gateway allocation? Thx