lode balancing in 2 pppoe or 1 wan
Hi @soniarun11 and welcome to the forum. Though I really enjoy a good riddle, you might want to give some more info.
Meanwhile, as you are probably reffering to load balancing, you can read this part of the documentation (if not found yet):
But are new "users" competing to see who writes the least?
This is a new "Lode"...
/ip firewall filter
disable [find action=fasttrack-connection]
/interface print
pppoe-out1
pppoe-out2
ether3 (DHCP WAN)
bridge-lan
If names are different, replace them exactly
Clear Old Rules (to avoid conflict)
/ip firewall mangle remove [find]
/ip firewall nat remove [find]
/ip route remove [find where dst-address=0.0.0.0/0]
NAT (Must be correct)
/ip firewall nat
add chain=srcnat out-interface=pppoe-out1 action=masquerade
add chain=srcnat out-interface=pppoe-out2 action=masquerade
add chain=srcnat out-interface=ether3 action=masquerade
Mangle Rules (FIXED ORDER – ROS v7)
/ip firewall mangle
Accept local traffic
add chain=prerouting dst-address=192.168.0.0/16 action=accept
PCC connection marking
add chain=prerouting in-interface=bridge-lan
per-connection-classifier=both-addresses-and-ports:3/0
action=mark-connection new-connection-mark=wan1_conn passthrough=yes
add chain=prerouting in-interface=bridge-lan
per-connection-classifier=both-addresses-and-ports:3/1
action=mark-connection new-connection-mark=wan2_conn passthrough=yes
add chain=prerouting in-interface=bridge-lan
per-connection-classifier=both-addresses-and-ports:3/2
action=mark-connection new-connection-mark=wan3_conn passthrough=yes
Routing mark
add chain=prerouting connection-mark=wan1_conn
action=mark-routing new-routing-mark=to_wan1 passthrough=no
add chain=prerouting connection-mark=wan2_conn
action=mark-routing new-routing-mark=to_wan2 passthrough=no
add chain=prerouting connection-mark=wan3_conn
action=mark-routing new-routing-mark=to_wan3 passthrough=no
Routes (Correct Way for ROS v7)
/ip route
add dst-address=0.0.0.0/0 gateway=pppoe-out1 routing-mark=to_wan1
add dst-address=0.0.0.0/0 gateway=pppoe-out2 routing-mark=to_wan2
add dst-address=0.0.0.0/0 gateway=ether3 routing-mark=to_wan3
/ip route
add dst-address=0.0.0.0/0 gateway=pppoe-out1 distance=1
add dst-address=0.0.0.0/0 gateway=pppoe-out2 distance=2
add dst-address=0.0.0.0/0 gateway=ether3 distance=3
DNS
/ip dns
set servers=8.8.8.8,1.1.1.1 allow-remote-requests=yes but not working please help
It's not working because it's AI generated crap.
If you want to use PCC, spend some time to read the documentation
Per connection classifier - RouterOS - MikroTik Documentation
And watch this video from MikroTik:
Multiple uplinks using PCC, Load balancing
Alternatively, if you don't want to deal with routing tables and mangle rules, and just need equal distribution of the connection over the 3 WAN, you don't even have to do much, just setup your WAN with "Add Default Route" turned on using the default distance setting (1), add the masquerade NAT rule for all 3 outgoing interfaces, and ECMP (Equal Cost Multi-Path) will be used.
please check my scrpet is ok or not dhcp wan not working in lan STEP 1: Configure WAN Interfaces
WAN1 - PPPoE
/interface pppoe-client add name=pppoe-WAN1 interface=ether1 user=arunverma password=password add-default-route=no disabled=no
WAN2 - PPPoE
/interface pppoe-client add name=pppoe-WAN2 interface=ether2 user=kns2@wavenet.in password=password add-default-route=no disabled=no
WAN3 - DHCP
/ip dhcp-client add interface=ether3 add-default-route=no disabled=no
#-------------------------------
STEP 2: Configure LAN Bridge
/interface bridge add name=bridge-LAN1
/interface bridge port add bridge=bridge-LAN1 interface=ether4
Assign IP address
/ip address add address=192.168.1.1/24 interface=bridge-LAN1
#-------------------------------
STEP 3: Configure DHCP Server
/ip pool add name=LAN1-Pool ranges=192.168.1.10-192.168.1.254
/ip dhcp-server add name=dhcp-LAN1 interface=bridge-LAN1 address-pool=LAN1-Pool disabled=no
/ip dhcp-server network add address=192.168.1.0/24 gateway=192.168.1.1 dns-server=8.8.8.8,1.1.1.1
#-------------------------------
STEP 4: Configure DNS
/ip dns set servers=8.8.8.8,1.1.1.1 allow-remote-requests=yes
#-------------------------------
STEP 5: NAT (Masquerade for Internet)
/ip firewall nat
add chain=srcnat out-interface=pppoe-WAN1 action=masquerade
add chain=srcnat out-interface=pppoe-WAN2 action=masquerade
add chain=srcnat out-interface=ether3 action=masquerade
#-------------------------------
STEP 6: PCC Load Balancing (Connection & Routing Marks)
/ip firewall mangle
LAN1 PCC
add chain=prerouting in-interface=bridge-LAN1 connection-mark=no-mark action=mark-connection new-connection-mark=WAN1_conn per-connection-classifier=src-address:3/0
add chain=prerouting in-interface=bridge-LAN1 connection-mark=no-mark action=mark-connection new-connection-mark=WAN2_conn per-connection-classifier=src-address:3/1
add chain=prerouting in-interface=bridge-LAN1 connection-mark=no-mark action=mark-connection new-connection-mark=WAN3_conn per-connection-classifier=src-address:3/2
Mark routing based on connection marks
add chain=prerouting connection-mark=WAN1_conn action=mark-routing new-routing-mark=to_WAN1
add chain=prerouting connection-mark=WAN2_conn action=mark-routing new-routing-mark=to_WAN2
add chain=prerouting connection-mark=WAN3_conn action=mark-routing new-routing-mark=to_WAN3
#-------------------------------
STEP 7: Routes (Load Balancing + Failover, distance=1)
/ip route
WAN1
add gateway=pppoe-WAN1 routing-mark=to_WAN1 distance=1 check-gateway=ping
WAN2
add gateway=pppoe-WAN2 routing-mark=to_WAN2 distance=1 check-gateway=ping
WAN3 (DHCP)
add gateway=ether3 routing-mark=to_WAN3 distance=1 check-gateway=ping
Default routes (all distance=1)
add gateway=pppoe-WAN1 distance=1
add gateway=pppoe-WAN2 distance=1
add gateway=ether3 distance=1
