Why is default gateway reachable through two interfaces?
Posted: Tue May 22, 2012 10:50 pm
I have two interfaces (WAN1 and WAN2) connected to my ISP.
I would like to use WAN1 for normal internet access and WAN2 for incoming tunnels like PPTP and SSTP for example.
I use one dhcp client for each of the interfaces to gain two external IP addresses.
One of the clients are told to add-default-route and it will add the default route to the IP of the ISP provided gateway.
I have NAT and filter settings based on Interface.
So far everything works fine, but every now and then, I gain IP addresses of the same subnet.
This means that my default route tells me that the gateway is reached through both WAN1 and WAN2. This is correct.
But the RouterOS selects WAN2 to use (why does it do that?) and then my firewal rules does not apply anymore as they are defined per interface.
How can I tell my RouterBoard that the default route shall communciate through WAN1 only, even though it can be reached throuch WAN2?
I would like to use WAN1 for normal internet access and WAN2 for incoming tunnels like PPTP and SSTP for example.
I use one dhcp client for each of the interfaces to gain two external IP addresses.
One of the clients are told to add-default-route and it will add the default route to the IP of the ISP provided gateway.
I have NAT and filter settings based on Interface.
Code: Select all
/ip dhcp-client print
Flags: X - disabled, I - invalid
# INTERFACE USE ADD STATUS ADDRESS
0 WAN1 yes yes bound 83.233.113.217/25
1 WAN2 no no bound 83.233.113.156/25
So far everything works fine, but every now and then, I gain IP addresses of the same subnet.
Code: Select all
> /ip address print
Flags: X - disabled, I - invalid, D - dynamic
# ADDRESS NETWORK INTERFACE
0 192.168.112.1/24 192.168.112.0 Optional
1 192.168.110.1/24 192.168.110.0 Trusted
2 D 83.233.113.217/25 83.233.113.128 WAN1
3 D 83.233.113.156/25 83.233.113.128 WAN2
But the RouterOS selects WAN2 to use (why does it do that?) and then my firewal rules does not apply anymore as they are defined per interface.
Code: Select all
/ip route print detail
Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme, B - blackhole, U - unreachable, P - prohibit
0 ADS dst-address=0.0.0.0/0 gateway=83.233.113.129 gateway-status=83.233.113.129 reachable via WAN2 distance=0 scope=30 target-scope=10
vrf-interface=WAN1
1 ADC dst-address=83.233.113.128/25 pref-src=83.233.113.217 gateway=WAN1,WAN2 gateway-status=WAN1 reachable,WAN2 reachable diset-scope=10
2 ADC dst-address=192.168.110.0/24 pref-src=192.168.110.1 gateway=Trusted gateway-status=Trusted reachable distance=0 scope=10
3 ADC dst-address=192.168.112.0/24 pref-src=192.168.112.1 gateway=Optional gateway-status=Optional reachable distance=0 scope=10