Completely lost as to what I'm doing wrong here. I have 2 PPPoE connections, prima and seconda. What I want to do is:
-Connections initiated from internal network route through prima
-Connections initiated from prima route through prima
-Connections initiated from seconda route through seconda
But when I set up routing with routing marks, NAT doesn't work anymore for some reason. Any pointers as to what I'm doing wrong?
Relevant config:
Code: Select all
/interface bridge
add l2mtu=1586 name="Guest LAN Bridge"
add l2mtu=1590 name="Hotspot DMZ Bridge"
add l2mtu=1586 name="Office LAN Bridge"
/interface ethernet
set 0 disabled=yes name="Port 1 WAN"
set 1 name="Port 2 Radius Server Port"
set 2 name="Port 3 To AT Switch"
set 3 name="Port 4 PPPoE WAN"
set 4 name="Port 5 PPPoE WAN 2"
/interface pppoe-client
add disabled=no interface="Port 4 PPPoE WAN" name="PPPoE WAN prima" password=\
xxxxxxxx user=xxxx1@isp.net
add disabled=no interface="Port 5 PPPoE WAN 2" name="PPPoE WAN seconda" \
password=xxxxxxxx user=user=xxxx1@isp.net
/interface vlan
add interface="Port 3 To AT Switch" l2mtu=1586 name="Guest LAN" vlan-id=3
add interface="Port 3 To AT Switch" l2mtu=1586 name="Office LAN" vlan-id=1
/ip address
add address=192.168.253.254/24 interface="Hotspot DMZ Bridge" network=\
192.168.253.0
add address=192.168.254.254/24 interface="Office LAN Bridge" network=\
192.168.254.0
add address=192.168.251.1/24 interface="Guest LAN Bridge" network=\
192.168.251.0
/ip firewall filter
add action=drop chain=input comment="Traffic to router" connection-state=\
invalid
add chain=input connection-state=established
add chain=input connection-state=related
add chain=input comment="Administration from local LAN" in-interface=\
"Office LAN Bridge" src-address=192.168.254.0/24
add action=drop chain=input comment="And drop everything else"
add action=drop chain=forward comment="Routed Traffic" connection-state=\
invalid
add chain=forward connection-state=established
add chain=forward connection-state=related
add chain=forward comment="Accept traffic from internal networks" \
in-interface="Office LAN Bridge"
add chain=forward in-interface="Guest LAN Bridge" out-interface=\
"PPPoE WAN prima"
add chain=forward in-interface="Hotspot DMZ Bridge" out-interface=\
"PPPoE WAN prima"
add action=drop chain=forward comment="And throw out everything else"
/ip firewall mangle
add action=mark-connection chain=prerouting comment=\
"Routing mark for connections originating from internet connection prima" \
connection-state=new in-interface="PPPoE WAN prima" new-connection-mark=\
prima
add action=mark-connection chain=prerouting comment=\
"Packet marks for connections originating locally" connection-state=new \
in-interface="Guest LAN Bridge" new-connection-mark=prima
add action=mark-connection chain=prerouting connection-state=new \
in-interface="Hotspot DMZ Bridge" new-connection-mark=prima
add action=mark-connection chain=prerouting connection-state=new \
in-interface="Office LAN Bridge" new-connection-mark=prima
add action=mark-routing chain=prerouting connection-mark=prima \
new-routing-mark=prima-route passthrough=no
add action=mark-routing chain=prerouting comment=\
"Catch all for packets with no connection mark - default to prima" \
connection-mark=no-mark new-routing-mark=prima-route passthrough=no
add action=mark-connection chain=prerouting comment="Packet marks for connecti\
ons originating from internet connection seconda" connection-state=new \
in-interface="PPPoE WAN seconda" new-connection-mark=seconda
add action=mark-routing chain=prerouting connection-mark=seconda \
new-routing-mark=seconda-route passthrough=no
/ip firewall nat
add action=masquerade chain=srcnat comment="NAT traffic on WAN interface" \
out-interface="PPPoE WAN prima"
add action=masquerade chain=srcnat comment="NAT traffic on WAN interface" \
out-interface="PPPoE WAN seconda"
/ip route
add distance=1 gateway="PPPoE WAN prima" routing-mark=prima-route scope=\
255
add distance=1 gateway="PPPoE WAN seconda" routing-mark=seconda-route scope=\
255
add distance=1 gateway="PPPoE WAN prima" scope=255