Hi all
After hours of reading forum dues I doesn’t find a solution that works. I hope one of you can help.
I have the attached network (see diagram)
I have two internet connections over a pfSense – Firewall. One of this connection is protected with a captive portal. So, the goal will be, that the VL_LAN on eth2 can only connect the internet after login and the VL_LANE on eth3 has a direct internet access.
So, if I don’t use mangle rules, I can connect ether over LANE on eth3 or LAN on eth1 (pfSense – Firewall) to the internet, according to, with default gateway is in first position or activated. But if I try to build some routing rules, it doesn’t work though I think it should work with the following settings:
Mangle:
[admin@MikroTik] /ip firewall mangle> print
Flags: X - disabled, I - invalid, D - dynamic
0 chain=prerouting action=mark-routing new-routing-mark=RM_LANE
passthrough=yes src-address=172.20.0.0/16 dst-address=!192.168.2.0/24
in-interface=VL_LANE
1 chain=prerouting action=mark-routing new-routing-mark=RM_LAN passthrough=yes
src-address=192.168.2.0/24 dst-address=!172.20.0.0/16 in-interface=VL_LAN
[admin@MikroTik] /ip firewall mangle>
Route with routing mark:
[admin@MikroTik] /ip route> export
aug/09/2012 09:01:26 by RouterOS 5.19
/ip route
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=172.16.1.1 routing-mark=RM_LANE scope=30
target-scope=10
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=192.168.1.1 routing-mark=RM_LAN scope=30
target-scope=10
[admin@MikroTik] /ip route>
Routes:
[admin@MikroTik] /ip route> print
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
DST-ADDRESS PREF-SRC GATEWAY DISTANCE
0 S 0.0.0.0/0 172.16.1.1 1
1 S 0.0.0.0/0 192.168.1.1 1
2 ADC 172.20.0.0/16 172.20.0.1 BR_LANE 0
3 ADC 192.168.2.0/24 192.168.2.1 BR_LAN 0
4 ADC 192.168.5.0/24 192.168.5.1 BR_Data 0
5 ADC 192.168.10.0/24 192.168.10.25 Administration 0
[admin@MikroTik] /ip route>
NAT:
[admin@MikroTik] /ip firewall nat> print
Flags: X - disabled, I - invalid, D - dynamic
0 chain=srcnat action=masquerade out-interface=LAN
1 chain=srcnat action=masquerade out-interface=LANE
[admin@MikroTik] /ip firewall nat>
I mark the corresponding network traffic and try it to route with the corresponding routing mark ether to the right gateway but from both networks I cannot connect to the internet.
Who can help?
Thanks
Dani
