I'm trying to set up two interfaces basically like its own router on an EdgeRouter Pro using policy based routing, but I can't get it to work.
Basically I have a point-to-point link from my upstream provider with a /30 (say, they're at 172.0.59.57/30 and I've set up eth7 as 172.0.59.58/30). I need to be the default route for a /29 network that goes to a layer-2 switch (like a DMZ). Let's say the network 10.0.177.48/29, so I've set up eth6 as 10.0.177.49/29.
(I've changed the IPs but the real networks I'm using are public ranges)
Then I need another interface on the 10.0.177.48/29 network that acts as my default route for the rest of the router, and that's going back to the L2 switch connected to eth6 - say, eth2 with IP 10.0.177.50/29.
So connection to 8.8.8.8 from a host on one of my LANs, I would want it to go through say, 10.43.0.5 (host) ->10.43.0.1 (ER-Pro eth0) -> 10.0.177.50 (ER-Pro eth2 - main default route) -> (L2 switch) -> 10.0.177.49 (ER-Pro eth6) -> 172.0.59.58 (ER-Pro eth7 - table 1 default route) -> 172.0.59.57 (provider P2P endpoint) -> (provider network) -> 8.8.8.8.
At the moment, I have a modify firewall for the public zone which I want to completly screen off - so I don't do a source address or anything because I want it to apply to all traffic on those interfaces -
modify PUBLIC_ZONE {
rule 10 {
description "All traffic use special WAN route table 1"
modify {
table 1
}
}
}
This table just looks like this so far:
table 1 {
route 0.0.0.0/0 {
next-hop 172.0.59.57 {
}
}
}
This is applied to eth6 and eth7:
ethernet eth6 {
address 10.0.177.49/29
description public-net
duplex auto
firewall {
in {
modify PUBLIC_ZONE
}
}
speed auto
}
ethernet eth7 {
address 172.0.59.58/30
description provider-fibre
duplex auto
firewall {
in {
modify PUBLIC_ZONE
}
}
speed auto
}
I haven't even set up the other IP on that subnet yet though, because so far, when I plug in eth6 to the L2 switch and eth7 to the media converter of the P2P link, connected routes for their subnets end up in the main routing table.
Is there any way to get the 'directly connected' routes to go to table 1 for those interfaces? Or should I just buy another router for the public zone? (I do have an ER-X lying around which I will probably set up temporarily, but it would be nice to be able to just do it all on the one router).
Thanks!