I have this configuration with 2 providers (1 pppoe and 1 static IP) and can’t get it to work.
I want to make 3 LAN:
192.168.0.1/24 → goes through PPPOE
192.168.1.1/24 → goes through static IP
192.168.2.1/24 → goes through static IP
I don’t want any balancing, and no failover.
Anyone can help with a script? I managed to make all 3 LAN to go through static IP, but if i create mangle rules, it won’t work at all.
Suppose you would connect separate switches for each of the 3 LANs you should do the following.
Connect those switches to ether1,2 and 3.
Connect ISP’s to ether6 and ether7
Configure the 3 IP’s from you LAN to three different ports of the RouterBoard
/ip address
add address=192.168.0.1/24 interface=ether1
add address=192.168.1.1/24 interface=ether2
add address=192.168.2.1/24 interface=ether3connect your both ISP connections to the routerboard and configure the interfaces and create the pppoe client. Lets say that the pppoe is ISP1 and the other is ISP2
/interfaces pppoe-client
add interface=ether6 name=pppoe-out user= password= use-peer-dns=yes add-default-route=noFor the other ISP connection I do not exactly know how it is delivered.
Than create some mangle rules and routing rules for the traffic to flow the right way
/ip firewall mangle
add chain=prerouting in-interface=ISP1 connection-mark=no-mark action=mark-connection new-connection-mark=ISP1_conn
add chain=prerouting in-interface=ISP2 connection-mark=no-mark action=mark-connection new-connection-mark=ISP2_conn
add chain=prerouting in-interface=ether1 connection-mark=no-mark dst-address-type=!local action=mark-connection new-connection-mark=ISP1_conn
add chain=prerouting in-interface=ether2 connection-mark=no-mark dst-address-type=!local action=mark-connection new-connection-mark=ISP2_conn
add chain=prerouting in-interface=ether3 connection-mark=no-mark dst-address-type=!local action=mark-connection new-connection-mark=ISP2_conn
add chain=prerouting connection-mark=ISP1_conn in-interface=ether1 action=mark-routing new-routing-mark=to_ISP1
add chain=prerouting connection-mark=ISP2_conn in-interface=ether2 action=mark-routing new-routing-mark=to_ISP2
add chain=prerouting connection-mark=ISP2_conn in-interface=ether3 action=mark-routing new-routing-mark=to_ISP2
add chain=output connection-mark=ISP1_conn action=mark-routing new-routing-mark=to_ISP1
add chain=output connection-mark=ISP2_conn action=mark-routing new-routing-mark=to_ISP2
/ip route
add dst-address=0.0.0.0/0 gateway= routing-mark=to_ISP1
add dst-address=0.0.0.0/0 gateway= routing-mark=to_ISP2Also some masquerade rules are needed
/ip firewall nat
add chain=src-nat action=masquerade out-interface=pppoe-client
add chain=src-nat action=masquerade out-interface=ether7